Weird team_CTF_blueflag behaviour


(Flippy) #1

Hey all…

Troy noticed this weird behaviour of a team_CTF_blue/redflag in our map…
Remember the map CTF-Face, if someone falls of the “map”, we want the flag to return to its origin.

However, when you drop the flag, it falls untill it hits the rotating skybox (which is simply a script_mover) and stays there for 30 seconds.

We wanted it quicker, so I made a nodrop texture on the bottom.
Now, when the flag hits this texture, the game announces that it returned (it takes 1 or 2 seconds, acceptable.).

HOWEVER, it doesn’t return!
It says it’s returned, but it simply dissapeared… it’s not at it’s origin, not at map center (ive seen entities jumping to there before but not this time…)
I can’t find it?!

So does the nodrop texture make team_CTF_blueflag/redflag entities to dissapear?
I just don’t get it… the script under “trigger returned” runs (custom VO’s etc) but it simply does not return…

Any info on this?


(kamikazee) #2

Tried to call “alertentity” for the flag?


(Flippy) #3

I call “alertentity” in the spawn of the game_manager, to make “setstate” work for a team_CTF_blue/redflag entity.

Do you think calling it again at “trigger returned” will bring it back?

The strange thing is that when you drop it, and wait 30 seconds, and it gets returned, then it does work… just not if you drop it on the nodrop texture.


(kamikazee) #4

BTW, I’m just guessing. I haven’t got access to the code right now and know currently nothing of how the game handles nodrop zones.

There could be some different things going on, ranging from setting the item invisible and inactive (similar to “setstate invisble”) up to “killing” it. And since a dead func_mover can be restored by doing “alertentity”, I just took a guess here.
Anyway, try and see what happens. Should this work, don’t forget to test what happens if it gets returned normally, in that case the call to “alertentity” might do weird things.


(broloi) #5

This might be because of Surfaceparm Nodrop.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for "Pits of Death." Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

taken from http://www.heppler.com/shader/shader/section4.htm#4.8 about the Surfaceparm Nodrop.

And the nodrop texture does of course use this surfaceparm. The flag might act like the weapon, and simply not draw, if you know what i mean.


(Flippy) #6

I knew that nodrop prevented weapons from dropping, but i figured it might also return an objective if dropped there.
And it seemed that it did, because the trigger returned event is triggered.
But the flag entity simply does not return…

I will try kamikazees suggestion shortly… in the meantime, what do other people use to prevent objectives from falling into unreachable locations?


(murka) #7

hmm, never had such a situation, i would have tried “kill” or sth then asked in this forum :stuck_out_tongue:


(RayBan) #8

ok… what your gonna want to do is put back some functionality from the original quake3 source that was not used ( but still exists in et ). in your scripts folder find the et_entities.def file and at the end of the file add this and save it,


/*QUAKED target_remove_powerups (1 0 0) (-8 -8 -8) (8 8 8)
takes away all the activators powerups.
Used to drop flight powerups into death puts.
*/

now all you need to do is create a trigger_multiple brush that covers the floor
area of your map, near the bottom where someone drops into, but above any
trigger_hurt thats designed to kill the player. basicly you want the player to
touch this brush before he gets killed so it can remove the flag he’s carrying.

now add the new target_remove_powerups entity and target that trigger_multiple at it.
you will also need to add a target_script_trigger entity and give it the same
targetname as the target_remove_powerups entity you just added, so that
the trigger_multiple brush targets them both at the same time.

you will need to do this for both teams, so i’ll just cover the allied side now
but its the same for the axis, just some different key/values.

select the trigger_multiple brush and check the allied_only box, then
deselect it.

click on the target_script_trigger and add,


scriptname axis_flag
target returned

since your an allied player who has fell into the abyss, once you hit the
trigger_multiple, it will remove any flag your carrying, plus call the axis_flag
returned trigger in the script to instantly replace it back.

here’s a modified map to test it, try taking the enemy flag then just jump
off the side to see it get removed from you, and replaced back.
http://rapidshare.com/files/31823139/ctf_remove_powerups.pk3.html

now you need to do the same for the axis team, create a duplicate trigger_multiple
but target that at a new target_script_trigger and a new target_remove_powerups entity(s)

in the trigger_multiple for that one, select axis only, add the same thing
for the target_script_trigger associated with it, but change


scriptname axis_flag 

to


scriptname allied_flag

check it out in the sample map i put at rapidshare to see how its done.


(Flippy) #9

The entity doesn’t show up in my list… :frowning:
I added it to the entity def file in the scripts folder of my ET install but it still doesn’t show up?

Thanks for that info though!

EDIT
Nevermind, Im using 1.5 now and just found out you need to add entities differently… got it now! Going to try it now.

EDIT2:
Tried it, doesn’t work for me :frowning:
I don’t know what I did wrong, afaik i did it exactly the same as your map… weird.


(RayBan) #10

actually… just thinking about it, there’s going to be some problems…
if a player is carrying a flag, and one of his teammates falls into the abyss,
it will cause the ctf_flag entity to re-appear even though there is a flag
in play…

so… to get around that, you would need to add scriptnames/targetnames to
the trigger_multiples to hide them until a flag is taken, then reveal them…
and hide them again when a flag is returned.

that should cover all bases.

EDIT:

ok… just tested it, you would have to give the trigger_multiples targetnames
such as allied_trigger_pwrup_remove/axis_trigger_pwrup_remove ( i used these )
and then add to the game_manager spawn this,


		setstate allied_trigger_pwrup_remove invisible
		setstate axis_trigger_pwrup_remove invisible

then in allied_flag trigger stolen add

setstate axis_trigger_pwrup_remove default

in allied_flag trigger returned add

setstate axis_trigger_pwrup_remove invisible

and finally in allies_cap_flag death add

setstate axis_trigger_pwrup_remove invisible

do the same for the axis_flag and axis_cap_flag scripting…

altough… you probably could use track also… and not play with the scripting… anyway that works i guess…

but that should cover it all.


(RayBan) #11

it should work… since it works in the test map. you could always select both
trigger_multiples, and the target_remover_powerups + the target_script_triggers, once they are all selected, just save them as a prefab.

then load up your map, load the prefab in, place the trigger_multiples where
u need them and resize them to fit.

only other difference that may be, is im using gtk-radiant 1.3.13, although im
not shure that would make much of a difference… did you try taking the sample
map from the pk3 i uploaded, and compiling that in your version of radiant?


(Flippy) #12

You got a point there…

Did you test this latest ‘update’? Cos I think you got the same problem with your approach…?

You hide the triggers until a flag is taken. Ok…

Flag is taken -> Trigger default (non invisible).
Teammate falls into the trigger -> flag returned is called…

Same problem, no?

EDIT
I think the problem might be that the entity does not work in my editor…
Im using 1.5.
I manually added the entity to the def list (which is new in 1.5 and very different from 1.3 / 1.4) and had to change a few things so i might have not done it properly…
Here’s what i added:

<point name="target_remove_powerups" colour="1 0 0" box="-8 -8 -8 8 8 8">
Takes away all the activators powerups.
Used to drop flight powerups into death puts.
</point>

And here’s what ‘target_print’ for example looks like:

<point name="target_print" colour="1 0 0" box="-8 -8 -8 8 8 8">
This will print a message on the center of the screen when triggered. By default, all the clients will see the message.
-------- KEYS --------
<string key="message" name="Message">text string to print on screen.</string>
<targetname key="targetname" name="Target Name">the activating trigger points to this.</targetname>
-------- SPAWNFLAGS --------
<flag key="AXIS_ONLY" name="Axis Only" bit="0">only the axis players will see the message.</flag>
<flag key="ALLIED_ONLY" name="Allied Only" bit="1">only allied team players will see the message.</flag>
<flag key="PRIVATE" name="Activator Only" bit="2">only the player that activates the target will see the message.</flag>
</point>

I dunno…
I have no time now to use your map but I will soon.

Also, how did you get your flags models to move? I thought this wasn’t possible with a returnable objective model?


(RayBan) #13

ok, i just tested my radiant 1.5, and its not working in there… im not shure
why… even when i added the new entity which does show up in the editor.

but thats only compiling the bsp from radiant 1.5 which doesnt make it work…
im not shure why. i loaded the map with it, saved with it ( 1.5 ) and just now
compiled with q3maptoolz, and it works fine.

and yeah… thinking about it, would be the same problem with the falling…
so… there may be a work around… have to think about it some more…


(Flippy) #14

Ok, I’ll compile with Q3MapToolz too from now on… ive got it lying around somewhere soo…

Ill think about the bug too.


(RayBan) #15

ive thought about it many ways, and they may not be away around it…
( the bug ), only way i can see it working, is to give the ctf_entitys a large amount ( im not shure what the limits are )

and have flagonly multiples down there where the trigger_multiples are just
to destroy the flag, and not go towards any scoring.

now if players decided to be silly enough and just grab a flag and jump to
their deaths, it would eat up all the flags eventually, and in that way… “break”
the map… it would just keep running til its time limit was up, with nothing
for the players to do, but kill each other.

but then again… why would players do that…

again, i dont know if there is some limit on how high the flag count is, but
if you could set it to 2000 or so, then you could make the map work the
way you want, since your ending the game with a scoring system based
on the script.

so, you can try that. forget the changes i mentioned ( the quaked target_remove_powerups ) ect…

and make flagonly_mutiples down there, just to remove the flags and
call the return of the normal flag_onlys to reveal them back.


(Flippy) #16

That could be an idea…
so you mean in the pit there’s a flagonly_multiple (the goal) which triggers a capture of a flag, but simply doesn’t add any points to the score?
Good idea, I think we’ll use that!

Oh and, how did you make your flag models move?


(RayBan) #17

the flagmodels moving, is just a shader effect on the flag, i made the flags
sort of ruffled to begin with, and its just a shader that deforms the vertexes
that make it appear to move or wave

EDIT:
and yeah, the flagonly mutiple in the pit is just to capture the flags to simply
remove them. thats the only way i can see returning them instantly without
creating a whole mess of "what if a player falls in while… " ect…


(Flippy) #18

But i just thought of it… every time the flag falls into the pit, the ET announcer will say “Objective captured!”…


(RayBan) #19

he shouldn’t… thats something you put in your death script, afaik… check out
goldrush, it doesnt mention that at all when you get the crates to the truck,
because in the death part, they voiceannounce the gold crates secured.

check out the test map i sent, open script out and comment out the
wm_annouce text, you will see it does nothing but capture the flag when you
bring it to yours, and no mention, voice or otherwise ( text ) when you do,
because thats something you need to put in.

unless it spams those vo’s in spectator mode… that im not shure of.
the 'objective taken" and ‘objective returned’ you will hear though… and you
should probably script in the ‘objective returned’ vo when the flag gets
captured by the brush in the pit… just so it appears to have been returned
quickly, when it of course… is gone, and a new one has taken its place.


(Flippy) #20

Oh :smiley: I thought these standard VO’s were hardcoded into the game…
That’s good news :slight_smile:
I will see what I can do today…
Thanks alot!

EDIT
Finally had time to test it, and it works perfectly :slight_smile: Flag returns immediately and our custom announcer says Red Flag Returned! :smiley:
Also, it takes approx. 7 seconds to run from flag to your death.
With a roundtime of 20 minutes = 1200 seconds, this means you can keep running of the map to spoil the map only 1200/7 = 171 times… And the count of the entities is set to 200 now so that shouldn’t be a problem :slight_smile: