Jump to content

Flip Up Target


Recommended Posts

Ok so i have scripted a shooting target that flips up when hit. I am using a func_door (with the lip set to the same size as the entity to keep it from moving) that targets my target_scriptrunner (with count set to -1). I'm using this script.

//Generated by BehavEd

rem ( "comment" );

affect ( "target", /*@AFFECT_TYPE*/ FLUSH )
{
	rotate ( < 0.000 0.000 90.000 >, 50.000 );
}

wait ( 4000.000 );

affect ( "target", /*@AFFECT_TYPE*/ FLUSH )
{
	rotate ( < 0.000 0.000 0.000 >, 50.000 );
}

When I test it out it works fine...the first time. However once it flips back down, subsequent hits on the target have no effect. I rigged up a trigger multiple to test that it is not the script at fault and every time I press use, the target flips up as intended. The problem seems to be the func_door only fires its target once after being "shot open"

 

Link to comment

I did. As I explained above, I set up a trigger_multiple to test that the script itself was working and it works just fine. I can flip it up as much as I want with the use button. The problem is with the target entity itself. For some reason when activating the script by shooting the target, it only works once. The scriptrunner is set to count -1 so that's not it. I have used the shoot-to-open effect on regular targets and they work every time so for some reason when the func_door fires it's target after being shot, it effectively "dies" and won't fire the target anymore. 

Link to comment

Sorry, I missed the part about you already having the count, that's my most common problem with script executing only once.

 

A similar question that used to pop up was respawning func_breakables. The workaround there was to use func_usable with health and turning it back on after a while, which would reset its health. I'm not sure if using always_on yields the same behavior wrt health. I could test it but I don't really have time right now.

therfiles likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...