Event Based World Weapons

General talk about the map making process.
Post Reply
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Event Based World Weapons

Post by JeffM »

I have hooked up a new way to trigger a world weapon.
You can now trigger them on a couple of events.
Events such as;
A flag capture
A player geting killed
A player spawning.

These can be used to clear a base after a capture, or for something more visual like fireworks on a spawn, death, or capture.

to do this, define a world weapon as normal, but do not putin any times ( inital time or dellay time ). Instead put in the following

trigger <EVENT TYPE>

where <EVENT TYPE> is one of the 3 following things
onCap
onSpawn
onDie

The weapon will then fire when the event happens.

If you want to tie the weapon to a specific team ( like to clear a base ) just put in a line with;

eventteam <TEAM NUMBER>

Where <TEAM NUMBER> is a team ID ( just like bases ).
A team number of -1 will mean all players.

To make base clearing simple, you can also add the onCap item to a base and provide it with a weapon type and it will automaticly add a weapon event that will fire that weapon type on capture for that team's flag, at that base. In realitly since you can't define all the other world weapon options here, the only real valid thing is SW. If you want more controll it's best to define a real world weapon and tie it to the cap event.

example

Code: Select all

weapon
position 0 0 10
type SW
trigger oncap
eventteam -1
end
This weapon will trigger a shockwave at 0,0,10 when ever anyone captures any team flag.

This code is in CVS and is a server only change.
ImageJeffM
User avatar
Dervish
Private First Class
Private First Class
Posts: 651
Joined: Thu Dec 05, 2002 12:39 am
Location: public void

Post by Dervish »

nice, thank you. :) Is this a change in bzfs or bzflag?
protected object myTank(){
foreach(noob in this.game){return frag(noob);}}
Image
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

just bzfs.

the client dosnt' care where the world weapons come from
ImageJeffM
User avatar
Dervish
Private First Class
Private First Class
Posts: 651
Joined: Thu Dec 05, 2002 12:39 am
Location: public void

Post by Dervish »

Sweet, that makes sense. Thanks.
protected object myTank(){
foreach(noob in this.game){return frag(noob);}}
Image
User avatar
romfis
Private First Class
Private First Class
Posts: 215
Joined: Tue Jan 18, 2005 6:33 pm
Location: Österreich / Wien
Contact:

Post by romfis »

HI

please, posting the bzfs.exe (windows) for the new commands - world weapons

thanks!
User avatar
romfis
Private First Class
Private First Class
Posts: 215
Joined: Tue Jan 18, 2005 6:33 pm
Location: Österreich / Wien
Contact:

Post by romfis »

HI

please a testmap, to see to look like it has?

mfg.
romfis
User avatar
TD-Linux
Sergeant
Sergeant
Posts: 724
Joined: Wed Apr 27, 2005 8:26 pm
Location: Mountain View, CA

Another trigger suggestion

Post by TD-Linux »

Why don't you make another trigger that fires when a tank enters a certain area? So that when a tank drives in front of a cannon, for example, the cannon fires at the tank.

One other thing: When do we get locking GMs?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

the on zone area is part of the spec. At present bzfs does not track tanks in zones. as soon as it does that event can be used.
ImageJeffM
User avatar
cosmos
Private First Class
Private First Class
Posts: 83
Joined: Thu Dec 23, 2004 7:18 pm
Location: Los Angeles
Contact:

Re: Event Based World Weapons

Post by cosmos »

JeffM2501 wrote:I have hooked up a new way to trigger a world weapon.
You can now trigger them on a couple of events.
Events such as;
A flag capture
A player geting killed
A player spawning.

These can be used to clear a base after a capture, or for something more visual like fireworks on a spawn, death, or capture.

to do this, define a world weapon as normal, but do not putin any times ( inital time or dellay time ). Instead put in the following

trigger <EVENT TYPE>

where <EVENT TYPE> is one of the 3 following things
onCap
onSpawn
onDie

The weapon will then fire when the event happens.

If you want to tie the weapon to a specific team ( like to clear a base ) just put in a line with;

eventteam <TEAM NUMBER>

Where <TEAM NUMBER> is a team ID ( just like bases ).
A team number of -1 will mean all players.

To make base clearing simple, you can also add the onCap item to a base and provide it with a weapon type and it will automaticly add a weapon event that will fire that weapon type on capture for that team's flag, at that base. In realitly since you can't define all the other world weapon options here, the only real valid thing is SW. If you want more controll it's best to define a real world weapon and tie it to the cap event.

example

Code: Select all

weapon
position 0 0 10
type SW
trigger oncap
eventteam -1
end
This weapon will trigger a shockwave at 0,0,10 when ever anyone captures any team flag.

This code is in CVS and is a server only change.
I have enabled this on the hepcat overlord map which is currently suffering from too much base and spawn camping making gameplay unfair. we will see how this works out.

thanks jeff
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

This is a sample map that makes a shockwave fire at the middle of the map, everytime somone caps.

Code: Select all

base
color 1
position 200 0 0
size 10 10 0
end

base
color 2
position -200 0 0
size 10 10 0
end

base
color 3
position 0 200 0
size 10 10 0
end

base
color 4
position  0 -200 0
size 10 10 0
end

box
position 0 0 0
size 5 5 5
end

weapon
position 0 0 10
type SW
trigger oncap
eventteam -1
end
ImageJeffM
User avatar
cosmos
Private First Class
Private First Class
Posts: 83
Joined: Thu Dec 23, 2004 7:18 pm
Location: Los Angeles
Contact:

Re: Event Based World Weapons

Post by cosmos »

cosmos wrote:
I have enabled this on the hepcat overlord map which is currently suffering from too much base and spawn camping making gameplay unfair. we will see how this works out.

thanks jeff
Worked out an issue with JeffM today and can now utilize multiple oncap shockwaves per team cap. For instance on the Overlord server clearing the base still is not effective against campers since there are multiple towers hovering over the base and they could just drop down or fire GM from those and still camp.

We now clear the base and the close proximity towers after cap and hopefully will even the play a bit and reduce the lame spawn camping.

cosmos
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox »

Now for a world weapon that will destroy a player if they take their own team flag x units AWAY from their base.

Can it be done?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

there is no seting for distance of flags. it just just an on capture, on spawn, or on death event.

anything can be done it just takes time and code. presently there is no code to do that.
ImageJeffM
User avatar
TD-Linux
Sergeant
Sergeant
Posts: 724
Joined: Wed Apr 27, 2005 8:26 pm
Location: Mountain View, CA

Post by TD-Linux »

Now for a world weapon that will destroy a player if they take their own team flag x units AWAY from their base.
This cannot be done, but there is an alternate method. Make it so that flags cannot be dropped anywhere but that area around the base, and then make the only safe zone for flags the team base. If anyone drops a flag in the nonflag zone, it will travel back to the base.

NOTE: This will not work if the map has superflags on it.
User avatar
Toastline
Private First Class
Private First Class
Posts: 71
Joined: Tue Jul 19, 2005 6:42 pm
Location: Somewhere else! Not here!
Contact:

Post by Toastline »

Does one need a certain version of BZFlag for onDie and such to work? I can't seem to get it to, with 2.0.0.
OMNOM!
User avatar
Saturos
Art Master General
Art Master General
Posts: 1111
Joined: Mon Apr 19, 2004 2:48 pm
Location: Berlin/Germany
Contact:

Post by Saturos »

Toastline wrote:Does one need a certain version of BZFlag for onDie and such to work? I can't seem to get it to, with 2.0.0.
JeffM wrote:This code is in CVS and is a server only change.
User avatar
Toastline
Private First Class
Private First Class
Posts: 71
Joined: Tue Jul 19, 2005 6:42 pm
Location: Somewhere else! Not here!
Contact:

Post by Toastline »

D'oh! *hits self on head*
OMNOM!
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

Is it possible for other events to happen, other than a world weapon... on flag cap? Like, for example, a /say command ??? or a /set _skyColor type of deal???

I asked this before in another way....

I'm interested in finding a way to make the "server" more interactive. So when a flag is capped, say red captures the blue flag, the server says (as if someone did a /say command)
Server: OMG! The Blue Team just had its flag catpured! WHat a bunch of losers!!!
...and the sky changes color to red.

Then, when blue captures the red flag....
Server: OMG! The Red Team just captured the Blue Team's flag! What a bunch of losers!!!
Then the sky goes back to blue...

I'm not dead set on THESE settings on cap... but I'd like to see how and what you set this stuff up.

Is what I want to do possible?
...This has been a recording.
User avatar
TD-Linux
Sergeant
Sergeant
Posts: 724
Joined: Wed Apr 27, 2005 8:26 pm
Location: Mountain View, CA

Post by TD-Linux »

Quote:
Server: OMG! The Blue Team just had its flag catpured! WHat a bunch of losers!!!


...and the sky changes color to red.

Then, when blue captures the red flag....

Quote:
Server: OMG! The Red Team just captured the Blue Team's flag! What a bunch of losers!!!
So the Blue Team is called losers both times?
User avatar
Toastline
Private First Class
Private First Class
Posts: 71
Joined: Tue Jul 19, 2005 6:42 pm
Location: Somewhere else! Not here!
Contact:

Post by Toastline »

HEHE! There's a typographical error for you!
...or is it?
OMNOM!
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

I_Died_Once
yes, but only with a plugin. the only thing a map can do on an event is fire a world wep. Plugins can do a lot more based on an event, like set stuff in the bzdb, send text messages, set scores, kill people, etc....

TD-Linux
this would also be a plugin, you can kill any players, even those all on one team with a plugin, and provide any message you want.
ImageJeffM
User avatar
(Un)Guided Missile
Private First Class
Private First Class
Posts: 37
Joined: Sun Jan 23, 2005 2:23 pm
Location: Scotland
Contact:

Post by (Un)Guided Missile »

Is there anyway to make the shock radius larger on an onCap world weapon than normal?
Cop @ Far, far, far too many servers. (How the heck am I meant to visit them all regularly?)
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

(Un)Guided Missile wrote:Is there anyway to make the shock radius larger on an onCap world weapon than normal?
No, it uses the same variables used for the sw flag, I beleive. If I'm wrong someone correct me. :wink:
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
Post Reply