Home   Help Search Login Register  

Author Topic: switchmove repeat  (Read 607 times)

0 Members and 1 Guest are viewing this topic.

bootneckofficer

  • Guest
switchmove repeat
« on: 02 May 2005, 22:43:28 »
how do i get a bloke to repeat a switchmove action in a building until he hears an enemy behind him?

bootneckofficer

Offline Blanco

  • Former Staff
  • ****
Re:switchmove repeat
« Reply #1 on: 03 May 2005, 00:25:26 »
Put the unt in safe behaviour, run a script with loop to repeat the animations and check his behaviour. When it changes to combat or aware stop the loop.  

Quick try & not tested:

Code: [Select]
_unit = _this select 0
_animtime = <duration the animation>

#start
_i = 0
#animloop
?behaviour _unit != SAFE : goto "end"
_unit switchmove "blablabla"
~1
_i = _i + 1
_i < _animtime : goto "start"

 #end
; to make sure he draws his weapon
_unit setbehaviour "AWARE"
_unit action ["WEAPONINHAND"]
exit
« Last Edit: 03 May 2005, 00:26:12 by Blanco »
Search or search or search before you ask.

MOC_XIII

  • Guest
Re:switchmove repeat
« Reply #2 on: 05 May 2005, 21:21:41 »
Or use UnPBO and in the config, where it says "looped" put 1.
Quote
class DAANIM: Combat
      {
      file="\ANIMS\DAANIM.rtm";
      speed=-0.4;
      looped=1;
      equivalentTo="Combat";
interpolateTo[]={"CombatDying",0.100000,"CombatDyingVer2",0.100000,"CombatDyingVer3",0.100000};
the use makepbo and put it back into a PBO file.
Now it is looped. ;D

Offline Blanco

  • Former Staff
  • ****
Re:switchmove repeat
« Reply #3 on: 05 May 2005, 23:02:56 »
Pretty drastic solution, no?
and not MP compatible...

Search or search or search before you ask.

Kyle Sarnik

  • Guest
Re:switchmove repeat
« Reply #4 on: 07 May 2005, 19:42:58 »
Blanco, your solution is sound, in theory, however I noticed that when an AI (or any unit) is put in to safe mode, and sees an enemy and takes their weapon off their back, the game still recognizes them to be in safe mode, and they will put their weapons back on their backs when everything is all clear. Maybe you should use knowsabout or a detected by trigger...

Offline 999chris

  • Members
  • *
  • I'm a llama!
Re:switchmove repeat
« Reply #5 on: 10 May 2005, 18:10:58 »
What you want to do is...

create a script file? "anim.sqs" e.g.

Put this in...

Code: [Select]
fin=false
#Loop
UnitName switchmove "ANIMATION"
~TIME
?fin: goto "End"
goto "loop"
#End
UnitName switchmove "Stand"
exit

Ok, replace UnitName with the name of the Unit, ANIMATION replae with the animation name... then TIME... You'll have to tes this but change the amount of time the animation takes until it ends...

Execute the script whenever you want your loon to animate [] exec "anim.sqs" and then when you want him to stop... fin=true...

Rock on, good luck.