Prefix all cheat codes with "TNT" (if they aren't already) to be like "tntcomp", for example. Place them into a look-up table. Every time a user enters "TNT" process X key strokes (where X = the length of the longest cheat code minus "TNT") as potential cheat codes, comparing the keys pressed against the look-up table and ignoring any binds (like "Y" = quit) for the length of X. If the sequence of the pressed keys matches a cheat code in the table, execute that code; if it does not match do nothing.
Or perhaps replace "TNT" with "e6y" if you like. ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Or you can make three look-up tables: one for "id*" codes, one for "tnt*" codes and one for "e6y*" codes. The value of X would seem to be 8 then, as "idchoppers" is probably the longest cheat code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hm, this would need a 10 byte (for "idchoppers") ring buffer that saves the last 10 keys pressed and gets checked if it contains a cheat each time a key is released.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for my last post, this was brain diarrhoe. I was playing the latest SVN snapshot r4303 and believed I suffered the same issue when I played Chex Quest and tried to enter cheats. However, the reason was that the chexdeh lump that changes the cheat strings could not get loaded, because I still had an old version of prboom-plus.wad installed on my system.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What do you suggest?
Prefix all cheat codes with "TNT" (if they aren't already) to be like "tntcomp", for example. Place them into a look-up table. Every time a user enters "TNT" process X key strokes (where X = the length of the longest cheat code minus "TNT") as potential cheat codes, comparing the keys pressed against the look-up table and ignoring any binds (like "Y" = quit) for the length of X. If the sequence of the pressed keys matches a cheat code in the table, execute that code; if it does not match do nothing.
Or perhaps replace "TNT" with "e6y" if you like. ;)
Or you can make three look-up tables: one for "id*" codes, one for "tnt*" codes and one for "e6y*" codes. The value of X would seem to be 8 then, as "idchoppers" is probably the longest cheat code.
So I'll not able to move for 8 key strokes after pressing TNT? I switch weapon by these keys, for example.
Hm, this would need a 10 byte (for "idchoppers") ring buffer that saves the last 10 keys pressed and gets checked if it contains a cheat each time a key is released.
Sorry for my last post, this was brain diarrhoe. I was playing the latest SVN snapshot r4303 and believed I suffered the same issue when I played Chex Quest and tried to enter cheats. However, the reason was that the chexdeh lump that changes the cheat strings could not get loaded, because I still had an old version of prboom-plus.wad installed on my system.