Closed nvs closed 5 years ago
Okay, so it seems the only option is to detect the side effects of the cheat codes. First, we need to identify the cheat codes that would be problematic in Gem (or could be in the future):
keysersoze
: Gold.leafittome
: Lumber.greedisgood
: Gold and lumber.warpten
: Fast building.pointbreak
: Food limit.whosyourdaddy
: One-hit kills.thereisnospoon
: Infinite mana.iseedeadpeople
: Reveals the map/fog of war.This one is pretty simple to detect. Check if the Gem not in play
player's gold or lumber goes above 0
. If so, one of the resource cheats was used.
Instruct a unit to build a long duration building somewhere. Every so often reset the build status. If it finishes, then fast building was enabled.
This does not currently apply to Gem. It may, however, in the future.
Create a two units, one being a damage source and the other a damage sink. The sink has a modest health regeneration that out paces the source. If the sink dies, the cheat was used.
Create a unit. Order it to cast a spell it does not have the mana to afford. It this spell casts, the cheat was used.
Does not currently apply to Gem. This will probably never change as cheats are only usable in single player.
Why does this matter? I do not want to disallow people from playing the map in single player. I do, however, want to be able to quickly identify the usage of a cheat code without having to pay attention during every second of a replay. If I can detect any cheat code, then I can display an indicator on the board.
Research shows that detecting of chat commands used for cheat codes in single player is not possible.
There are some natives that may be of interest, but I need to figure out what they do.These merely return whether or not the cheat codes to disable victory or defeat have been used.IsNoVictoryCheat ()
IsNoDefeatCheat ()
There are also the following map flags.
Testing will need to be done to see if they even work.They do nothing.MAP_CHEATS
MAP_CHEATS_HIDDEN