script called twice


(Massive) #1

I’m getting some odd behaviour on a constructable death trigger. You dynamite the doors and the ‘death’ trigger gets called twice.

This is a problem as it is setting a new spwan point to a new location, which i think is now failing because the trigger is happening twice (though I may be wrong - if anyone has any other ideas as to why the spawn point is not working pls let me knw)

(btw. the spawns are not activated, as you can not even change to them manually, the allied flag doea appear on the cmd map though)



//Abbey Door
abbeydoor_script
{
	spawn 
	{
		wait 200
		constructible_class 3 
	}

	death 
	{
		wm_announce "Allies have destroyed the Abbey Door"

		setstate abbeydoor_axisdoor invisible 

		wm_objective_status 3 0 2
		wm_objective_status 3 1 1

		setstate abbeyspawn_wobj default
		alertentity  allies_spawn_abbey

		setautospawn	"Abbey Spawn"	1
		setautospawn	"Axis Spawn"	0

		wm_removeteamvoiceannounce 1 "lmsm_allies_detroy_entrance_tell"
		wm_removeteamvoiceannounce 0 "lmsm_axis_defend_entrance_tell"	


		wm_teamvoiceannounce 0 "lmsm_axis_detroyed_entrance"
                wm_teamvoiceannounce 1 "lmsm_allies_detroyed_entrance"

		wm_teamvoiceannounce 0  "lmsm_axis_defend_objective_tell1"


	}
}


Also this actually worked, It was working in Beta1 & I don’t know why it is stopped working now - I don’t think I’ve made any changed.

Also Also before anyone askes I’ve gone through the .map file in text mode and there is definitely only 1 entity which has this script name.

Thanks

Massive


(codejockey13) #2

abbeydoor_script

maybe you accidentally duplicated the target_script_trigger? Did you cut and paste the same style door somewhere else? See if you have two of them.

oh wait sorry just woke up. If you only have one entity then I would look through your script again and see if you duplicated the script code for the door.

btw you can press M in radiant to see what your map contains rather than going through the map in a text editor.


(Massive) #3

No duplicated script I’m afraid

(I find M a bit awkward to use, search find in notepad is easy & quick for this kinda thing :-))

M


(codejockey13) #4

Oh ok so it’s your spawns then and not the door. Did you cut and paste your spawns and then change the key values in them? I’ve found (even when I made Quake Arena maps) that duplicated spawns can cause odd behavior. Some folks said duplicated spawns worked fine in their maps but I always seemed to have a problem with them. It seemed to do it in ET also when I made a tutorial map.

Try this. Make a backup of your map. Delete the spawns. Add just one spawn point in each place and then test and see if they pop around like you want them.


(Massive) #5

Oh f**k - I did duplicate in some more spawns to get to the recomended 20. I was hoping this was a script problem which I can fix without a recompile as I wanted to release the beta2 today :-(. - I will try this in a bsp compile thanks.

Also script wise I just worked out as the script runs twice then the alertentity commend will activate then de-activate the spawns causing the problem, so I’ll still hold out hope that it is the scripting (anyone help??) and that I can stop the thing running twice.

I’ve tried this



//Abbey Door
abbeydoor_script
{ 
	spawn 
	{
		wait 200
		constructible_class 3 
		accum 0 set 0
	}

	death 
	{


		wm_announce "Allies have destroyed the Abbey Door"

		setstate abbeydoor_axisdoor invisible 

		wm_objective_status 3 0 2
		wm_objective_status 3 1 1


		trigger self switchspawn


		wm_removeteamvoiceannounce 1 "lmsm_allies_detroy_entrance_tell"
		wm_removeteamvoiceannounce 0 "lmsm_axis_defend_entrance_tell"	

		wm_teamvoiceannounce 0 "lmsm_axis_detroyed_entrance"
                wm_teamvoiceannounce 1 "lmsm_allies_detroyed_entrance"

		wm_teamvoiceannounce 0  "lmsm_axis_defend_objective_tell1"


	}
	trigger switchspawn
	{

		wm_announce "A"

		accum 0 abort_if_equal 1


		wm_announce "B"

		accum 0 set 1 

		wm_announce "C"

		alertentity  allies_spawn_abbey
		alertentity  abbeyspawn_wobj
	//	setstate abbeyspawn_wobj default


		setautospawn	"Abbey Spawn"	1
		setautospawn	"Axis Spawn"	0

	}
}


I get A , B, C, displaye din order twice AND the accum thing doesn’t work, which is really freaking me out.

Massive


(Massive) #6

Ok - this must be caused by the routine running twice - it toggles to spanws on then off again.

more info - in script debug mode I can see that the death event is being triggered twice in succession, I can’t see any reason for this - any ideas?

M


(Massive) #7

I found a brush with the same script name, which was not in the entity & should have been (why it didn’t show up when I looked in the map file???)

si I did bsp compile & test - now when I trigger the script (blow up the abbey doors) the whole of the ET programme just dissapears - not even a nioce freindlt GPF screen -


(S14Y3R) #8

D’oh! Make sure you only have one script_multiplayer, Easygen will output one if the box is checked and you can save more than one in a map.