Turret Plugin Release
Posted: Mon May 18, 2009 5:44 am
This plugin adds the ability for map makers to include turrets in their map like the one on flying_popcorn's "Shooting Gallery" map.
Current version: v2.2
From the README:
Here is an example of how the turret is added to the shooting gallery map:
Please report any bugs or comments to this thread. Thanks!
Source, windows binary, and linux binary is attached.
Licence
Current version: v2.2
From the README:
Code: Select all
Turret Plug-in README
== Table of Contents ==
- Summary
- TurretWeapon
- TurretZone
- TurretEjector
- Notes
- Loading the plug-in
- Loading Examples
- Example Map File
- flying_popcorn's turret
- Technical Notes
- Changelog
- Credits
- License
== Summary ==
The Turret plug-in is a plug-in that allows map makers to specify turrets like the one in flying_popcorn's
"Shooting Gallery". The tilt is based off the position of the tank in the turret zone in proportion
to the tilt extents. The new bzw objects are: turretWeapon, turretZone, and turretEjector.
== TurretWeapon ==
turretWeapon
name <text> # Required. Name of weapon.
position <number> <number> <number> # Required. Position of weapon.
type <flag type> # Optional. Type of shot the weapon fires (eg. L, SW, SB). Defaults to US.
lifetime <number> # Optional. Defines how long the shot "lives" for. Defaults to BZDB value.
frequency <number> # Optional. Defines how many times a second the weapon fires. Defaults to 5.
tiltExtent <number> <number> # Optional. Defines the minimum and maximum tilt. Defaults to 0 and 360.
angleExtent <number> <number> # Optional. Defines the minimum and maximum angle. Any shot with an angle
# outside this range is not fired. Defaults to 0 and 360.
end
== TurretZone ==
turretZone
name <text> # Required. Name of zone.
position <number> <number> <number> # Required. Position of zone.
size <number> <number> <number> # Required for box zone. Size of zone.
radius <number> # Required for cylinder zone. Radius of zone.
height <number> # Required for cylinder zone. Height of zone.
addWeapon <text> # Repeatable. Adds a weapon which will be fired when a player enters this zone.
end
== TurretEjector ==
turretEjector
position <number> <number> <number> # Required. Position of ejector.
size <number> <number> <number> # Required for box ejectors. Size of ejector.
radius <number> # Required for cylinder ejectors. Radius of ejector.
height <number> # Required for cylinder ejectors. Height of ejector.
addZone <text> # Repeatable. When a player enters the ejector, any player(s) in these zone(s) will be killed.
ejectTeammates # Optional. When specified if the zone is occupied by a player of the same team
# they will be killed. Defaults to no.
end
== Notes ==
- Do NOT specify radius or height with size. The plug-in is unable to determine whether the zone is a box or a cylinder and will
return an error.
- Names are CaSe SeNsItIvE. MyTurret is not the same as myturret.
- If you want a name with a space, you must put quotation ("") marks around it. For example, "name "My Turret"" (without the first
set of quotes).
- Rotation is COUNTER-clockwise.
- You cannot have world weapons on a map with a turret.
== Loading the plug-in ==
To load the plug-in, simply add this to your BZFS command list when you start the server:
-loadplug-in /path/to/plug-in/Turret,<debug level>
The debug level defines how much debugging information to report.
Debug Level 0 - No debugging. (Default)
Debug Level 1 - Reports ERRORS that happen. These are things that will probably give undesired effects and should be fixed.
Debug Level 2 - Reports WARNING messages also. These are things that may or may not give undesired effects, but should be fixed. (Recommended Level)
Debug Level 3 - Reports NOTICE messages also. These are things that will most likely not give undesired effects.
Debug Level 4 - Reports DEBUG messages also. These are messages that describe what is going on "behind the scenes".
== Loading Examples ==
-loadplugin path/to/plugin/Turret,2
Loads the Turret plug-in and specifies to include ERROR and WARNING messages.
-loadplugin path/to/plugin/Turret,0
Loads the Turret plug-in and specifies to ignore all messages.
Note: For testing/developing a map with turrets, it is recommended to start Turret with the highest debug level.
== Turret Example File ==
# This can also be found in turret.bzw.
world
size 200 # Slightly smaller world (normal is 400)
end
options
-loadplugin Turret,4 # Show all messages
-j # Enable jumping
+r # Enable rico
end
material # Define a material for the ejector
name red
diffuse 1 0 0 1 # Red
end
box # Turret zone box
position 0 0 0
size 5 20 1
end
box # Turret ejector box
position 0 -50 0
size 5 5 1
matref red
end
turretWeapon
name front
position 0 21 2
type L
tiltExtent 0 90
angleExtent 0 180
end
turretZone
name zone
position 0 0 1
size 5 20 1
addWeapon front
end
turretEjector
position 0 -50 1
size 5 5 1
addZone zone
end
== Replica of flying_popcorn's turret ==
turretWeapon
name wep
position -335 0 46.57
type L
lifetime 0.7
tiltExtent -90 90
angleExtent 0 180
end
turretZone
name turret
position -350 0 44
size 15 7 6
addWeapon wep
rotation 270
end
turretEjector
position -392.5 0 25
size 7.5 7 10
addZone turret
end
== Technical Notes ==
- For a box zone, the tilt is calculated based on how close the tank is to the front (x+) side of the box. The closer it is, the lower
the tilt is.
- For a cylinder zone, the tilt is calculated based on how close the tank is to the edge. The closer it is, the lower the tilt is.
- The zone is considered box when size is provided.
- The zone is considered cylinder when radius and height are provided.
- Angle Extents are automatically adjusted so that x+ is 0, x- is 180.
== Changelog ==
= v2.2 =
- Fixed a few bugs.
- Removed a few warnings.
= v2.1 =
- Fixed compile errors on linux.
= v2.0 =
- Added support for rotation.
- Added support for cylinder zones (through radius and height).
- Removed front property for turretZone and turretEjector. The x+ side is used for this now; you can rotate the box to achieve
the same effects of settings a different front (x- = 180, y+ = 270, y- = 90).
- Modulized the collision detection code.
- General code cleanup.
= v1.0 =
- Added the initial turretWeapon, turretZone, and turretEjector code.
== Credits ==
- flying_popcorn for initial inspiration by making the Shooting Gallery map. Also for making the plug-in tutorial which I used for
the custom map object code.
== License ==
The Turret plug-in is distributed under the Creative Commons license as descibed on this page:
http://creativecommons.org/licenses/by-sa/3.0/
== Replica of flying_popcorn's turret ==
turretWeapon
name wep
position -335 0 46.57
type L
lifetime 0.7
tiltExtent -90 90
angleExtent -90 90
end
turretZone
name turret
position -350 0 44
size 15 7 6
addWeapon wep
rotation 270
end
turretEjector
position -392.5 0 25
size 7.5 7 10
addZone turret
end
== Technical Notes ==
- For a box zone, the tilt is calculated based on how close the tank is to the front (x+) side of the box. The closer it is, the lower
the tilt is.
- For a cylinder zone, the tilt is calculated based on how close the tank is to the edge. The closer it is, the lower the tilt is.
- The zone is considered box when size is provided.
- The zone is considered cylinder when radius and height are provided.
== Changelog ==
= v2.1 =
- Fixed compile errors on linux.
= v2.0 =
- Added support for rotation.
- Added support for cylinder zones (through radius and height).
- Removed front property for turretZone and turretEjector. The x+ side is used for this now; you can rotate the box to achieve
the same effects of settings a different front (x- = 180, y+ = 270, y- = 90).
- Modulized the collision detection code.
- General code cleanup.
= v1.0 =
- Added the initial turretWeapon, turretZone, and turretEjector code.
== Credits ==
- flying_popcorn for initial inspiration by making the Shooting Gallery map. Also for making the plug-in tutorial which I used for
the custom map object code. And finally for building the linux plug-in.
== License ==
The Turret plug-in is distributed under the Creative Commons license as descibed on this page:
http://creativecommons.org/licenses/by-sa/3.0/
Code: Select all
turretWeapon
name wep
position -335 0 46.57
type L
lifetime 0.7
tiltExtent -90 90
angleExtent 0 180
end
turretZone
name turret
position -350 0 44
size 15 7 6
addWeapon wep
rotation 270
end
turretEjector
position -392.5 0 25
size 7.5 7 10
addZone turret
end
Source, windows binary, and linux binary is attached.
Licence