Cheats are proving a problem

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Cheats are proving a problem

Post by Hidden Hands »

This has been bothering me for years now, but unfortunately, I've never actually found any help on this issue due to some strange belief held by GZDoomers that CHEATS should always be available or unchanged. My game is a stand-alone, non-DOOM related game. It has nothing in common with DOOM except for the fact it runs on the GZDoom Engine. And I have an issue with the cheat codes being available to those who play it.

I do not want people to use cheats from DOOM in my non-Doom game. Last time I asked about this, there was some kind of strict brick wall that nobody was willing to assist me with getting past, and now my game is getting very, very close to release and this issue needs to be taken on, because I'm not going to release it until it is fixed.

I completely understand why cheats may not be looked fondly upon being changed in DOOM mods, and I completely get it. I am in that same camp. They are iconic and important to DOOM and changing them causes people to not only to troll players with bad trap maps but also takes away from its legacy. I get it. Totally. But my game is not a DOOM game. I chose to use the GZDoom Engine because I love the doom "VIBE" while having all the newer features that my own project requires to work the way it was planned. But the cheats from DOOM are not suitable as an option in my game. Giving full everything, invincibilty, walking through walls... these really should not be in my game, at all. It's not what I want in my own game.

So I took the alternate route of trying to figure out some way I can modify GZDoom itself to either replace, remove or rewrite the cheat code system. The most I could do was change the display message when activating these cheats. This didn't help at all. So I tried an alternate, popular option I've seen on other peoples threads. DISABLECHEATS in the MapInfo. This is NOT the method I wanted to use. I wanted my own cheats, no disable cheats entirely. But this didn't even work whatsoever when I booted the game up anyway.

This is a serious problem. I was told last time, that I should leave the cheats, and if people want to cheat that's their problem. Yes, I agree it is. But I should have the ability to decide what the cheat is, what it does and why in my own game. I shouldn't have to have it based on the original DOOM cheats. Those belong to DOOM. Not my game. I had a similar problem with save points, something that offended so many people that I got rather harsh, unpleasant responses when I said I wanted save points rather than "save anywhere". This is a problem that still remains in my game now, over 2 years later because nobody was willing to help me remove the function for a new one, tailored to my own game project that isn't DOOM.

But the focus here is NOT on save points, that's a seperate issue. This one is on cheats. I'm not entirely sure why these cheats (or save points for that matter) are being gatekept because this is hindering the developer from making something original with this amazing open source engine. I would be surprised if people didn't remember what Heretic did with cheats. Using IDDQD in that game caused the player to die instantly. This is a doom engine game, that isn't doom, using a doom cheat differently. Because it is NOT Doom, it seems perfectly reasonable to me that this is the effect the cheat has. My game should have the same freedom (although I will not want any suicide cheats in my game, I used Heretic as an example). I need a solution of some kind, because I really do not want my game released with cheats for an unrelated game still active inside them.

I do appreciate that GZDoom is, at its very core, DOOM, but many game projects have been made using this engine since DOOMEngine, in reality, is an open source engine allowing for developers to make games with it. I'm almost certain a condition of this was not demanding DOOM's cheats remain active within their projects.

Can someone, anyone, please, help me ... even if its in PM and you don't want just anyone knowing how to do it, show me how to replace cheats with my own or switch them off entirely. I can't release my game until I have a solution, and sadly, it's very close to being finished now.

Thanks in advance.
User avatar
m8f
 
 
Posts: 1456
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Location: Siberia (UTC+7)
Contact:

Re: Cheats are proving a problem

Post by m8f »

The thing is, fighting with cheaters is futile. People will always find a way. Even if built-in cheats are disabled, people can load a mod that makes them invulnerable. Or open your WAD/PK3 and put medikits everywhere. Or load your game with custom modified engine version where they have infinite ammo. Or play a game in a virtual machine with save states.

Adding more cheats is doable. Here is an example made with ZScript: https://github.com/mmaulwurff/custom-cheats (Download ZIP, which is usable as a PK3).
This mod reads player key input, and if it matches "givesoul" or "shotg", gives a soulsphere or a shotgun to the player. I tried to comment the code to make it readable. This way, you can add your own cheat codes with custom behavior. You can also add additional effects to existing Doom codes. My pk3 doesn't override original cheat codes and cannot be disabled by DisableCheats.

Edit: just to add a note, custom cheat codes were already done before. For example, SWWM GZ has them.

Edit2: update: added check for chat commands.
Last edited by m8f on Tue Oct 26, 2021 8:33 pm, edited 3 times in total.
User avatar
Rachael
Posts: 13922
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Cheats are proving a problem

Post by Rachael »

Hmmm - I think he's referring to the IDDQD, IDFA, etc cheats, specifically, not necessarily the ones from the console. As far as I know there was a feature implemented to disable those. It's called "nokeyboardcheats" and it's available in one of the definition sections, I can't remember if it's mapinfo/gameinfo or iwadinfo.

edit: Okay just looked it up. It's IWADINFO, and you simply add the line "NoKeyboardCheats" it should work.

This, in addition to m8f's solution, should disable the arbitrary iddqd's and allow you to replace them with whatever you want instead.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Cheats are proving a problem

Post by Hidden Hands »

Ah wonderful thank you so much.

One quick question. Am I doing something wrong here? My IWADINFO is as follows:

Code: Select all

IWAD
{
NoKeyboardCheats
}
But when I test run, the cheats still work. I imagine I've set the Iwad up wrongly?
User avatar
Rachael
Posts: 13922
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Cheats are proving a problem

Post by Rachael »

First off - how are you running it on the command line?

Second - is your "allcheats" cvar turned off?

Thirdly - are you running GZDoom or LZDoom? I don't know if LZDoom has this feature or not.

Fourthly - what is your complete IWADINFO like?

Fifthly - I have not tested this feature extensively so I don't know how well it really works.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Cheats are proving a problem

Post by Hidden Hands »

I'm using GZDOOM, and the example I posted is my entire IWADINFO. There's nothing else in it. Is that the issue? Did I do something wrong?

I'm not sure what you mean by how am I running it on the command line though. Or what an allcheats cvar is?
User avatar
Rachael
Posts: 13922
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Cheats are proving a problem

Post by Rachael »

The IWADINFO needs to be fleshed out a bit, I think.

https://zdoom.org/wiki/IWADINFO

I think this is about minimal, this should get you started:

Code: Select all

IWad
{
	Name = "My Excellent Game"
	BannerColors = "a8 00 00", "a8 a8 a8"
	Autoname = "myexcellentgame.official"
	Game = "Doom"
	Config = "MyExcellentGame"
	IWADName = "myexcellentgame.ipk3"
}
Revae_
Posts: 3
Joined: Sun Jun 27, 2021 5:21 pm

Re: Cheats are proving a problem

Post by Revae_ »

I also had a problem with custom cheats, but I just wanted to mention that m8f's solution works quite well. Though I shortened the wait time on keyboard inputs. Only issue with it is if you hit the "say" function (whatever it's mapped to on your keyboard) it interrupts the cheat so you can talk. Which might be an issue depending on how you do your cheats. Mine are number codes so it shouldn't be a problem.

Also apparently I forgot my password and can't recover it since I used an ancient email on zdf apparently.

Anyway, thanks for just-about solving this m8f.
User avatar
m8f
 
 
Posts: 1456
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Location: Siberia (UTC+7)
Contact:

Re: Cheats are proving a problem

Post by m8f »

Added a check for chat commands. If player typed something, and then hit a chat key, it's ignored. Chat commands still work if pressed separately.
Updated the PK3 in my previous post: viewtopic.php?f=122&t=72552&p=1192380#p1192380
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Cheats are proving a problem

Post by Hidden Hands »

I've been trying to get this to work but for whatever reason I'm still having the same problem. I think I'm way out of my depth here. I really need more help. :(
User avatar
m8f
 
 
Posts: 1456
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Location: Siberia (UTC+7)
Contact:

Re: Cheats are proving a problem

Post by m8f »

"The same problem" - which one? Are you referring to my custom cheats or IWADINFO issues?
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Cheats are proving a problem

Post by Hidden Hands »

m8f wrote:"The same problem" - which one? Are you referring to my custom cheats or IWADINFO issues?
Oops! Sorry I should have been more specific. The cheats setup is still giving me problems (most likely nobodys fault but my own lack of understanding). I'm still able to activate cheats with doom keyboard inputs. I think I'm a bit out of my depth. But I can't realease my game without it fixed.
User avatar
Revae
Posts: 98
Joined: Wed Jul 02, 2014 7:52 pm
Location: CA
Contact:

Re: Cheats are proving a problem

Post by Revae »

Found my acct...
Thanks for the updated pk3 m8f, your solution is very much appreciated.
Really though custom cheats should be allowed by the engine imo, since there's like 4 layers of back and forth between the author and player to try and tackle the issue. Seems needlessly complex.
nokeyboardcheats -> allcheats -> hiding allcheats from the menu -> console cheats existing anyway... It seems like just allowing console cheats, that work on all iwads anyway, and allowing authors to change the keyboard cheats would make most sense. Especially since GZDoom is practically a standalone game engine at this point anyway.
Still trying to figure out a way to get a noclip cheat working, since you can't run a console command from zscript, and setting a NOCLIP flag via A_changeflag doesn't seem to do anything.
But I made a cheat that spawns a little friendly rabbit, so that's cool. And my invuln cheat makes projectiles bounce off the player. So yeh. Having fun with it.
Guest

Re: Cheats are proving a problem

Post by Guest »

Noclip can be activated with ZScript like this: https://github.com/mmaulwurff/hellscape ... ice.zs#L46
User avatar
Revae
Posts: 98
Joined: Wed Jul 02, 2014 7:52 pm
Location: CA
Contact:

Re: Cheats are proving a problem

Post by Revae »

Thank you very much.
I haven't used much zscript, or even decorate or acs for that matter, so I'm just hacking away over here with whatever tool I can find.
Post Reply

Return to “Scripting”