Jump to content

AvernumScript/Appendix/Debugging Procedures

From Wikibooks, open books for an open world

These are all debugging functions, used to provide information while you write a scenario. They probably should be removed before you actually release your scenario to the public.

void print_num(short num)

[edit | edit source]
Prints the number num in the text area.

void print_nums(short a,short b,short c)

[edit | edit source]
Prints the numbers a, b, and c in the text area.

void turn_on_debug_mode()

[edit | edit source]
Enables debug mode for your scenario. To turn on debugging mode, type “}”, followed by “=” (so a right bracket, followed by an equals sign). To turn off debugging mode, type an equals sign. Once on, you can use the following commands:
Debug Mode Commands
Key Combo Effect
Shift-’k’ Kills all hostile monsters in the whole town.
Shift-’m’ Magic map. All creatures in the area will show up on the map. Type Shift-’m’ again to turn this off.
Shift-’g’ Enter ghost mode.

You will be able to walk through walls, and even through blackness. Type Shift-’g’ again to turn this off.

Shift-’h’ Heals and restores spell energy for everyone in your group.
Shift-‘l’ Add light. Gives the party 100 more turns of light.
Shift-‘i’ Advances the time in the scenario one day.
Shift-‘s’ Set special items.

Dialog boxes will come up asking you for two numbers. The first number you give is the number of a special item. The second number is the number of that special item the party would be set to have> (so if you enter 12 and 4, the party will have 4 of special item 12.)

Shift-‘f’ Set Stuff Done Flags.

You will be asked for 3 numbers. The first two numbers are the coordinates of a stuff done flag. If the third number is –1, you will be told the value of that flag in the text area. Otherwise, that SDF will be set to the third number. (So if you enter 5, 23, and –1, then the text area will tell you the value of SDF(5,23). If you enter 5, 23, and 8, then SDF(5,23) will be set to 8.

Note: Debug mode is automatically turned off whenever you load a saved game or enter a new scenario.

Note: This call should definitely be removed before you release your scenario.