Home   Help Search Login Register  

Author Topic: animation demo problems and solutions  (Read 1478 times)

0 Members and 1 Guest are viewing this topic.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
animation demo problems and solutions
« on: 08 Jul 2004, 18:13:27 »
What's wrong with this script?    I suspect the problem is the line in bold but for the life of me I can't see what's wrong.    The animations don't play and the titletext comes up with "_anim" every time, rather than the name of the animation concerned.    The loons do animate when I put an animation in by hand.

Many thanks


; this script plays animations

_animArray = ["EffectStandSalute", "Crouch", "CrouchB", "CrouchDying",  "CrouchToCombat"]
_unitList = [loon1, loon2]
_i=0

#loop

_anim=_animArray select _i

titletext [format ["%1", {_anim}],"plain down",1]

"_x switchMove {_anim}" forEach _unitList
"_x playMove {_anim}" forEach _unitList

~4

"_x playMove {null}" forEach _unitList
"_x switchMove {null}" forEach _unitList

_i=_i+1

? _i >= (count _animArray) + 1: goto "end"

goto "loop"

#end
hint "That's all folks"
~3
exit
« Last Edit: 08 Jul 2004, 22:48:37 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:can't see wood for trees
« Reply #1 on: 08 Jul 2004, 18:51:24 »
Hey mac,

Try
titletext [format ["%1", _anim],"plain down",1]
instead of
titletext [format ["%1", {_anim}],"plain down",1]

and

Try
"_x switchMove _anim" forEach _unitList
instead of
"_x switchMove {_anim}" forEach _unitList
and
"_x playMove _anim" forEach _unitList
instead of
"_x playMove {_anim}" forEach _unitList
Not all is lost.

Offline Blanco

  • Former Staff
  • ****
Re:can't see wood for trees
« Reply #2 on: 08 Jul 2004, 19:15:54 »
I tried something similar (but I did it with randomly choosen  anims from the _animlist) and I've noticed that you have to run such a script in a waypoint. Maybe that's the problem.

« Last Edit: 08 Jul 2004, 19:16:39 by Blanco »
Search or search or search before you ask.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:can't see wood for trees
« Reply #3 on: 08 Jul 2004, 19:32:57 »
Ah, of course, thanks Artak.  I had of course tried that earlier, but that was when there were no quotes in the original array ..... duh.

Blanco, I'm running if from a trigger and it seems to be working .... not quite finished yet though.
Plenty of reviewed ArmA missions for you to play

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:can't see wood for trees
« Reply #4 on: 08 Jul 2004, 21:47:34 »
Would I be right in thinking that there is a maximum number of elements allowed in an array?   If so, what is it?

This wretched script works sometimes, and sometimes it doesn't.    I can't find the error and I suspect it may just be because the array is too big.   Thoughts?

I can't see the error message because it refers to the array, which has a whole bunch more animations than in the example above and is consequently far too long.    Is there an error log or something somewhere where you can see a long error message?
Plenty of reviewed ArmA missions for you to play

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:can't see wood for trees
« Reply #5 on: 08 Jul 2004, 22:47:50 »
Well I've split it into two arrays and made it work.     Finished version on the beta forum:   yes folks this is what you've all been waiting for, a wee demo mission that shows all official animations.    (Except vehicle crew ones.)
« Last Edit: 08 Jul 2004, 22:48:20 by macguba »
Plenty of reviewed ArmA missions for you to play

Dubieman

  • Guest
Re:animation demo problems and solutions
« Reply #6 on: 09 Jul 2004, 00:30:57 »
So is this a script now or a mission or just a mission showcasing all the animations?

Like my topic below this one, I wanted to make my guards more interesting by having them look like they are talking and looking around.

And if it is a script, can I change it to fit a certain slew of animations? Like I don't want my guard to be doing some dismay moves which look pretty odd. :P

Sorry for 20 Q's but your script if it is one makes mine obsolete and possibly make my mission better.  :)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:animation demo problems and solutions
« Reply #7 on: 09 Jul 2004, 01:20:32 »
It's a demo mission just showcasing the anims - follow the link in my last post to the beta testing board.    The mission obviously uses the script, if you'd like to unpbo the final version and adapt it for your own mission that's fine with me as long as you mention where you got it from.
Plenty of reviewed ArmA missions for you to play

Dubieman

  • Guest
Re:animation demo problems and solutions
« Reply #8 on: 09 Jul 2004, 01:42:49 »
Okay. I dunno if I can use it though. You already replied to my post, but you know I can't have the guards doing animation while the player is sneaking around. I'm using your animation list and I'll use your mission to get a good hold of what the animations look like. And you'll get creditted. ;)