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
(Usage)
Line 43: Line 43:
  
 
These define the volume on the map that will trigger a world weapon whenever players enter it.
 
These define the volume on the map that will trigger a world weapon whenever players enter it.
 
+
{|
 +
|
 
  bbox <Xmin> <Xmax> <Ymin> <Ymax> <Zmin> <Zmax>
 
  bbox <Xmin> <Xmax> <Ymin> <Ymax> <Zmin> <Zmax>
 +
|}
 
or
 
or
 +
{|
 +
|
 
  cylinder <X> <Y> <Zmin> <Zmax> <radius>
 
  cylinder <X> <Y> <Zmin> <Zmax> <radius>
 
+
|}
 
===zoneweapon===  
 
===zoneweapon===  
  
 
This defines the world weapon.<br />
 
This defines the world weapon.<br />
 
+
{|
 +
|
 
  zoneweapon <flagType> <lifetime> <X> <Y> <Z> <tilt> <direction> <shotID> <nowiki><DT></nowiki>
 
  zoneweapon <flagType> <lifetime> <X> <Y> <Z> <tilt> <direction> <shotID> <nowiki><DT></nowiki>
 
+
|}
  {| border="1" cellpadding="5" cellspacing="0"
+
   
  !Parameter
+
<properties>
  !Description
+
flagType=The [[FlagCode]] of the weapon to be used.  This must be a valid weapon.
  !Expected Input/Units
+
lifetime=Defines the lifetime of the weapon's shots in seconds.
  |-
+
X Y Z=The position of the weapon.  The xy-plane is the ground, and z is up.
  | flagType
+
tilt=The tilt of the weapon, measured from the ground.  Units are degrees.
  |The [[FlagCode]] of the weapon to be used.  This must be a valid weapon.
+
direction=Defines the direction of the weapon in the xy-plane (the ground).  Units are degrees.
  |[[FlagCode]]
+
shotID=All shots have an integer ID.  This is the ID to be used for this shot.  If this is 0, a shot ID will be automatically generated.
  |-
+
DT= Defines the initial delay time of the world weapon in seconds.
  | lifetime
+
</properties>
  |Defines the lifetime of the weapon's shots.
+
  |Seconds
+
  |-
+
  |X Y Z
+
  |The position of the weapon.  The xy-plane is the ground, and z is up.
+
  |[[World units]]
+
  |-
+
  |tilt
+
  |The tilt of the weapon, measured from the ground.
+
  |Degrees
+
  |-
+
  |direction
+
  |Defines the direction of the weapon in the xy-plane (the ground).
+
  |Degrees
+
  |-
+
  |shotID
+
  |All shots have an ID.  This is the ID to be used for this shot.  If this is 0, a shot ID will be automatically generated.
+
  |Integer
+
  |-
+
  |DT
+
  |Defines the initial delay time of the world weapon.
+
  |Seconds
+
|}
+
  
 
===playermessage===
 
===playermessage===
  
 
If used (optional), this sends a custom message to a player when he or she triggers the world weapon.
 
If used (optional), this sends a custom message to a player when he or she triggers the world weapon.
playermessage "your message here"
+
{|
 +
|
 +
  playermessage "your message here"
 +
|}
  
 
===servermessage===
 
===servermessage===
  
 
If used (optional), this sends a custom message to all players when a world weapon is triggered.
 
If used (optional), this sends a custom message to all players when a world weapon is triggered.
 +
{|
 +
|
 
  servermessage "your message here"
 
  servermessage "your message here"
 +
|}
  
 
===infomessage===
 
===infomessage===
  
 
If used (optional), this will issue a standard message to all players, stating which type of world weapon was triggered by whom.  This message cannot be customized.
 
If used (optional), this will issue a standard message to all players, stating which type of world weapon was triggered by whom.  This message cannot be customized.
 +
{|
 +
|
 
  infomessage
 
  infomessage
 +
|}
  
 
===repeat===
 
===repeat===
  
 
If used (optional), this will repeat weapon fire while a player is in the defined volume.  The parameter <seconds> defines the repeat time of the weapon (minimum 0.1 seconds).  If <seconds> not specified, the default is 0.5 seconds.  If repeat is not included in definition, the weapon will only fire once when a player enters the zone.
 
If used (optional), this will repeat weapon fire while a player is in the defined volume.  The parameter <seconds> defines the repeat time of the weapon (minimum 0.1 seconds).  If <seconds> not specified, the default is 0.5 seconds.  If repeat is not included in definition, the weapon will only fire once when a player enters the zone.
 +
{|
 +
|
 
  repeat <seconds>
 
  repeat <seconds>
 +
|}
  
 
===timedelay===
 
===timedelay===
 
If used (optional), this will delay the initial fire of the world weapon by the specified number of seconds.
 
If used (optional), this will delay the initial fire of the world weapon by the specified number of seconds.
 +
{|
 +
|
 
  timedelay <seconds>
 
  timedelay <seconds>
 +
|}
  
 
==Examples==
 
==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.
 
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 />
 
  wwzone<br />
 
  bbox -80 -30 -80 -30 0 2<br />
 
  bbox -80 -30 -80 -30 0 2<br />
Line 123: Line 121:
 
  timedelay 2<br />
 
  timedelay 2<br />
 
  end
 
  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.
 
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 />
 
  wwzone<br />
 
  bbox 30 80 30 80 0 2<br />
 
  bbox 30 80 30 80 0 2<br />
Line 133: Line 132:
 
  repeat<br />
 
  repeat<br />
 
  end
 
  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 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.
 
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 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 />
Line 143: Line 143:
 
  timedelay 1<br />
 
  timedelay 1<br />
 
  end
 
  end
 
+
|}
  
 
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Plug-Ins]]
 
[[Category:Plug-Ins]]

Revision as of 17:34, 5 June 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 general form of a wwzone BZW map entry looks like the following:

wwzone
cylinder <X> <Y> <Zmin> <Zmax> <radius>
zoneweapon <flagType> <lifetime> <X> <Y> <Z> <tilt> <direction> <shotID> <DT>
playermessage <message>
servermessage <message>
infomessage
repeat <seconds>
timedelay <seconds>
end

or with a bbox instead of a cylinder

wwzone
bbox <Xmin> <Xmax> <Ymin> <Ymax> <Zmin> <Zmax>
zoneweapon <flagType> <lifetime> <X> <Y> <Z> <tilt> <direction> <shotID> <DT>
playermessage <message>
servermessage <message>
infomessage
repeat <seconds>
timedelay <seconds>
end

Parameters

bbox / cylinder

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

bbox <Xmin> <Xmax> <Ymin> <Ymax> <Zmin> <Zmax>

or

cylinder <X> <Y> <Zmin> <Zmax> <radius>

zoneweapon

This defines the world weapon.

zoneweapon <flagType> <lifetime> <X> <Y> <Z> <tilt> <direction> <shotID> <DT>
flagType The FlagCode of the weapon to be used. This must be a valid weapon.
lifetime Defines the lifetime of the weapon's shots in seconds.
X Y Z The position of the weapon. The xy-plane is the ground, and z is up.
tilt The tilt of the weapon, measured from the ground. Units are degrees.
direction Defines the direction of the weapon in the xy-plane (the ground). Units are degrees.
shotID All shots have an integer ID. This is the ID to be used for this shot. If this is 0, a shot ID will be automatically generated.
DT Defines the initial delay time of the world weapon in seconds.


playermessage

If used (optional), this sends a custom message to a player when he or she triggers the world weapon.

 playermessage "your message here"

servermessage

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

servermessage "your message here"

infomessage

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

infomessage

repeat

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

repeat <seconds>

timedelay

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

timedelay <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 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