Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739
Crazy Tronners Wiki - Trunk Scripting

Trunk Scripting

From Tronwiki
Jump to: navigation, search
(Classes)
(Classes)
 
Line 8: Line 8:
 
   
 
   
 
Armagetronad-ct is nothing but an experimental branch, as were armahacktron and sty+ct, based on armagetron trunk, currently being 0.3.x serie. Therefore, there are two major differences with sty+ct:
 
Armagetronad-ct is nothing but an experimental branch, as were armahacktron and sty+ct, based on armagetron trunk, currently being 0.3.x serie. Therefore, there are two major differences with sty+ct:
- sty is not (yet) fully ported to 0.3.x serie and has not been included to this branch. So no flags, no balls, no zombies, no shooting...
+
* sty is not (yet) fully ported to 0.3.x serie and has not been included to this branch. So no flags, no balls, no zombies, no shooting...
- although you can compile (still true?) trunk with zones v1 or v2, this branch has scripting support for zones v2 only...
+
* although you can compile (still true?) trunk with zones v1 or v2, this branch has scripting support for zones v2 only...
  
 +
There's also a few extra features that comes from sty+ct or has been added to provide scripting support:
 +
* DELAY_COMMAND comes from sty+ct.
 +
* INGAME_PARSING, INGAME_PARSING_DTD_VALIDATION and INGAME_PARSING_DTD allow to parse additional data during a round. It's meant to be use for zones. Any other parsing might be confusing and might lead to undefine behavior.
 +
 
Although this branch main target is dedicated server, it might be extended to some client side features. For example, you can define new chat command from scripting on server side. This might be extended to client side soon as it allows to build dynamic instant messages (ex: /hi [<playername>] to salute last entered or specified player(s).
 
Although this branch main target is dedicated server, it might be extended to some client side features. For example, you can define new chat command from scripting on server side. This might be extended to client side soon as it allows to build dynamic instant messages (ex: /hi [<playername>] to salute last entered or specified player(s).
  
Line 141: Line 145:
 
   eLadderLogWriter(string ID, bool enabledByDefault)
 
   eLadderLogWriter(string ID, bool enabledByDefault)
 
   static LadderLogWriter find(string ID)
 
   static LadderLogWriter find(string ID)
   bool is_enabled()         //!< check this if you're going to make expensive calculations for ladderlog output
+
   bool is_enabled()           //!< check this if you're going to make expensive calculations for ladderlog output
   enabled(bool b)           //!< set or unset enabled flag
+
   enabled(bool b)             //!< set or unset enabled flag
   static set_all(bool enabled)     //!< enable or disable all writers
+
   static set_all(bool enabled) //!< enable or disable all writers
   set_callback(proc)         //!< bind a procedure from scripting language to this ladder log writer.
+
   set_callback(proc)           //!< bind a procedure from scripting language to this ladder log writer.
 +
  unset_callback(proc)        //!< unbind a procedure from scripting language to this ladder log writer.
  
  
Line 221: Line 226:
 
   Player set_name(string name)            //!< Sets this player's name. Sets processed names (colored, username, nameFromCLient) as well.
 
   Player set_name(string name)            //!< Sets this player's name. Sets processed names (colored, username, nameFromCLient) as well.
 
   Player set_user_name(string userName)        //!< Sets this player's name, cleared for system logs. Use for writing to files or comparing with admin input. The other names stay unaffected.
 
   Player set_user_name(string userName)        //!< Sets this player's name, cleared for system logs. Use for writing to files or comparing with admin input. The other names stay unaffected.
 +
  center_message(string)
  
  
Line 275: Line 281:
 
   unsigned short blue()
 
   unsigned short blue()
 
   string name()
 
   string name()
 
 
{{ClassSetting|SpawnPoint|}}
 
  SpawnPoint(Coord loc, Coord dir)
 
  Coord position()
 
  Coord direction()
 
  spawn(Coord loc, Coord dir)
 
  real danger()
 
  clear()
 
 
 
{{ClassSetting|Arena|}}
 
  static Arena get_arena()
 
  int winding_number()
 
  int direction_winding(const eCoord& dir)
 
  Coord get_direction(int winding)
 
  new_spawn_point(Coord loc, Coord dir)
 
  Coord get_random_pos( REAL factor )
 
  SpawnPoint closest_spawn_point(Coord loc)
 
  SpawnPoint least_dangerous_spawn_point()
 
  static real size_multiplier()
 
  remove_all_spawn()
 
  
  
Line 334: Line 318:
 
   real lag()        //!< expected average network latency
 
   real lag()        //!< expected average network latency
 
   real lag_threshold()      //!< tolerated network latency variation
 
   real lag_threshold()      //!< tolerated network latency variation
 +
 +
 +
{{ClassSetting|SpawnPoint|}}
 +
  SpawnPoint(Coord loc, Coord dir)
 +
  Coord position()
 +
  Coord direction()
 +
  spawn(Coord loc, Coord dir)
 +
  real danger()
 +
  clear()
 +
 +
 +
{{ClassSetting|Arena|}}
 +
  static Arena get_arena()
 +
  int winding_number()
 +
  int direction_winding(const eCoord& dir)
 +
  Coord get_direction(int winding)
 +
  new_spawn_point(Coord loc, Coord dir)
 +
  Coord get_random_pos( REAL factor )
 +
  SpawnPoint closest_spawn_point(Coord loc)
 +
  SpawnPoint least_dangerous_spawn_point()
 +
  static real size_multiplier()
 +
  remove_all_spawn()
  
 
==Sample Scripts==
 
==Sample Scripts==
Line 391: Line 397:
 
</pre>
 
</pre>
 
Any script procedure binded to a ladder log message must take a single argument (here named args). This argument is a list of 0 to n value of any type, depending on the value returned by corresponding ladder log message.
 
Any script procedure binded to a ladder log message must take a single argument (here named args). This argument is a list of 0 to n value of any type, depending on the value returned by corresponding ladder log message.
 +
 +
Change:
 +
LadderLogWriter now allows multiple bindings, and unbinding too. This is particulary convinient to organize you script code and also to change bindings according to maps. There's no change in the binding logic. Unbinding is straighforward, too.
 +
Please note that bindings are managed as a queue: they are run in the very same order they are bound to an event. There's no way to reorganize bindings other then remove and requeue them.
  
 
===Create new Commands\Settings===
 
===Create new Commands\Settings===

Latest revision as of 17:19, 26 August 2010

Personal tools