This wiki was in read-only mode for many years, but can now be edited again. A lot of information will need to be updated.

Bz eGetWorldEvent: Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
Tulcod (talk | contribs)
No edit summary
No edit summary
Line 3: Line 3:


==Overview==
==Overview==
The '''bz_eGetWorldEvent''' is an API event that is called when the world is defined.
The '''bz_eGetWorldEvent''' is an API event that is called before the [[BZFS]] server defines the world.


==Data==
==Data==
Line 19: Line 19:
   |generated
   |generated
   |bool
   |bool
   |Set to true if the world is generated (ie, not literally loaded from a file)
   |The value representing the state of the world generation. If another plug-in has generated a world, this value will be set to true. If the plug-in processing this event, adds world geometry using the '''bz_addWorld''' methods ([[bz_addWorldBox]], [[bz_addWorldPyramid]] etc. ) then it must set this value to true.
   |-
   |-
   |ctf
   |ctf
   |bool
   |bool
   |Set to true if the game is a [[CTF]]-type game
   |This value represents the game state being a Capture the Flag (CTF) type game. Mutually exclusive with other game type setings.
   |-
   |-
   |rabit
   |rabit
   |bool
   |bool
   |Set to true if the game is a [[Rabbit Hunt]]-type game
   |This value represents the game state being a Rabbit Hunt type game.Mutually exclusive with other game type setings.
   |-
   |-
   |openFFA
   |openFFA
   |bool
   |bool
   |Set to true if the game is a [[Free For All]]-type game
   |This value represents the game state being a [[Free For All]] type game.Mutually exclusive with other game type setings.
   |-
   |-
   |worldFile
   |worldFile
   |[[bz_ApiString]]
   |[[bz_ApiString]]
   |Path to the world file, set to "" (empty string) if not used
   |The path to the map file that will be used when this event is completed. If the string is zero lenght, then ether a plug-in defined map or a random map will be used.
   |-
   |-
   |eventTime
   |eventTime
   |double
   |double
   |Time of the event
   |Local Server time of the event.
   |}
   |}
==Uses==
==Uses==
This event is a notification only event, none of the data returned can be changed.
This event is a modification event. It is the primary hook for plug-ins that wish to modify the world. The available options are;


[[Category:BZFS_API_Docs]]
===Map file overide ===
[[Category:BZFS_API_Events]]
If the plug-in wishes to force the server to use a specific map file, it can set the '''worldFile''' member.
 
===Game Style overide===
The plug-in may change the game style flags to override the initial game mode.
 
===Plug-in defined maps===
If the plug-in sets the '''worldFile''' member to a zero length string, it can then make any number of calls to the world definition functions to define a map file programaticly. These functions include;
 
* [[bz_addWorldBox]]
* [[bz_addWorldPyramid]]
* [[bz_addWorldBase]]
* [[bz_addWorldTeleporter]]
* [[bz_addWorldWaterLevel]]
* [[bz_addWorldWeapon]]
* [[bz_setWorldSize]]

Revision as of 21:27, 30 November 2007

BZFS API Documentation This page contains part of the BZFS API documentation for use by Plug-ins on the BZFS server.

BZFS Event. This page documents a BZFS event that is called by the game server to notify plug-ins of various actions and state changes in the game world.


Overview

The bz_eGetWorldEvent is an API event that is called before the BZFS server defines the world.

Data

bz_eGetWorldEvent returns the bz_GetWorldEventData_V1 data class.

name type value description
eventType bz_eEventType bz_eGetWorldEvent
generated bool The value representing the state of the world generation. If another plug-in has generated a world, this value will be set to true. If the plug-in processing this event, adds world geometry using the bz_addWorld methods (bz_addWorldBox, bz_addWorldPyramid etc. ) then it must set this value to true.
ctf bool This value represents the game state being a Capture the Flag (CTF) type game. Mutually exclusive with other game type setings.
rabit bool This value represents the game state being a Rabbit Hunt type game.Mutually exclusive with other game type setings.
openFFA bool This value represents the game state being a Free For All type game.Mutually exclusive with other game type setings.
worldFile bz_ApiString The path to the map file that will be used when this event is completed. If the string is zero lenght, then ether a plug-in defined map or a random map will be used.
eventTime double Local Server time of the event.

Uses

This event is a modification event. It is the primary hook for plug-ins that wish to modify the world. The available options are;

Map file overide

If the plug-in wishes to force the server to use a specific map file, it can set the worldFile member.

Game Style overide

The plug-in may change the game style flags to override the initial game mode.

Plug-in defined maps

If the plug-in sets the worldFile member to a zero length string, it can then make any number of calls to the world definition functions to define a map file programaticly. These functions include;