C4DT Running Scenarios

Revision as of 13:11, 29 April 2010 by Mortimer (talk | contribs)

Introduction

Before continuing you should make sure that you have completed the steps described in C4DT_Installation_Guide.

Running Scenarios

You can run scenarios by selecting it in the Project Explorer and then selecting the option Run Scenario found in the popup menu of the Run button (the green one with the white play symbol).

Debugging

To execute scripts one-instruction-at-a-time and inspect values while the script is halted, you have to switch to the debug perspective first. The layout of the main window changes to acommodate debugging. You can still arrange the views as you want but changes to the layout done while in the debug perspective will stay in the debug perspective, so as soon as you switch back to the Clonk perspective your old layout will be restored.

Apart from window layout there are also some keyboard shortcuts that become available. Among those is the shortcut to create a breakpoint. By default, it's Ctrl+Shift+B. You can open any c4script and place a breakpoint in a line that contains function code by using that shortcut (or alternatively right-clicking the ledge on the left and clicking "Toggle Breakpoint").


To run a scenario in debug mode all you have to do is pressing the Debug button instead of the Run one. The engine will now be halting script execution as soon as it encounters an instruction marked by a breakpoint. Eclipse will highlight the location where script execution halted. Now various views can be utilised to gain information about the current state of variables and objects.

Variables

Expressions