I make a system of cheat codes for myself to test locations and mechanics faster. The choice of action by this system will be carried out through “match”. This means that I need the variable that I specify the construct to store which specific button the player pressed. Usually, I do this with a lot of “if” constructions. But I will have a lot of cheat combinations. And such a design will load the device very much. As a result, it should be so that if the cheat button was held down (in my case, it is the “tab”), the script determined what other button the player pressed, saved it to a variable, and used the “match” construction to choose which cheat it should use.
I have a concept, first append all inputs in a array, then run a loop from last to first values of the array, then check which cheat code is used, by if statement. If you still unable to do this, then wait 1-2 days? So I will create an addon on it.
Wouldn’t it be cool to have a node-based system? Almost similar to yours, something like a “cheat” scene that has a cheat key array parameter and a timer (just to make sure at some point it resets the tracking)
You can attach a script as parameter as well that extends “cheat” and must implement a cheat function.
The scene itself takes care of tracking key input and if the cheat array sequence is complete, it internally calls “cheat()” on the script
(why do I have the feeling it took me way too many words to explain it )
I had play GTA San Andreas almost 8 yrs ago where I used cheats, I forgot is cheats need to be input in time? Otherwise it is correct to use a scene for it, I would use it for the addon, it is important.
Is there a particular reason why you wouldn’t want to do cheats with a console_prompt? Like in Unity or UE4/5, you hit a key like tilde ( ~ ), and that opens up the console prompt, and then you type in a command and it executes it? Like noclip, to toggle it on / off? Or warp e3m2 to begin on level 2 in episode 3.