OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: schuler on 23 Apr 2009, 04:57:51
-
can someone fix this script so i works
h is a man hh is a vehicle
#loop
h distance hh < 30 (hh setdamage 0)
thanks
-
.oO( Never write a line of code without a spec! )
What is this script supposed to do? Wild guess: make a guy repair a vehicle as soon as it is closer than 30 meters. Open question: should this happen only once or every time the condition is met?
-
make a guy repair a vehicle as soon as it is closer than 30 meters. yes
and everytime
-
Mean as I am I used the variables guy and car instead of h and hh. To prevent the car from being invulnerable when within the distance it takes the guy five seconds to fix it. If this is not what you wanted simply remove the "~5". The script will stop running as soon as the guy is dead.
[] exec "repair.sqs"
#loop
@ ((car distance guy < 30) and (getDammage car != 0))
?! alive guy : goto "exit"
~5
car setDamage 0
goto "loop"
#exit
-
but i can change it to h and hh right?
-
Changing the variable names won't make a difference, as long as you change them all.
-
thanks James and Worldeater , i have the script like this but its not working. m1 is a man and he is in a vehicle.
HEIGHT: 0 WEIDTH: 0
ACTIVATION: West - Present
TYPE: NONE
CONDITION: this
ON ACTIVATION: [] exec "repair.sqs"
#loop
@ ((stryker distance m1 < 30) and (getDammage stryker != 0))
?! alive m1 : goto "exit"
~5
stryker setDamage 0
goto "loop"
#exit
-
I haven't checked if it also works if the guy is inside a vehicle but I'll check that later today.
You know that the script can't "resurrect" destroyed vehicles?
-
HEIGHT: 0 WEIDTH: 0
The problem is if the trigger has no size, it wont be tripped because west will never be present.
-
The problem is if the trigger has no size, it wont be tripped because west will never be present.
thanks for pointing out my blundering stupidity Sparticus :-[