Capturing a team_ctf_redflag/blueflag event?


(SteelRat) #1

I got a question that I can’t find the answer to…and it might be that there is no answer. I did check the LDR but did not find what I was looking for.

How do you capture team_ctf_redflag / blueflag events?

I know that you use death in the script for a ctf type objective like docs to “deliver” the flag.

Now usually you don’t need to do this as all you are interested in is delivering the flag to a location, but I want to check if the flag is being carried by a player, dropped or returned by the opposing team.

Is there any documentation about the scripting parameters around team_ctf_redflag?
Is death the only one supported?

/SteelRat


(DerSaidin) #2

There is, look in the adlernest script. (I’d get it for you but I’m not at home)

I think in the gamemanager, theres a few functions for objective dropped/returned etc.


(Lanz) #3

The team_ctf_red/blueflag script events look like this:


flag
{
	spawn
	{

	}

	trigger stolen
	{

	}

	trigger dropped
	{

	}

	trigger returned
	{

	}

	trigger captured
	{

	}
}

Just remember that if you plan on giving the ctf flag entity a targetname you need to to activate the entity with “alertentity targetname” or it will not be visible in-game.

edit: oops wrong, changed…


(MrLego) #4

You can also look for some Quake 3 CTF tutorials - they may be a little outdated for ET but much of the code is similar.


(crapshoot) #5

I stumbled across this site a while ago. Maybe it’s useful here:

http://games.chruker.dk/enemy_territory/scripting_reference.php#entity_events


(SteelRat) #6

You guys rock!! :clap:

Thanks a lot for all the answers :slight_smile:

Really good link as well crapshoot, wonder if anybody from SplashDamage still reads these forums…it should be added to the reference links.

Thanks,
SteelRat


(SteelRat) #7

and just a post if someone wonder what the problem was, I forgot to add a scriptname to the team_ctf_redflag entity :stuck_out_tongue:

Now all is working just fine.