Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 13 and Version 14 of pps/tutorial_basic


Ignore:
Timestamp:
Oct 1, 2008, 9:57:08 AM (16 years ago)
Author:
rgrieder
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • pps/tutorial_basic

    v13 v14  
    1313svn co https://svn.orxonox.net/data/Media
    1414}}}
    15  3. Now get the latest revision of the trunk:
     15 3. Now get the latest revision of the tutorial:
    1616{{{
    1717svn co https://svn.orxonox.net/orxonox/branches/orxonox_tutorial
     
    1919 4. Prepare to build:
    2020{{{
    21 mkdir trunk/build
    22 cd trunk/build
     21mkdir orxonox_tutorial/build
     22cd orxonox_tutorial/build
    2323cmake ..
    2424}}}
     
    3131 7. Enter to the appropriate folder and start the game. You will see a menu popping up, just press the ''Standalone'' button.
    3232{{{
    33 cd ~/orxonox/trunk
     33cd ~/orxonox/orxonox_tutorial
    3434./run
    3535}}}
     
    5151Next thing will be to change the code accordingly, since the game will probably crash now when started. [[br]]
    5252We organise our source files via CMake as you have already found out. You now have to tell CMake to also compile the ''TutorialShip'':
    53  1. Open orxonox/trunk/src/orxonox/CMakeLists.txt
     53 1. Open orxonox/orxonox_tutorial/src/orxonox/CMakeLists.txt
    5454 1. You will see a large list of source files (*.cc). You can add "oxonox/TutorialShip.cc" anywhere you like, but it is preferred to organise the file a little bit. So look for !SpaceShip.cc and add things there.
    5555 1. Save and close.
    5656
    5757=== Coding: RegisterObject() and SetConfigValue() ===
    58 The interesting part: Modifying the C++ code. '''Open orxonox/trunk/src/orxonox/objects/TutorialShip.cc'''. As you have already heard from Fabian, the Core Framework is like a language extension to C++. But it cannot be fully automatic. That means you have to add a few lines accordingly:
     58The interesting part: Modifying the C++ code. '''Open orxonox/orxonox_tutorial/src/orxonox/objects/TutorialShip.cc'''. As you have already heard from Fabian, the Core Framework is like a language extension to C++. But it cannot be fully automatic. That means you have to add a few lines accordingly:
    5959 1. Find the constructor (TutorialShip::TutorialShip()) and add '''RegisterObject(TutorialShip);''' as the first statement. This is used for the class hierarchy and for the ObjectLists. Whenever you derive from OrxonoxClass or any derivative, this call is necessary.
    6060 2. Next will be creating a configurable value in our class. This enables us to configure the TutorialShip from outside (Shell or orxonox.ini). Go to the ''setConfigValues()'' and configure the member variable ''reloadTime_'' with a default value of 0.125. Remember the syntax: