wwzones

Expand and mod your server.
Post Reply
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

wwzones

Post by LouMan »

wwzones plugin version 2.0

Author: LouMan (modified from 'flagStay' code written by JeffM2501)
Description: See below.
Min Version: Latest CVS 2.0 branch code (to compile), bzfs 2.0.8

** NOTE: the plugin is committed to CVS; can be obtained there.

Credit to JeffM2501 for base zone and custom map object code (from flagStay plugin), which I have modified to fit this application.


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.

-------------------------------------------------------------------------------------

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 of map (.bzw) entries:


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


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

This will fire a laser, every 0.5 seconds (approximately) while a player is in the volume defined by the bbox. In 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!"


wwzone
cylinder 50 -50 0 6 20
zoneweapon GM 1 0 0 1 0 0 0 0
infomessage
timedelay 1
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>."

-------------------------------------------------------------------------------------

Please report any bugs or issues with this plugin to LouMan, and good luck.
Last edited by LouMan on Sat Feb 03, 2007 3:25 pm, edited 3 times in total.
User avatar
Tanner
Private First Class
Private First Class
Posts: 575
Joined: Sat Sep 17, 2005 3:46 am
Location: Atl, GA
Contact:

Post by Tanner »

Cool!

Sounds very useful and would be neat on someone maps....

-Tanner
Tanner - Segway HT i180 Red Owner - Random Map Creator - BZStocks - TS Software

Image
User avatar
Waistless
Private First Class
Private First Class
Posts: 51
Joined: Sat Mar 19, 2005 10:09 am
Location: Australia

Post by Waistless »

I've been waiting for this, excellent! This could be used in all sorts of situations, C4 trigger detonations, mines, cannons, turrets..... you rock!!!!
Could this tank perhaps go a little bit faster, so it's not being overtaken by stationary objects.
"Words in parentheses can (not) be ignored." -Unknown
User avatar
Davy Jones
Private First Class
Private First Class
Posts: 297
Joined: Thu Jan 04, 2007 4:39 am
Location: Davy Jone's Locker

Post by Davy Jones »

Amazing, Simply amazing...not to mention auto firing turrets and land mines when someone is near *lost in thought*
Owner @ The Twin Towers
Admin @ The Two Boxes
Cop @ Army Of One
Image
Image
User avatar
Zelgadis
Private First Class
Private First Class
Posts: 638
Joined: Sat Jul 02, 2005 2:31 pm
Location: European Union

Post by Zelgadis »

yeah, nice :)
Want to improve your skill? Join the http://guleague.org!
User avatar
Waistless
Private First Class
Private First Class
Posts: 51
Joined: Sat Mar 19, 2005 10:09 am
Location: Australia

Post by Waistless »

I found a glitch in your plugin, but I'll post here as well in case you don't read your inbox :P

The tilt doesn't work properly, here's a sample for you to try on

Code: Select all

wwzone
cylinder 0 0 0 20 100
zoneweapon L 1000 0 0 40 20 0 0 2
servermessage "Laser Fired"
end

weapon
	position 0 0 40
	tilt 20
	rotation 0
	delay 2
	type GM
end
Just go to towards the centre where the flare is firing, the laser should fire in the same direction, but as you can see it doesn't quite tilt the right way.
Could this tank perhaps go a little bit faster, so it's not being overtaken by stationary objects.
"Words in parentheses can (not) be ignored." -Unknown
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan »

I found that the tilt and direction in the API world weapon function is specified in radians, not degrees. I updated the plugin (see above) to version 1.1 and it will automatically convert to degrees to radians.

Your map code (below) should work ok with version 1.1 of the plugin.

Code: Select all

wwzone 
cylinder 0 0 0 20 100 
zoneweapon L 1000 0 0 40 20 0 0 2 
servermessage "Laser Fired" 
end 

weapon 
   position 0 0 40 
   tilt 20 
   rotation 0 
   delay 2 
   type GM 
end 
Thanks for the report :)
User avatar
Waistless
Private First Class
Private First Class
Posts: 51
Joined: Sat Mar 19, 2005 10:09 am
Location: Australia

Post by Waistless »

thanks louman, my weapon works now ;)

I've done some experimenting with this plugin, it seems as though that the delay time that is specified in the weapon is useless, because the timer is always reset when a player re-enters the zone. For example with a delay time of 120(2 minutes), I'll assume I have to wait 2 minutes before I can fire the thing again, but If I just re-enter zone, it always fires instantly.
The same with the repeat time, if I set it to something high, the timer always resets when I re-enter zone.

Also, as a feature request, could we have an Initial delay timer from when the player enter the zones to when the world weapon is fired? This would have more pracitcal use for say, world weapon missiles that burst with a shockwave (with correct timing ;) ), or proximity mines that take a few seconds to detonate.
Could this tank perhaps go a little bit faster, so it's not being overtaken by stationary objects.
"Words in parentheses can (not) be ignored." -Unknown
User avatar
Teppic
Private First Class
Private First Class
Posts: 576
Joined: Mon Mar 07, 2005 10:00 pm
Location: The North Block

Post by Teppic »

This code so needs to be co-opted into the tree, I said ages ago that server events should be defineable as an object, available for arbitrary execution by triggers.
Whether triggers be contact with a specific mesh face, or something present inside a defined area, they should be another object too, the same way material references and phdrivers are to meshs/faces.

I know this isn't what the code does now, but it's certainly a step in the right direction, nice work.
User avatar
knoxkorner
Private First Class
Private First Class
Posts: 112
Joined: Sat Aug 26, 2006 7:24 pm

Post by knoxkorner »

So, if a player is on a ceartin box, the delay time set will activate a sw on the box?
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan »

The plugin will trigger a shockwave (or any other world weapon) wherever you want, whenever a player enters a defined volume in the map (could be the top of a box or anything, really).

btw - I'm still trying to debug my King Of The Hill plugin; when I finish that, I'll try to incorporate the delay you are looking for Waistless...
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan »

wwzones has been updated to version 2.0 (see above). I reconfigured code to allow for 'delaytime <seconds>' to be added to map file parameters and functionalized some of the more common tasks in the tickEvent code.
User avatar
Gears of War
Private First Class
Private First Class
Posts: 9
Joined: Sun Nov 18, 2007 2:36 pm

Post by Gears of War »

where can i get this plugin?
Rock You Like a Hurricane!
Help Me build My City
Here
Im not stupid, everyone else is just smarter than me
If electricity comes from electrons, does morality come from morons?
Whoever says that nothing is impossible obviously hasn't tried to slam a revolving door...
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

Gears of War wrote:where can i get this plugin?
If you run Windows, it's included with the 2.0.10 installer package, and it might be included with 2.0.8 as well. If not, you might have to compile it from the source code. It is part of the plugins provided with the source code.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
Post Reply