Changes between Version 2 and Version 3 of code/GametypeCreation
- Timestamp:
- Apr 14, 2010, 10:36:29 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/GametypeCreation
v2 v3 22 22 == Change the AI-behaviour == 23 23 * The concerning file is in __../src/orxonox/controllers__, called "ArtificialController.cc". 24 * You can make the bots stop shooting at certain targets by adding some lines of code in the "bool ArtificialController::sameTeam"-function as displayed above. The function should return true, if a bot shouldn't attack a certain target. (Since the AI-player is in the same "team".)24 * You can make the bots stop shooting at certain targets by adding some lines of code in the __bool ArtificialController::sameTeam__-function as displayed above. The function should return true, if a bot shouldn't attack a certain target. (Since the AI-player is in the same "team".) 25 25 26 26 == Miscellaneous tips - Useful at the beginning == … … 29 29 * Don't forget to backup your code via svn. Open a terminal, go to your orxonox branch-folder and type __ svn ci -m "reason for commitment or summary of latest changes__ . 30 30 * Gamecommands: to add 2 new bots enter __addbots 2__, to remove one of them enter __killbots 1__. To display the scoreboard hit __F2__. 31 * Have a look at [wiki:howto/STL enhanced datatypes provided by the std library] - especially the map. 31 32 32 33 == Important functions inherited from Gametype == … … 37 38 ||playerEntered||what should happen, when a player entered the "battefield"?|| 38 39 ||playerLeft||what should happen, when a player left the "battefield"?|| 39 || setConfigValues||interface for menue - to set the config values; ConfigValues are stored in a log file||40 || tick||this function is called whenever a new frame is rendered; dt is the value how much time has passed since the last frame||40 ||[wiki:howto/ConfigValue setConfigValues]||interface for menue - to set the config values; ConfigValues are stored in a [wiki:howto/ConfigFile config file]|| 41 ||[wiki:howto/Tickable tick]||this function is called whenever a new frame is rendered; dt is the value how much time has passed since the last frame|| 41 42 42 == Timer==43 == [wiki:howto/Timer Timer] == 43 44 * A timer is a object of the Timer class that call a function after a certain time. 44 * You can find a short tutorial in __/src/libraries/tools/Timer.h__ 45 * You can find a short tutorial in __/src/libraries/tools/Timer.h__ or a more detailed one [wiki:howto/Timer in the wiki]. 45 46 * If the second argument is true, you create a timer-loop: The function is called periodically. Else the timer is only called once. 46 47 48