Home   Help Search Login Register  

Author Topic: Stuck Animation  (Read 995 times)

0 Members and 1 Guest are viewing this topic.

Offline terran4999

  • Members
  • *
Stuck Animation
« 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

Offline Gcfungus

  • Members
  • *
Re: Stuck Animation
« Reply #1 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
« Last Edit: 26 Apr 2008, 09:04:27 by Gcfungus »
The object of war is not to die for your country, but to make the other bastard die for his.
~George Patton

Offline terran4999

  • Members
  • *
Re: Stuck Animation
« Reply #2 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:
« Last Edit: 26 Apr 2008, 10:45:02 by terran4999 »

Offline Gcfungus

  • Members
  • *
Re: Stuck Animation
« Reply #3 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.
The object of war is not to die for your country, but to make the other bastard die for his.
~George Patton