-
Notifications
You must be signed in to change notification settings - Fork 9
Debuggingfeatures
It happens to the best of us - you're merrily plowing along making your game, when suddenly something just isn't working right. It's not always obvious where the problem is.
AGS now has some advanced debugging features that can help you out. If all else fails, you can of course ask for help on the AGS forums.
There are two different types of debugging, that are enabled in different ways. The script debugger is only enabled when you use F5 to run your game; but the Debug() commands are only available when "Enable debug mode" is set in your Game Settings. So, just before you release your game, set that option to False and compile the game again to make sure the player can't cheat using these features.
When you run the game using the Run (F5) option, the game will be started with the debugger. This allows you to pause your game and follow it through one line at a time.
There are two main ways to use this feature:
- Press SCROLL LOCK while playing the game. This will break out when the next line of script is run.
- Place a breakpoint in your script. You do this by clicking on a line of code in the script editor, then pressing F9. Then, when the game arrives at this line of code, it will stop running.
NOTE: The editor will allow you to place a breakpoint on any line of script. However, in order for it to work, it must be placed on a line that has some code on it.
Once the script has stopped, you can use the "Step Into" button (F11) to step through the lines of code, one by one. To allow the game to continue running normally, use the Run (F5) button.
There is a scripting command, Debug
, which you can
use in your script to help you find problems. The default setup enables
some hotkeys for the various features - in particular, Ctrl+X allows you
to teleport to another room, Ctrl+A shows the walkable areas on the
screen and Ctrl+S gives you all the inventory items.
You can also use the Debug command to assign a hotkey to toggle FPS display on and off. (FPS is Frames Per Second, which allows you to see the game speed and spot any slow-running rooms).
This command only works if Debug Mode is enabled in your Game Settings.
The DEBUG
constant is only defined when the game is compiled in Debug Mode, and can
be used to change the behavior of your scripts:
#ifdef DEBUG
// only display this when the game is compiled in debug mode
Display("Debugging information");
#endif
This feature can be used to display extra debugging tools, or also wrap debug-specific code that shouldn't be compiled for production mode.
Pressing Ctrl+D displays some information about the current room. It tells you what room number you are in, followed by the current status of all objects in the room. After that, another messagebox tells you all the characters that are in the current room and various information about them.
This command only works if Debug Mode is enabled in your Game Settings.
Getting Started in AGS
Editor
- New Game templates
- Editor Preferences
- General Settings
- Default Setup
- Colours Editor
- Room Editor
- Character Editor
- Cursor Editor
- Dialog Editor
- Font Preview
- GUI Editor
- Inventory Items Editor
- View Editor
- Sprite Manager
- Music and sound
- Voice speech
- Script Modules
- System limits
- Log Panel
- Plugins
- Other Features
Engine
Scripting
- Scripting Tutorial
- Scripting Language
-
Scripting API
- Script API Overview
- Standard Constants
- Standard Enumerated Types
- Standard Types
- Game variables
- Global arrays
- Global event handlers
- repeatedly_execute / repeatedly_execute_always
- Custom dialog options rendering
- Global functions: general
- Global functions: message display
- Global functions: multimedia actions
- Global functions: palette operations
- Global functions: room actions
- Global functions: screen effects
- Global functions: wait
- AudioChannel functions and properties
- AudioClip functions and properties
- Camera functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- Dictionary functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game functions and properties
- GUI functions and properties
- GUI control functions and properties
- GUI Button functions and properties
- GUI InvWindow functions and properties
- GUI Label functions and properties
- GUI List Box functions and properties
- GUI Slider properties
- GUI Text Box functions and properties
- Hotspot functions and properties
- Inventory item functions and properties
- Maths functions and properties
- Mouse functions and properties
- Object functions and properties
- Overlay functions and properties
- Parser functions
- Region functions and properties
- Room functions and properties
- Screen functions and properties
- Set functions and properties
- Speech functions and properties
- String functions
- System functions and properties
- TextWindowGUI functions and properties
- ViewFrame functions and properties
- Viewport functions and properties
- Obsolete Script API
- Event Types
- Key code table
- Audio in script
Legal Notice
Getting in touch
Misc