Func_Explosive destroyable with 1 bullet? **SOLVED**


(d3coy) #1

I have a func_constructable that when built by the allies, the axis only need to shoot it once to destroy it. I want it destroyable by dyno and satchel.

Cany anyone help?

Script:

cmdctr
{
	spawn
	{
		wait 200
		trigger cmdctr setup

		constructible_class 2
		constructible_health 50 
	}

	trigger setup
	{
		setstate cmdctr invisible
		setstate cptruck invisible
		setstate cptruck_bw invisible
		setstate cptruck_fw invisible
		setstate cpgenwls invisible
		wait 200
		setstate cmdctr_materials default
		setstate cmdctr_materials_clip default
		setstate cmdctr_flag default
		wait 200
		setstate transmitter_cm_marker invisible
		setstate transmitter_cm_toi invisible
		setstate documents_exitpoint invisible
		wait 200
		globalaccum 4 set 0
		globalaccum 5 set 0
	}

	buildstart final
	{
		setstate cmdctr underconstruction

		setstate cmdctr_materials default
		setstate cmdctr_materials_clip default
		setstate cmdctr_flag default
	}

	built final
	{
		setstate cmdctr default

		setstate cmdctr_materials invisible
		setstate cmdctr_materials_clip invisible
		setstate cmdctr_flag invisible
		setstate cptruck default
		setstate cptruck_bw default
		setstate cptruck_fw default
		setstate cpgenwls default
		wait 200
		setstate transmitter_cm_marker default
		setstate transmitter_cm_toi default
		wait 200
		
		globalaccum 5 inc 1  //  Field HQ Built

		globalaccum 4 abort_if_equal 0 // Has keycard been secured?
		setstate documents_exitpoint default

		

		// *----------------------------------- vo ------------------------------------------*

		// *---------------------------------------------------------------------------------*

		// Some kind of UI pop-up to alert players
		wm_announce	"The Allies have setup a Field HQ"

	}

	decayed final
	{
		setstate cmdctr invisible

		setstate cmdctr_materials default
		setstate cmdctr_materials_clip default
		setstate cmdctr_flag default
	}

	death
	{
		setstate cmdctr invisible

		setstate cmdctr_materials default
		setstate cmdctr_materials_clip default
		setstate cmdctr_flag default
		setstate cptruck invisible
		setstate cptruck_bw invisible
		setstate cptruck_fw invisible
		setstate cpmg42 invisible
		setstate cpgenwls invisible
		wait 200
		setstate transmitter_cm_marker invisible
		wait 200
		globalaccum 5 set 0  // Field HQ Destroyed!
		globalaccum 4 abort_if_equal 0 // Has Keycard been secured?
		setstate documents_exitpoint invisible
		
	

		// Some kind of UI pop-up to alert players
		wm_announce	"The Axis have destroyed the Allied Field HQ."

	}


}

Entities:

cmdctr

classname: func_constuctible
spawnflags: 8
targetname: cmdctr
scriptname: cmdctr
track: Command Center

Thanks


(DerSaidin) #2

“constructible_class 2” is the important part for making it satchelable/dynoable.

My guess is that “constructible_health 50” is conflicting with that. Try removing this line.
I’m not sure how the value 50 means that you can kill it in one hit. Perhaps its something to do with the constructible class needing only 1 dyno/satchel hit.


(Diego) #3

Oh crap. I had this same problem earlier. Let me see if I can remember what I did to fix it.


(Flippy) #4

i have no idea but maybe try putting “constrictuble_class 2” above “trigger cmdctr setup”… maybe that’s your problem… but again i have no idea really.

What is constructible_health?
How much is “50” in health? Is this the same as player health? might not be… but dunno


(Jecoliah) #5

Remove the line in the script (constructible_health 50) and in the “Entity” make the “Key” Health 0.

Jec


(Diego) #6

Mine problem was not quite related to this. I was using a spawn function of my generator constructable to set the visiblity state of some door switches in another entity. The script did not like that. The result was that my constructable generator could be destroyed by bullets or dynomite, but not by a satchel even though it was a class 2.

So I removed that code from my constructable routine and then it behaved correctly. I also did not need to specify health in the entity or the script to have it work correctly.


(d3coy) #7

This worked… thank you so much for your help.