Debugger Tutorial
When creating and testing your mission you may find that you want to execute a piece of script, or test the value of something. To do this you can use the remote debugger tool. This allows you to connect to a running MMM mission on your computer or on a remote computer.
The application itself
Here's what a typical session using the remote debugger will look like. Here's a quick run-down of what each part is.
- Sessions - Each session is a tab; the title of the tab shows the connection times and the square indicates connection status, with green being active and red inactive
- Debug Log - Each session has a debug log. This is anything that is sent to the print function, as well as any script errors that happen in the mission. Errors are shown in red.
- Script Box - You can enter commands in the script box and send them to the game by clicking the send button. They will be executed by the game once they are received.
- Save - Hitting the save button will allow you to save the log of the currently selected session.
Code Required
Once you have the debugger application running, the following line needs to be added somewhere in your mission - the setup function would be a good place for this. MMM will then attempt to connect to the application and if successful will reroute all output from print to the debugger application. If you want to connect to a different computer, just use a different IP in the function call.
Debug:connect( "127.0.0.1" )
Sending Commands
As well as receiving output from the mission, you can send Lua script in to the mission that will then be executed. To do this, just enter the comands to be executed and hit the send button. The script entry box is multiline - just hit enter if you need a new line.
Notes
- You will need to forward port 6000 if you are connecting over a network