Home   Help Search Login Register  

Author Topic: build up of Queued animations  (Read 1617 times)

0 Members and 2 Guests are viewing this topic.

Offline ZapBrannigan

  • Members
  • *
build up of Queued animations
« on: 01 Oct 2011, 17:54:35 »
Hello,
I have a scene where i need to loop the sprinting animation every .3 seconds.  it needs to be every .3 seconds for what im doing to work.  The problem is that the running animation takes longer than .3 seconds to complete.  So as the scene is progressing im accumulating a lot of queued sprinting animations. and when the scene is finished and i want him to stop. He keeps playing the animation a few hundred times before he finally stops.   How can i cancel all the queued animations or otherwise make him stop.

thanks 

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: build up of Queued animations
« Reply #1 on: 01 Oct 2011, 21:06:54 »
loon switchmove ""

Offline ZapBrannigan

  • Members
  • *
Re: build up of Queued animations
« Reply #2 on: 02 Oct 2011, 04:03:50 »
I tried it, it doesn't work :/

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: build up of Queued animations
« Reply #3 on: 02 Oct 2011, 12:04:16 »
The alternative would be to have the sprinting animation controlled by a separate script which doesn't loop every .3 seconds but loops for the length of the sprinting animation. You control when the running animation script stops by setting a global variable.

Or you could deletevehicle the running guy and recreate him with all the properties of the old version, except standing still.

Offline ZapBrannigan

  • Members
  • *
Re: build up of Queued animations
« Reply #4 on: 02 Oct 2011, 13:03:01 »
oh perfect both of those work. Nice work bedges.

thanks

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: build up of Queued animations
« Reply #5 on: 12 Oct 2011, 19:47:19 »
Hi zap,

Could you post an example of your working anim loop please?  Thanks.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline ZapBrannigan

  • Members
  • *
Re: build up of Queued animations
« Reply #6 on: 13 Oct 2011, 02:14:08 »
Code: [Select]
_unit = _this select 0
_tgt = _this select 1
#loop
? (_unit distance _tgt)<5: exit


? (((GetPos _Tgt select 1) - (GetPos _Unit select 1)) > 0): _Ang = ATan (((GetPos _Tgt select 0) - (GetPos _Unit select 0)) / ((GetPos _Tgt select 1) - (GetPos _Unit select 1)))
? (((GetPos _Tgt select 1) - (GetPos _Unit select 1)) < 0): _Ang = ATan (((GetPos _Tgt select 0) - (GetPos _Unit select 0)) / ((GetPos _Tgt select 1) - (GetPos _Unit select 1))) + 180
? _Ang < 0: _Ang = _Ang + 360

_unit setdir _ang
_unit playmove "AmovPercMevaSrasWrflDf"

~.5
goto "loop"

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: build up of Queued animations
« Reply #7 on: 13 Oct 2011, 02:40:30 »
Thanks Zap.  I've been thinking about such a script to get a unit to move to a precise location.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...