OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: terran4999 on 26 Apr 2008, 02:48:12

Title: Stuck Animation
Post by: terran4999 on 26 Apr 2008, 02:48:12
Hello

I been trying to make this script so that the unit doing the repeating push up would stop once enemy is spotted, but the unit executing the script would be stuck in the push up animation even when enemy is nearby. Any ideas?

Code: [Select]
_obj = _this select 0

 

; Make the unit do a push up

;In qoutes put soldier action

#repeat
~3

_obj playMove "FXStandDip"
? Alert1 : goto "Alert"

goto "repeat"

#Alert

_obj switchmove "null"

_obj setbehaviour "combat"
_obj setspeedmode "normal"
_obj setcombatmode "red"


goto "end"

#end
exit
Title: Re: Stuck Animation
Post by: Gcfungus on 26 Apr 2008, 08:57:54
First off, you might want to try removing
Code: [Select]
_obj switchmove "null", as I'm not sure this actually does anything.
Also try playing with the playmove/switchmove

However, I think your problem might be in the alert itself. Try changing how it is activated by something which you can guarantee, eg. put a trigger that detects when you walk in to it.

Alternitavly, I made this script a week of so ago, so you could use it.

Code: [Select]
_person = _this select 0
#loop
_person SwitchMove "FXStandDip"
~3
?(Alert1): goto "alert"
goto "loop"
#alert
_person SwitchMove "FXStandFromDip"
_person setbehaviour "combat"
_person setspeed "normal"
_person setcombatmode "red"

-=GC=-Fungus1999
Title: Re: Stuck Animation
Post by: terran4999 on 26 Apr 2008, 10:43:24
So, i put a Resistence detected by West trigger with Activation
Code: [Select]
alert1=true . This trigger got the units doing push up to stop for a couple of seconds and then went back to doing push ups. The units with the switchmove command were able to cancel there switchmove but is stuck standing up with weapon in hand totally unaware of enemy presence. Is there any way to add "hunt for enemy" in the script so AI can go around looking for enemys????

 :scratch: :scratch: :scratch:
Title: Re: Stuck Animation
Post by: Gcfungus on 26 Apr 2008, 10:46:20
Surely you could just do that using a seek and destroy waypoint or something similar. Just give him that as the first WP, then he will exec the script, and when he gets up he will seek and destroy. You may need to paly around with this however.