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

Difference between revisions of "FlagStay"

From BZFlagWiki
Jump to: navigation, search
Line 1: Line 1:
The FlagStay plugin allows a mapmaker to specify the zone where he/she wants the flag to be. This is similar to a regular zone but with this FlagStayZone the flags that are put in the zone may not leave the zone. This plugin may be useful so a player won't take a Guided Missile flag out of a tower. Or a ShockWave flag can't be taken into a Base and camp there. To define the FlagStayZone use the examples below.
+
The FlagStay plugin allows a mapmaker to specify the zone where they want a flag to remain. This is similar to a regular zone but with a FlagStayZone, the flags that are put in the zone may not leave the zone. This plugin may be useful so a player can't take a Guided Missile flag out of a tower or a ShockWave flag can't be taken into a base and camp there.
 +
 
 +
== Example Usage ==
 +
 
 +
A box positioned at 50 50 0 with a rotation of 45 degrees that keeps GM and SW flags.
 +
 
 
  <nowiki>
 
  <nowiki>
For a box that goes from +- 10 in X, +- 20 in Y, and 0 to 30 in Z that keeps GM and SW  
+
flagstayzone
 +
  position 50 50 0
 +
  size 20 10 1
 +
  rotation 45
 +
  flag GM
 +
  flag SW
 +
  message "You are not allowed to this flag from this area."
 +
end</nowiki>
 
   
 
   
FlagStayZone
+
A cylinder that centered at position -50 50 0 with a radius of 20 and a height of 10 that keeps GM flags.
bbox -10 10 -20 -20 0 30
+
 
Flag GM
+
  <nowiki>
Flag SW
+
flagstayzone
end
+
  position -50 50 0
+
  height 10
For a cylinder that centered at X 10 Y 20 that goes from Z 0 to Z 10 with a radius of 100.  
+
  radius 20
   
+
  flag GM
FlagStayZone
+
  message "You are not allowed to remove the GM flag."
cylinder 10 20 0 10 100
+
Flag GM
+
Flag SW
+
 
end</nowiki>
 
end</nowiki>
  
To load plugin simply put: -loadplugin /path/to/flagStay.so
+
== Loading the plug-in ==
 +
 
 +
To load plugin use: -loadplugin /path/to/flagStay.so
 +
 
 +
== Notes ==
 +
 
 +
* As of BZFlag 2.4.3, the '''bbox''' and '''cylinder''' options have been deprecated in favor of using the '''position''', '''size''', '''height''', and '''radius''' options in order to stay consistent with other map objects.
 +
* For a cylinder FlagStayZone, the '''height''' attribute is the equivalent of the Z coordinate of the '''size''' of a rectangular zone
 +
* The '''message''' attribute will be sent to the player when they leave a zone and their flag is taken; the quotes are required.
 +
* The following abbreviations exist:
 +
** '''position''' can be abbreviated to '''pos'''
 +
** '''rotation''' can be abbreviated to '''rot'''
 +
** '''radius''' can be abbreviated to '''rad'''

Revision as of 07:52, 14 April 2015

The FlagStay plugin allows a mapmaker to specify the zone where they want a flag to remain. This is similar to a regular zone but with a FlagStayZone, the flags that are put in the zone may not leave the zone. This plugin may be useful so a player can't take a Guided Missile flag out of a tower or a ShockWave flag can't be taken into a base and camp there.

Example Usage

A box positioned at 50 50 0 with a rotation of 45 degrees that keeps GM and SW flags.

flagstayzone
  position 50 50 0
  size 20 10 1
  rotation 45
  flag GM
  flag SW
  message "You are not allowed to this flag from this area."
end

A cylinder that centered at position -50 50 0 with a radius of 20 and a height of 10 that keeps GM flags.

flagstayzone
  position -50 50 0
  height 10
  radius 20
  flag GM
  message "You are not allowed to remove the GM flag."
end

Loading the plug-in

To load plugin use: -loadplugin /path/to/flagStay.so

Notes

  • As of BZFlag 2.4.3, the bbox and cylinder options have been deprecated in favor of using the position, size, height, and radius options in order to stay consistent with other map objects.
  • For a cylinder FlagStayZone, the height attribute is the equivalent of the Z coordinate of the size of a rectangular zone
  • The message attribute will be sent to the player when they leave a zone and their flag is taken; the quotes are required.
  • The following abbreviations exist:
    • position can be abbreviated to pos
    • rotation can be abbreviated to rot
    • radius can be abbreviated to rad