Using Eclipse To Debug: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
* Select the added Update Site and install Clonk Development Tools | * Select the added Update Site and install Clonk Development Tools | ||
* After restarting Eclipse as recommended you can open the Clonk perspective by adding the Add Perspective Button at the top-right of the window | * After restarting Eclipse as recommended you can open the Clonk perspective by adding the Add Perspective Button at the top-right of the window | ||
[[File:Eclipse_Debug_Other_Persp.png]] | |||
[[File:Eclipse_Debug_Open_persp.png]] | |||
* Right-click into the Project Explorer and open the New Clonk Project wizard | * Right-click into the Project Explorer and open the New Clonk Project wizard | ||
[[File:New_clonk_proj.png]] | |||
* In the wizard, uncheck Use default location and supply the path of the planet folder in the OC repository. Set the project name to OpenClonk (name doesn't really matter) | * In the wizard, uncheck Use default location and supply the path of the planet folder in the OC repository. Set the project name to OpenClonk (name doesn't really matter) | ||
* Set Open Clonk as engine | * Set Open Clonk as engine | ||
[[File:New_clonk_proj_wizard.png]] | |||
* After finishing the wizard you should see the contents of the planet folder | * After finishing the wizard you should see the contents of the planet folder | ||
[[File:Select_scen.png]] | |||
* In Window->Preferences->Clonk some files need to be supplied for scenario launching to work properly. Set the game path to the path of the planet folder. C4group and engine paths should then be filled out automatically | * In Window->Preferences->Clonk some files need to be supplied for scenario launching to work properly. Set the game path to the path of the planet folder. C4group and engine paths should then be filled out automatically | ||
[[File:Eclipse_Debug_Prefsmenu.png]] | |||
[[File:Eclipse_Debug_Prefs.png]] | |||
* Now select any scenario and press the small black arrow next to the Debug button. Debug As -> Clonk scenario | * Now select any scenario and press the small black arrow next to the Debug button. Debug As -> Clonk scenario | ||
[[File:Eclipse_Debug_Debug_as_menu.png]] | |||
* Open the Debug perspective | * Open the Debug perspective | ||
* Open some script file and set a breakpoint inside a function (e.g. StartJump in the Clonk script) | * Open some script file and set a breakpoint inside a function (e.g. StartJump in the Clonk script. Right now, only the shortcut for breakpoints is supported (Strg+Shift+B) | ||
[[File:Eclipse_Debug_Open_script.png]] | |||
[[File:Eclipse_Debug_Set_breakpoint.png]] | |||
* Trigger that function in the game | * Trigger that function in the game | ||
* Engine should pause and allow you to single-step the script inside Eclipse (shortcuts for single step/step over can be found in the Run menu and changed in the preferences) | * Engine should pause and allow you to single-step the script inside Eclipse (shortcuts for single step/step over can be found in the Run menu and changed in the preferences) | ||
[[File:Eclipse_Debug_Stopped.png]] |
Latest revision as of 22:17, 24 February 2010
Setup Steps
- Download Eclipse (Classic or for Java Developers)
- Add http://www.maltworld.de/clonk/c4dt/update to the Update Sites list (Help -> Install New Software)
- Select the added Update Site and install Clonk Development Tools
- After restarting Eclipse as recommended you can open the Clonk perspective by adding the Add Perspective Button at the top-right of the window
- Right-click into the Project Explorer and open the New Clonk Project wizard
- In the wizard, uncheck Use default location and supply the path of the planet folder in the OC repository. Set the project name to OpenClonk (name doesn't really matter)
- Set Open Clonk as engine
- After finishing the wizard you should see the contents of the planet folder
- In Window->Preferences->Clonk some files need to be supplied for scenario launching to work properly. Set the game path to the path of the planet folder. C4group and engine paths should then be filled out automatically
- Now select any scenario and press the small black arrow next to the Debug button. Debug As -> Clonk scenario
- Open the Debug perspective
- Open some script file and set a breakpoint inside a function (e.g. StartJump in the Clonk script. Right now, only the shortcut for breakpoints is supported (Strg+Shift+B)
- Trigger that function in the game
- Engine should pause and allow you to single-step the script inside Eclipse (shortcuts for single step/step over can be found in the Run menu and changed in the preferences)