Using Eclipse To Debug

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)