Making a dyno obj fixable? how?!??! please help!!!


(psyco_mario) #1

Can someone please help me?

on my map there is a generator and when it is blown it disables 2 panzers guarding the gate… i want to make the generator… AND the gate… fixable (but seperatly)

My script for generator:
gen1 {
spawn {
wait 200
constructible_class 3
}
death {
kill gpan
kill gpan2
wm_announce “Allies have blown the generator!!! ^1Guard Panzers Disabled!!”
}
}
My script for gate:

gate1
{
spawn
{
wait 200
constructible_class 3
}

death
{
wm_announce “Allies have blown the gate!!!”
}
}

Now, how can i make these destructable AND fixable?
(so they start built, and when they are blow, you can fix… then blow again… then fix agian… ect)


(kamikazee) #2

Make a func_constructible, check if the desired team can build it and the other destroy it. After that, set the start_built spawnflag on the func_constructible.

I guess you allready know how to make one or at least know how to search for tutorials. :wink:


(psyco_mario) #3

tyvm… BUT once you kill something how do you bring it back?


(Shaderman) #4

Look at the goldrush barriers (map & script). Should be what you want.


(S14Y3R) #5

Hi, to resurrect a dead func_constructible, use a trigger_objective_info targeting your constructable. Check flags according to team in each, and have one _toi for each constructible. In your script you’ll need to add


buildstart final
{
     setstate stuff underconstruction
}
built final
{
     setstate stuff default
}

decayed final
{
   setstate stuff invisible //constructing failed
}

Your death looks okay, so that should do it :drink: .


(psyco_mario) #6

its not that its the

death {
kill gpan
kill gpan2
wm_announce “Allies have blown the generator!!! ^1Guard Panzers Disabled!!”
}
}
part…

its says:
kill gpan
kill gpan2
but how can i bring them back?

(what cmd is the opppisie to kill? ressuect?)


(kamikazee) #7

alertentity on the dead entity could work.

Another approach is to ‘setstate’ them, your script would look more like this then:

gen1 {
    spawn {
        wait 200
        constructible_class 3
    }
    built final {
        setstate gpan default
        setstate gpan2 default
    }
    death {
        setstate gpan invisible
        setstate gpan2 invisible
        wm_announce "Allies have blown the generator!!! ^1Guard Panzers Disabled!!"
    }
}

(psyco_mario) #8

k ill try that…

ONCE I GET RID OF THIS STUPID SV_SETBRUSHMODEL NULL ERROR :banghead: :bash: :banghead:

gah…
ARG!!!
is there anything wrong with my script?

gen_script
{ 
	spawn 
	{ 
		wait 200 
		constructible_class 2 
		trigger self startup 
	} 
	
	buildstart final 
	{ 
	} 

	built final 
	{ 
		setstate gen_target default
		setstate gen_materials invisible 
     		 setstate gpan visible
     		 setstate gpan2 visible
	         wm_announce "Axis have fixed the generator!!! ^1Guard Panzers Enabled!!"
	} 

	decayed final 
	{ 
		trigger self startup 
	} 

	death 
	{ 
		trigger self startup 
		setstate gen_materials default
     		 setstate gpan invisible
     		 setstate gpan2 invisible
	         wm_announce "Allies have blown the generator!!! ^1Guard Panzers Disabled!!"
	} 

	trigger startup 
	{ 
		setstate gen_target invisible
		setstate gen_materials default 
	} 
}

EDIT:
w00t! i fixed the error! but the generator should startbuilt but it doesnt appear! nor does the const mats! just the pole and the flag! :S


(S14Y3R) #9

There’s no “Visible” The opposite of invisible is default. Isn’t English Great!


(psyco_mario) #10

i know i fixed that! duh! THATS NOT MY PROBLEM!!!

i said using invisible didnt stop it didnt i! and i also said i have to use kill!

so whats the opposite to kill?


(kamikazee) #11

alertentity <targetname> should work, if it won’t do it you probably did something wrong.


(psyco_mario) #12

o.O still not working… help me find error plz!


gen_script
{ 
	spawn 
	{ 
		wait 200 
		constructible_class 3 
		trigger self startup 
	} 
	
	buildstart final 
	{ 
		setstate genrub underconstruction
	} 

	built final 
	{ 
		setstate gen_target default
		setstate gen_materials invisible 
      		setstate genrub invisible
     		       alertentity gpan
     		       alertentity gpan2
	         wm_announce "Axis have fixed the generator!!! ^1Guard Panzers Enabled!!"
	} 

	decayed final 
	{ 
		trigger self startup 
	} 

	death 
	{ 
		trigger self startup 
		setstate gen_materials default
      		setstate genrub default
     		 kill gpan
     		 kill gpan2
	         wm_announce "Allies have blown the generator!!! ^1Guard Panzers Disabled!!"
	} 

	trigger startup 
	{ 
		setstate gen_target default
		setstate gen_materials invisible 
	} 
}

everything works fine UNTIL you repair it!

When you repair you get a error saying something like cant find targetname gpan


(Loffy) #13

Hi!
How do your guard panzers work? The enemy steps into an invisible trigger zone (trigger_multiple with wait 5 sec or whatever), that triggers a target_script_trigger that triggers a script that fires the entities (the panzer shooters)?
I would use that set up myself. When game commences, the trigger zone is set default. Whenever the generator is destroyed (gen_script), the zone is set invisible.
//Loffy


(kamikazee) #14

If you set the trigger zone’s state to invisible, you could link the trigger directly to the shooters, no need to go trough the script unless you want to check for other stuff.


(psyco_mario) #15

There is Gpan which is 2 shooter_rockets targeted by a trigger_muiltiple
also there is Gpan2 which is 2 target_speakers


(kamikazee) #16

I’d get rid of the “kill” statements then. The setstate command must work in some way or another… Setting a trigger to invisible is no problem, I did it for ET Headshot2 before.


(psyco_mario) #17

k

so when you kill something you cant bring it back?
ok


(kamikazee) #18

Now I think of it: it depends on the entity type… :banghead: Alertentity just fires an “entity event”, and it’s up to the entity to react on that.
Script_movers ‘resurrect’ when killed and triggered, shooters would just try to fire a shell…


(psyco_mario) #19

o.O
gah it would be so much simpler if there was a ressurect comman :stuck_out_tongue:

V43 JAHAHA! IT WORKS!!! TYVM EVERYONE WHO HELPED!

btw… the sound doent work… but i can fix that with that stupid sound thingy :smiley:
TY TY TY TY TY TYVM ALL TY TY TY TYVM