func_explosive doesnt trigger script (solved)


(]UBC[ McNite) #1

Hey all,

I ve been messing around with this for a bit but I guess I m too blind to find the mistake right now:
What I m trying to do is: have a brush, make it func_explosive with a health, and then have his script call triggers for other scripts when he explodes…
This is the script of the brush I made the func_explosive, and the brush and script- and targetname “barrier”.

barrier
{
	spawn
	{
		wait 100
		setstate barrier default
	}
	
	death
	{
		wm_announce "death of the woodblock"
		trigger barrierhurt destroyed
	}
}

What I get is nothing though because i don’t even get the wm_announce. Suggestions anyone?


(Shaderman) #2

Your script seems to be ok. I would put a wm_announce “test” line to the spawn part to see if the entity + script are really linked together. If this wouldn’t show the “test”-message I would check (yes again :d) the scriptname and targetname of the entity. Assuming they’re still correct, I would delete the entity and make a new func_explosive. Ah btw use g_scriptdebug 1 for testing your scripts if you don’t already.


(]UBC[ McNite) #3

Ok, here is an update… it seems that the spawn of the entities works, but not the death…

barrier
{
	spawn
	{
		wait 100
		setstate barrier default
		wm_announce "^1barrier spawned"
	}
	
	death
	{
		wm_announce "^1death of the woodblock"
		trigger barrierhurt destroyed
		trigger barrier2 barrier2visible
		wm_announce "^1both triggers executed in death of barrier"
	}
}

So when I restart the map I can see the red message for barrier spawned. But when I destroy it, I dont get any of the 2 messages in the death part… :???: so how can that be i wonder?


(damocles) #4

Are we sure that func_expolosives call their death functions? Not all entities call their deaths. If you want it to be destroyed by explosives, maybe make it a func_constructible instead - just make a small trigger_objective_info somewhere where no-one is likely to walk into it.


(]UBC[ McNite) #5

See, I need something that can be destroyed by grenades AND can call a script. Don’t func_constructibles need at least a satchel to be destroyed?


(CooperHawkes) #6

nope… just use
constructible_class 1
http://www.planetquake.com/simland/ldr1_1/construction.htm#conclasses


(carnage) #7

just make ur expolosive target a script trigger and then work from that


(]UBC[ McNite) #8

Hm ok… func_constructible with class 1 works… and now I know again why I had abandoned the idea of using func_constructible long ago: cuz now only 1 team can destroy it… and the thing about a wall etc. is that it shouldn’t matter whose grenade hits it.

Only way around this i think: making 2 func_constructibles, 1 for each team, and have the one that gets destroyed first call an invisible for the other constructible. Sounds a bit weird to me though :moo:

Just to go on with this confusion… can i theoretically make it re-constructible by both teams this way too? With 2 construction areas overlapping each other?

@ carnage: can u plz be a bit more precise about your idea? I kinda dont get how to do that.


(damocles) #9

you can indeed make it reconstrucible by both teams - look in the ET level designers reference, it has team neutral construction info in there.

Carnage’s idea is possibly the better route if you don’t want it to be rebuildable - simply set the func_explosive’s target key to match the targetname of a script_trigger entity, this way the script will be triggered.


(]UBC[ McNite) #10

For some strange reason I don’t have a script_trigger entity in my entities list… (right mouseclick in some coordinates-window) :???: I only have script_mover and script_multiplayer.

About the rebuildable-thing with the constructible-icon showing up after it has been destroyed… well I got around that with a customTEAMimage where the alphachannel is all black :smiley: so no command map icon and no engie with tears in his eyes cuz he cant find the constructible
:bump:


(CooperHawkes) #11

iirc it’s target_script_trigger


(]UBC[ McNite) #12

Solution: make the damn thing a script_mover with health… see GOGerbils thread.

Thx for the lots of help though guys, you r great :drink: