Debugging: Difference between revisions
Nin10doGMod (talk | contribs) mNo edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 21: | Line 21: | ||
setDeveloperMode(true); | setDeveloperMode(true); | ||
game:game.getMap().getPlayer(0).getCO(0).setPowerFilled( | game:game.getMap().getPlayer(0).getCO(0).setPowerFilled(10); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The '''setPowerFilled()''' parameter, sets the number of stars filled. | |||
Note that it depends on how many stars CO has. | |||
==Filling up funds== | |||
You may fill up or modify the number of funds given. Start by opening the game console by pressing '''f1''' while in a game map. There type the following: | |||
<syntaxhighlight lang="javascript"> | |||
setDeveloperMode(true); | |||
game:game.getMap().getPlayer(0).setFunds(999999999); | |||
</syntaxhighlight> | |||
'''addFunds()''' works too, but that adds instead of setting to a specific number. | |||
The '''setFunds()''' parameter, sets the number of funds filled. | |||
[[Category:Modding tutorials]] | [[Category:Modding tutorials]] |
Latest revision as of 23:45, 3 August 2023
There are mechanisms intended to help debug the game.
Printing to the console
The game has an integrated function which you can use to debug output
GameConsole.print("String", 1);
Passing the 1 as a parameter, allows you to see the output, when you press F1, while the game is open.
Setting Debug Log Levels
The Commander_Wars.ini file includes options to output more debug data into the game's console. By setting LogActions to true, you can get more detailed information about the running functions in the game.
Filling up CO stars
You may fill up or modify the number of stars a given CO has filled up. Start by opening the game console by pressing f1 while in a game map. There type the following:
setDeveloperMode(true);
game:game.getMap().getPlayer(0).getCO(0).setPowerFilled(10);
The setPowerFilled() parameter, sets the number of stars filled.
Note that it depends on how many stars CO has.
Filling up funds
You may fill up or modify the number of funds given. Start by opening the game console by pressing f1 while in a game map. There type the following:
setDeveloperMode(true);
game:game.getMap().getPlayer(0).setFunds(999999999);
addFunds() works too, but that adds instead of setting to a specific number.
The setFunds() parameter, sets the number of funds filled.