PK_Azlon Posted February 15, 2014 Share Posted February 15, 2014 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
Boothand Posted February 15, 2014 Share Posted February 15, 2014 What health value did you give the door? Link to comment
PK_Azlon Posted February 15, 2014 Author Share Posted February 15, 2014 @@Boothand I gave it a health of 1 Link to comment
mrwonko Posted February 15, 2014 Share Posted February 15, 2014 Give the target_scriptrunner a count of -1. PK_Azlon likes this Link to comment
PK_Azlon Posted February 15, 2014 Author Share Posted February 15, 2014 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
Boothand Posted February 15, 2014 Share Posted February 15, 2014 @@Boothand I gave it a health of 1 It only has one healthpoint, so when you shoot it, it loses all its healthpoints. If you do -1 instead, it should be usable forever. Link to comment
mrwonko Posted February 15, 2014 Share Posted February 15, 2014 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
Asgarath83 Posted February 17, 2014 Share Posted February 17, 2014 if the -1 health parameter not work, try to set the work as Undying entity booleans: set_undying , true. So the door can arrive to 1 of health, but never "die" . with NPC works. maybe work also with a door? Link to comment
Pande Posted February 18, 2014 Share Posted February 18, 2014 Afaik, Set_undying only works on NPCs and players Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now