DarkOrbit Posted March 27, 2015 Share Posted March 27, 2015 Hi everyone, I am just getting started on setting up to mod Renegade X. I downloaded the SDK and have been going through looking at all the cool things and source files. I was wondering if there was an easy way to trigger something to happen when a player types a chat command - sort of like the way various Renegade servers had. For starters I just want to play around with different commands and actions to see what I can do, but is there anyone who might be able to point me in the right direction on where this might be or how I would be able to set it up? Example: A player types !sniper and if the player has 500 credits, the player is given a sniper and deducted 500 credits. Any help is appreciated Quote Link to comment Share on other sites More sharing options...
errni Posted March 28, 2015 Share Posted March 28, 2015 You can trigger the action you want by setting up a Rcon bot which would handle the command and then send a Rcon to the server. The dirty way would be to create an empty console variable that would take following format setchar [playerName] [charName] Your script code would monitor that variable for any changes every 10 miliseconds. When a player types !sniper in chat the bot would handle that message and send the command setchar examplePlayerName sniper to the server. After that your script would make the proper action and clear the variable. This is again the dirty way of achieving that and perhaps there are much better, cleaner methods but to learn them you have to read the UE3 scripting reference yourself. I don't have any experience with UnrealScript nor the engine. Maybe it allows you to register a console event that would call the function only when needed. Quote Link to comment Share on other sites More sharing options...
DarkOrbit Posted March 29, 2015 Author Share Posted March 29, 2015 Hmm okay. I was wondering if there was a way using Mutators to somehow "check" the text a player is going to send before he sends it, and then if the text contains, for example, "!sniper" then the code could perform additional actions (such as giving the player the sniper and deducting credits). This is assuming there is already a place where the message a player is trying to send can be retrieved - but I am assuming since there is a private chat function that there must be a way to somehow manipulate that. Quote Link to comment Share on other sites More sharing options...
RypeL Posted March 29, 2015 Share Posted March 29, 2015 You can google for the "mutate" console command. The mutate command sends a message to all mutators on the server and they can react to it. So you could do something like "mutate sniper" and have a mutator give you a sniper then. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.