This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Wwzones"

From BZFlagWiki
Jump to: navigation, search
(Examples: Formatting and Grammar)
Line 58: Line 58:
 
==Examples==
 
==Examples==
  
Examples of map (.bzw) entries:
+
In the following example, a cuboid-shaped wwzone with the dimensions 50 x 50 x 1 and centered at (-50, 50, 1) is created. If a player remains in the defined zone for at least two seconds, a [[ShockWave]] weapon will fire in (approximately) 0.25 second intervals thereafter.  The [[ShockWave]] world weapon is positioned at the coordinates (0, 0, 1), and the message, "You triggered Shockwave!" will be sent to the player who triggers it.
  
 +
wwzone<br />
 +
bbox -80 -30 -80 -30 0 2<br />
 +
zoneweapon SW 1 0 0 1 0 0 0 0<br />
 +
playermessage "You triggered Shockwave!<br />
 +
repeat .25<br />
 +
timedelay 2<br />
 +
end
  
'''wwzone'''<br />
 
'''bbox -80 -30 -80 -30 0 2'''<br />
 
'''zoneweapon SW 1 0 0 1 0 0 0 0'''<br />
 
'''playermessage "You triggered Shockwave!"'''<br />
 
'''repeat .25'''<br />
 
'''timedelay 2'''<br />
 
'''end'''
 
  
This will fire a shockwave every 0.25 seconds (approximately) after a player is in the volume defined by the bbox for more than 2 seconds.  In this case, a square volume 50 x 50 x 1 centered at coordinates -50 50 1.  The shockwaves will occur at coordinates 0 0 1 and will send message "You triggered Shockwave!" to player that triggered it, when initially fired.
+
This will fire a laser in 0.5 second intervals while a player is in the volume defined by the bbox.  In this example, the volume is a rectangular box with the dimensions 50 x 50 x 1 centered at the coordinates (50, 50, 1).  The laser is positioned at the coordinates (5, 5, 1) and is tilted up 45 degrees from the xy-plane (the ground) with a heading of 25 degrees.  When initially triggered, the message, "Laserz rule!" is sent to all players.
  
 +
wwzone<br />
 +
bbox 30 80 30 80 0 2<br />
 +
zoneweapon L 1 5 5 1 45 25 0 0<br />
 +
servermessage "Laserz rule!"<br />
 +
repeat<br />
 +
end
  
'''wwzone'''<br />
 
'''bbox 30 80 30 80 0 2'''<br />
 
'''zoneweapon L 1 5 5 1 45 25 0 0'''<br />
 
'''servermessage "Laserz rule!"'''<br />
 
'''repeat'''<br />
 
'''end'''
 
  
This will fire a laser, every 0.5 seconds (approximately) while a player is in the volume defined by the bboxIn this case, a square volume 50 x 50 x 1 centered at coordinates 50 50 1.  The laser will occur at coordinates 5 5 1 and be tilted at 45 degrees with a heading of 25 degrees.  When initially fired, there is a message sent to all players "Laserz rule!"
+
In this example, a cylindrical wwzone that fires a Guided Missile is defined.  The defined volume has a radius of 20 [[World units]], a height of six, and is centered at the coordinates (50, -50, 3).  The weapon is centered at (0, 0, 1) with a both the tilt and heading set to 0 degrees.  If a player remains in this volume for one second, the weapon will fire only once, and when it is triggered, the message, "GM triggered by <callsign>" is sent to all players.
  
 
+
wwzone<br />
'''wwzone'''<br />
+
cylinder 50 -50 0 6 20<br />
'''cylinder 50 -50 0 6 20'''<br />
+
zoneweapon GM 1 0 0 1 0 0 0 0<br />
'''zoneweapon GM 1 0 0 1 0 0 0 0'''<br />
+
infomessage<br />
'''infomessage'''<br />
+
timedelay 1<br />
'''timedelay 1'''<br />
+
end
'''end'''
+
 
+
This will fire a GM one time after a player has been in the volume defined by the cylinder for more than 1 second.  In this case, a cylindrical volume with a radius of 20, centered at coordinates 50 -50 3.  The GM will shoot from coordinates 0 0 1 with 0 tilt and a heading of 0 degrees.  When initially fired, there is a message sent to all players "GM triggered by <callsign>."
+
  
  
 
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Plug-Ins]]
 
[[Category:Plug-Ins]]

Revision as of 07:23, 14 May 2008

Plywood hammer100x101.gif There is still documentation to be done here!! If you feel up to the task, please have a go at it. Specifically what needs to be added is:
Format the article to match the standard plug-in articles


Description

The plugin will fire a map defined world weapon whenever a player is in a map defined volume. It could be used for landmines, booby traps, clearing campers in difficult locations, general amusement, etc. Multiple zones with different weapons, etc. may be used in same map file.


Usage

The parameters of the wwzone map definition are follows:


bbox <Xmin> <Xmax> <Ymin> <Ymax> <Zmin> <Zmax>
or
cylinder <X> <Y> <Zmin> <Zmax> <radius>

These define the volume on the map that will trigger a world weapon whenever players enter it.


zoneweapon <flagType> <lifetime> <X> <Y> <Z> <tilt> <direction> <shotID> <DT>

This defines the world weapon.
<flagType> is a valid type of flag to use for the world weapon (e.g. SW, GM, L, etc.)
<lifetime> defines the life of the weapon's shots.
<X> <Y> <Z> defines the location of the world weapon.
<tilt> defined the tilt of the world weapon.
<direction> defines the direction of the world weapon.
<shotID> ...not sure what this does ;) but it is an input to the API world weapon function.
<DT> defines the delay time of the world weapon.


playermessage "your message here"

If used (optional), sends custom message to player when he/she triggers world weapon.


servermessage "your message here"

If used (optional), sends custom message to all players when a world weapon is triggered.


infomessage

If used (optional), this will issue standard message to all players stating which type of world weapon was triggered by whom. This message cannot be customized.


repeat <seconds>

If used (optional), will repeat weapon fire while player is in defined volume. <seconds> defines the repeat time of the weapon (minimum 0.1 seconds). If <seconds> not specified, default is 0.5 seconds. If repeat is not included in definition, weapon will only fire once when player enters zone.


timedelay <seconds>

If used (optional), will delay initial fire of world weapon by specified number of seconds.


Examples

In the following example, a cuboid-shaped wwzone with the dimensions 50 x 50 x 1 and centered at (-50, 50, 1) is created. If a player remains in the defined zone for at least two seconds, a ShockWave weapon will fire in (approximately) 0.25 second intervals thereafter. The ShockWave world weapon is positioned at the coordinates (0, 0, 1), and the message, "You triggered Shockwave!" will be sent to the player who triggers it.

wwzone
bbox -80 -30 -80 -30 0 2
zoneweapon SW 1 0 0 1 0 0 0 0
playermessage "You triggered Shockwave!
repeat .25
timedelay 2
end


This will fire a laser in 0.5 second intervals while a player is in the volume defined by the bbox. In this example, the volume is a rectangular box with the dimensions 50 x 50 x 1 centered at the coordinates (50, 50, 1). The laser is positioned at the coordinates (5, 5, 1) and is tilted up 45 degrees from the xy-plane (the ground) with a heading of 25 degrees. When initially triggered, the message, "Laserz rule!" is sent to all players.

wwzone
bbox 30 80 30 80 0 2
zoneweapon L 1 5 5 1 45 25 0 0
servermessage "Laserz rule!"
repeat
end


In this example, a cylindrical wwzone that fires a Guided Missile is defined. The defined volume has a radius of 20 World units, a height of six, and is centered at the coordinates (50, -50, 3). The weapon is centered at (0, 0, 1) with a both the tilt and heading set to 0 degrees. If a player remains in this volume for one second, the weapon will fire only once, and when it is triggered, the message, "GM triggered by <callsign>" is sent to all players.

wwzone
cylinder 50 -50 0 6 20
zoneweapon GM 1 0 0 1 0 0 0 0
infomessage
timedelay 1
end