Changes between Version 13 and Version 14 of pps/tutorial_basic
- Timestamp:
- Oct 1, 2008, 9:57:08 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pps/tutorial_basic
v13 v14 13 13 svn co https://svn.orxonox.net/data/Media 14 14 }}} 15 3. Now get the latest revision of the t runk:15 3. Now get the latest revision of the tutorial: 16 16 {{{ 17 17 svn co https://svn.orxonox.net/orxonox/branches/orxonox_tutorial … … 19 19 4. Prepare to build: 20 20 {{{ 21 mkdir trunk/build22 cd trunk/build21 mkdir orxonox_tutorial/build 22 cd orxonox_tutorial/build 23 23 cmake .. 24 24 }}} … … 31 31 7. Enter to the appropriate folder and start the game. You will see a menu popping up, just press the ''Standalone'' button. 32 32 {{{ 33 cd ~/orxonox/ trunk33 cd ~/orxonox/orxonox_tutorial 34 34 ./run 35 35 }}} … … 51 51 Next thing will be to change the code accordingly, since the game will probably crash now when started. [[br]] 52 52 We 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.txt53 1. Open orxonox/orxonox_tutorial/src/orxonox/CMakeLists.txt 54 54 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. 55 55 1. Save and close. 56 56 57 57 === 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:58 The 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: 59 59 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. 60 60 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: