New Trigger - CTF Trigger

Discussions about Coding and Scripting
Post Reply
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

New Trigger - CTF Trigger

Post by Feralidragon »

S'Calain asked me to make a fix to a trigger and script a new one. Since the fix is just a little little detail I won't place it here, but the new one was a great ideia, so I scripted it.

NAME: CTF Trigger

LOCATION:
Actor > Triggers > CTFTrigger

WHAT DOES IT DO? It's a special trigger that triggers stuff only when a flag is captured (when a team scores) in a CTF game.

PROPERTIES:
Events > Event: Like all other triggers, set the the object tag to be triggered.

CTFTrigger > Team: Set the score team to activate the trigger:
0 - Activates when Red Team scores
1 - Activates when Blue Team scores


CTFTrigger > bAnyCapture: When set to True, the Team is ignored and the trigger activates when any team scores.


I hope you find it usefull for any CTF map you are developing.

DOWNLOAD
NinjaNali
Average
Posts: 30
Joined: Fri Mar 07, 2008 10:33 pm

Re: New Trigger - CTF Trigger

Post by NinjaNali »

that already happens if you set the flags to trigger one another anyway
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: New Trigger - CTF Trigger

Post by Feralidragon »

NinjaNali wrote:that already happens if you set the flags to trigger one another anyway
What do you mean?

Edit: Checked again the CTFFlag and FlagBase scripts, they have no Trigger() function, so what you said is wrong. The flags can't trigger anything by themselves without an exterior trigger like mine. This new trigger just triggers stuff when a flag is scored, so it don't even "communicate" with the flags, only with the gametype itself: Capture the Flag.
NinjaNali
Average
Posts: 30
Joined: Fri Mar 07, 2008 10:33 pm

Re: New Trigger - CTF Trigger

Post by NinjaNali »

i could upload maps that prove you wrong, let me link you to a couple and see if we're on the same train of thought here

oh wait have to edit this website isnt working atm :/
User avatar
GenMoKai
Godlike
Posts: 2896
Joined: Tue Mar 18, 2008 9:39 pm
Personal rank: Mapper
Location: Netherlands, the land of cheese and weed!

Re: New Trigger - CTF Trigger

Post by GenMoKai »

Let me gues... CTF-Erebus?

http://files.filefront.com/CTF+Erebus/; ... einfo.html

Cause that map also had something special... when you captured a flag, there came thunder and lightning. Adjust me when im wrong
Image
EAT THOSE FRIGGIN BANANAS !!!!!
1000 MPH Studios MAY NOT play any ut99.org community mappack 2 map without George W. Bush explicit permission
][X][~FLuKE~][X][
Experienced
Posts: 113
Joined: Mon Mar 17, 2008 5:56 pm
Personal rank: RocketX5/6 creator

Re: New Trigger - CTF Trigger

Post by ][X][~FLuKE~][X][ »

they are right feri, but its not so much a form of trigger, more like a set event in the flagbase properties.


your trigger is a much better idea as it is independent from the flagbases.
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: New Trigger - CTF Trigger

Post by Feralidragon »

I'm very sorry NinjaNali, you were right all along. :oops:

I just did this as it was asked to me, and as a scripter I try to find out if the actors have already that function. The trigger function wasn't in the CTFFlag actor, and FlagBase neither (where you set the triggering event).
The function resposible by that triggering is once again the gametype itself, more specifically, "CTFGame" actor.

There are several triggering functions in that actor, and the function responsible for triggering the FlagBase event is:
if ( theFlag.HomeBase.Event != '' )
foreach allactors(class'Actor', A, theFlag.HomeBase.Event )
A.Trigger(theFlag.HomeBase, Scorer);
Still, my trigger has its advantages over this method, and its disadvantages:

ADVANTADGES: My trigger is independent of the flags, so you can place as many flags you want with just one trigger resposible for them.

DISADVANTAGES: My trigger is timed, it refreshes its state each 0,1 seconds, because the base of this trigger is checking the score each 0,1 seconds, when the score changes, a flag was scored, so the trigger activates, this means when you scor, the trigger can activate the stuff right after or in a max delay of 0,1 seconds.
Why did I timed it instead of "tick" it? Yeah, it would be instant triggering with tick, but much much more resource demanding, and as a scripter I always think in performance.

So, if someone finds it usefull (what I really doubt now), go ahead and download it and use as you want. :wink:
NinjaNali
Average
Posts: 30
Joined: Fri Mar 07, 2008 10:33 pm

Re: New Trigger - CTF Trigger

Post by NinjaNali »

lol np i guess a lot of script stuff gets done in ued when theres a fine way do to it already in mapping. It's just a lot easier (usually) to make your own script and then tell it exactlly what you want it to do i suppose
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: New Trigger - CTF Trigger

Post by Feralidragon »

NinjaNali wrote:lol np i guess a lot of script stuff gets done in ued when theres a fine way do to it already in mapping. It's just a lot easier (usually) to make your own script and then tell it exactlly what you want it to do i suppose
Yeah, but I just did this trigger because I thought that the scoring didn't trigger nothing, and it's obvious that I was wrong. A lot of mapping actors I do myself when I need them, this was just one more, but it's useless I see. lol
][X][~FLuKE~][X][
Experienced
Posts: 113
Joined: Mon Mar 17, 2008 5:56 pm
Personal rank: RocketX5/6 creator

Re: New Trigger - CTF Trigger

Post by ][X][~FLuKE~][X][ »

lol....no it wont be useless because you can add multiple functions with a trigger, so your trigger is actually better. :tu:
basics
Experienced
Posts: 86
Joined: Sun Aug 17, 2008 10:16 pm
Personal rank: game server admin

Re: New Trigger - CTF Trigger

Post by basics »

Feralidragon wrote:I'm very sorry NinjaNali, you were right all along. :oops:


DISADVANTAGES: My trigger is timed, it refreshes its state each 0,1 seconds, because the base of this trigger is checking the score each 0,1 seconds, when the score changes, a flag was scored, so the trigger activates, this means when you scor, the trigger can activate the stuff right after or in a max delay of 0,1 seconds.
Why did I timed it instead of "tick" it? Yeah, it would be instant triggering with tick, but much much more resource demanding, and as a scripter I always think in performance.
good thinking if u ask me. not using tick .
good job .
cheers
Image
User avatar
-Feint-
Skilled
Posts: 175
Joined: Sat Mar 08, 2008 1:39 pm
Personal rank: Amateur Mapper
Location: UK - Leeds

Re: New Trigger - CTF Trigger

Post by -Feint- »

Testaccount wrote:This is highly useful info dude!

Im currently planning a special CTF map. Its gonna need alot of script work however the premise is:

Battle of the Bands : UT Edition

Its capture the flag, however you don't win when the time runs out and have the most captures.

You win by allowing your Song to finish.

The songs will be of identical length about 3-4min Max, and the maps will be fairly small.

The concept is that upon capture it triggers a Play/Pause Function on the teams Music Trigger. If the enemy capture their music starts and the other teams music is paused. The longer you can keep the enemy from capping the more likely you are to win.

The only flaw I can see here is telling the game to stop the match at the end of the song. o.0

otherwise Yeah great stuff mate this script is really handy!
DanomanUK@i4games-Forum wrote:Nah, people bitch one way or another.
You cant win as a mapper ;)
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: New Trigger - CTF Trigger

Post by Feralidragon »

-K¡ngS- wrote:This is highly useful info dude!

Im currently planning a special CTF map. Its gonna need alot of script work however the premise is:

Battle of the Bands : UT Edition

Its capture the flag, however you don't win when the time runs out and have the most captures.

You win by allowing your Song to finish.

The songs will be of identical length about 3-4min Max, and the maps will be fairly small.

The concept is that upon capture it triggers a Play/Pause Function on the teams Music Trigger. If the enemy capture their music starts and the other teams music is paused. The longer you can keep the enemy from capping the more likely you are to win.

The only flaw I can see here is telling the game to stop the match at the end of the song. o.0

otherwise Yeah great stuff mate this script is really handy!
That's kinda easy I guess, it just takes to call the end game function from the CTFGame. Maybe a simple actor in the map can make it all, and pausing the music, well, the music is tracked, so I think is fairly easy to pause it, but with not with the best a acuracy, as the acuracy gets lower as the music lengh gets bigger.
User avatar
-Feint-
Skilled
Posts: 175
Joined: Sat Mar 08, 2008 1:39 pm
Personal rank: Amateur Mapper
Location: UK - Leeds

Re: New Trigger - CTF Trigger

Post by -Feint- »

Testaccount wrote:
Feralidragon wrote:
-K¡ngS- wrote:This is highly useful info dude!

Im currently planning a special CTF map. Its gonna need alot of script work however the premise is:

Battle of the Bands : UT Edition

Its capture the flag, however you don't win when the time runs out and have the most captures.

You win by allowing your Song to finish.

The songs will be of identical length about 3-4min Max, and the maps will be fairly small.

The concept is that upon capture it triggers a Play/Pause Function on the teams Music Trigger. If the enemy capture their music starts and the other teams music is paused. The longer you can keep the enemy from capping the more likely you are to win.

The only flaw I can see here is telling the game to stop the match at the end of the song. o.0

otherwise Yeah great stuff mate this script is really handy!
That's kinda easy I guess, it just takes to call the end game function from the CTFGame. Maybe a simple actor in the map can make it all, and pausing the music, well, the music is tracked, so I think is fairly easy to pause it, but with not with the best a acuracy, as the acuracy gets lower as the music lengh gets bigger.
Cool never thought of using an actor in the map.

Was about to say Im surprised that there aren'tany mapslikethis out there already,however the music fileswould easily bump the file size.

Don'tworry tho this is for a LAN match lol
DanomanUK@i4games-Forum wrote:Nah, people bitch one way or another.
You cant win as a mapper ;)
Post Reply