constructible flagpole


(FireFly) #1

In my map I have a flag that needs to be captured. But to make things more interesting I decided to make the flag a contructible, more or less similar to radar (side entrance) but in my case both teams can construct the flag…

This is the idea (see screenies above): when the game starts an allied- or axis engineer can construct a flag-pole (neutral crates, similar to the fueldump axis tower/ allied mg ) so their team will spawn there. When an axis eng is constructing, an axis flagpole will appear: when an allied eng is constructing an allied flagpole will appear… Now, when , for example, the axis has constructed the flag, any alliedplayer can ‘touch’ the flagpole, but instead of changing the flag into allies , the flag-pole will disappear and the constructible crates will reappear for the allied eng to construct: same thing for the axis team…And most importent : I do NOT want the flagpole to be destroyable by either dynamite or a Satchel Charge…

So I made myself a little testmap and all works well except:

1] the flagpole can be destroyed because it’s a constructible item after all. what I can try to do is this: after one of the teams construct the flagpole make it invisible and replace it with a static model…

2] this is the main issue and reason why I am posting this: how can I make it so that when a player ‘touches’ the pole, the flagpole disappears and the constructible crates re-appear ? My first guess is to use a small trigger_multiple brush covering the pole so the script knows what team entered the brush/ touched the pole? problem is that I never used this entity before and can’t find any info on it: So in other words: what entities and scripting would I need to create this? :nag:

I must add that I made 2 separeta md3 models for both the axis flagpole and the allies flagpole to appear when constructed…


(Loffy) #2

So, you want this:
Each team spawn at thier side of the map. Somewhere in the middle there is a neutral flag. Any eam may capture it. The team that holds the flag will spawn here (in the centre of the map). However, this flag, the centre flag, is not visible at start. Only the neutral constructibles.
Right?
//L.


(Ifurita) #3

Here’s a snippet of code from Decerto. In the Supply Depot arena, the allied team has to get to the top and build the crane controls, which then kills everyone in the arena and resets it for the next drill. So, with your flag pole, upon allied_capture, trigger the axis reset and visa versa. Pull from the Command Post script to setstate and alert entity the actual spawn points.


	built final 
	{
		setstate crane_materials invisible
		setstate crane_materials_clip invisible
		setstate crane_flag invisible
		setstate cranecontrol default
		trigger self reset
	}

	trigger reset
	{
		wm_announce "Crane controls constructed: Supply Depot Arena Resetting"
		//enablespeaker sd_winallies

		wait 2000

		setstate sd_reset_hurt default // kills everyone inside the arena

		wait 2000

		kill cranecontrol // kills the constructable
		trigger self setup // makes the build crates and toi visible again
	}


(FireFly) #4

@Loffy: yes that is correct. Also when one team owns the flag and a player from the other team touches the flagpole , the flagpole disappears and the neutral constructible’s re-appears: and both teams will spawn at their own side of the map again, until one team will construct the flag again…

Basically its a combination of the allied cp on ‘radar’ and the axisguard tower / allied mgnest on ‘fueldump’… I also can’t use the custom flagpole (team_WOLF_checkpoint) because, with this entity, I believe that it must be owned by either axis or allies at the beginning of the game and cannot be neutral by default. So I had to make two custom models of a pole with an animating flag, one for axis, one for allies.

@Ifurita: I just did some testing with the script you supplied and it seems to work, thanks: I have a trigger_multiple brush, covering the flagpole, targeting a target_script trigger. so when a player touches the trigger_multiple the trigger self setup function gets called in the script making the flagpole to disappear and the constructible crates to reappear…


(LowLife) #5

I dont see no need for a trigger, as the team_ctf_checkpoint itself calls these functions:
“trigger allies_capture” when touched by allies and “trigger axis_capture” when touched by axis.

Oh, btw nice idea :smiley: