Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Abyss on November 03, 2009, 03:57:38 pm
-
Is it possible to have the game check if a player enters a certain combination of keys correctly and if they do, have something happen. For example, the player comes across a crate, if he targets it and types the correct combination of keys, which would be reviled in a previous mission if a bonus objective was complete, he would receive the contents of the crate (which would probably be extra ammo for missiles). Also, I do have another reason for wanting this, if I can get it to do that I can also have the player self-destruct if the player types "www.freespace2.com" (mwahahahahahaha) :P. (Last part is sort of a joke, though I would probably still do it).
-
Key input is certainly possible, but a bit ... convoluted. I'll let someone who did it explain.
-
Definitely possible but probably not too easy to implement due to remapping and such. You would have to pick keys that people wouldn't be using for other things. For instance T wouldn't be a good choice as it's a default input for targeting. Then again there is nothing to keep anyone from mapping another key you might want to use for targeting so lets say you use 7 in your code and they have it set for target friendly. The input would read it as F instead of 7.
So in short doable yes. Good idea yes. Implementation bad.
Although while just typing that I thouhgt of a way that it might work. Put the player under AI control while he is typing. Never tried it but and the player would still have to take into account mapped keys but it takes a lot of the problems out of it.
-
Is there any way to add a "keypress-while-tilde-held" or something. Only suggesting it as that's how most codes are currently entered. . . Might be completely irrelevant but i'll never know :p
-
Is there any way to add a "keypress-while-tilde-held" or something. Only suggesting it as that's how most codes are currently entered. . . Might be completely irrelevant but i'll never know :p
Well if I'm going to go for the anti-cheating and cant check the master code, maybe that would work, is it possible to check if ~ is pressed at all (if so then it will be press ~ and boom [though I will feel sorry for the person who presses c, ~, and then gets blown to bits in the middle of the mission], if not then oh well)
-
The problem is that you basically have the engine against you there. It is hardcoded to parse the keypress sequences directly, before the sexps get a look at the keypresses.
In other words, you can't "redirect" the keypresses to prevent cheating.
-
Anti cheating is pointless. Any halfway competent FREDder could remove your convoluted anti-cheating method in seconds.
Not to mention that someone could simply run a debug build and activate the cheats without typing in the code.
While stopping in game cheating is a good idea (making sure the player can't find an easy way to blow up the enemy by getting his wingmen to do it or something) is worth doing, when dealing with the cheat codes you're dealing with someone who has deliberately decided to cheat at your mission, not simply exploited a flaw in it. Trying to prevent them is a waste of time.
-
Anti cheating is pointless. Any halfway competent FREDder could remove your convoluted anti-cheating method in seconds.
Not to mention that someone could simply run a debug build and activate the cheats without typing in the code.
Meh, that was just the secondary reason I wanted this. I thought I would state it so people know everything I wanted to gain out of this. However there are other implications that I want it for.
-
The other stuff is fine. I was just pointing out not to waste your time trying to cancel out the cheat code.