While snooping around in Unreal’s
UCheatManager class I found something fun,
a function called
CheatScript. It lets you store a set of cheats in a .ini,
and then run them with a single command. It seems very handy for
getting the player into a particular state for testing.
Anyway, here’s how to use it.
- Inside your
DefaultGame.inifile, add a new section that starts with
Cheatscriptfollowed by the name you want to give to, e.g.
- Underneath, add the cheats you want in the format
Keycan be anything, all your entries can have the same key, it’s just that the ini file has to be in the format
X=Y. The value part,
Cheatis what you would normally put into the cheat console.
- Run your game and open the cheat console with tilde
, and type inCheatScript GiveAll
(whereGiveAll` is the name of the section).
- The section headings have a period between
CheatScriptand the cheat name, but when executing the cheat, you need to use a space
- As far as I can tell, changes
DefaultGame.iniare not noticed while the editor is running. So unfortunately if you change or add to your set of cheats