Page 1 of 1

wwzones

Posted: Thu Jan 11, 2007 9:02 pm
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.

Posted: Thu Jan 11, 2007 9:38 pm
by Tanner
Cool!

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

-Tanner

Posted: Sun Jan 14, 2007 5:14 am
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!!!!

Posted: Sun Jan 14, 2007 5:29 am
by Davy Jones
Amazing, Simply amazing...not to mention auto firing turrets and land mines when someone is near *lost in thought*

Posted: Sun Jan 14, 2007 10:12 am
by Zelgadis
yeah, nice :)

Posted: Sun Jan 14, 2007 10:26 am
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.

Posted: Sun Jan 14, 2007 3:02 pm
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 :)

Posted: Sun Jan 14, 2007 11:37 pm
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.

Posted: Mon Jan 15, 2007 1:21 am
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.

Posted: Wed Jan 17, 2007 10:38 pm
by knoxkorner
So, if a player is on a ceartin box, the delay time set will activate a sw on the box?

Posted: Wed Jan 17, 2007 10:54 pm
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...

Posted: Sat Jan 20, 2007 2:58 pm
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.

Posted: Thu Feb 21, 2008 3:59 am
by Gears of War
where can i get this plugin?

Posted: Thu Feb 21, 2008 4:57 am
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.