Home   Help Search Login Register  

Author Topic: Noob help with animations  (Read 1215 times)

0 Members and 1 Guest are viewing this topic.

Offline fizznfire12

  • Members
  • *
Noob help with animations
« on: 26 Jan 2008, 22:02:07 »
Hey guys :) Sorry, i've looked around EVERYWHERE for a beginners tutorial for animations, but i cannot find it. All i want to do is tell an AI infantry to salute, get out binocs, have a conversation, etc. for my next video, but i can't get it working... :( I know it involves scripting, but everything i've tried has yielded no results. Can anyone help me out? Thanks!

Offline Loyalguard

  • Former Staff
  • ****
Re: Noob help with animations
« Reply #1 on: 26 Jan 2008, 22:36:11 »
fizznfire12-

playMove is one of the commands at your disposal for this.  A large list of the different animations can be found in the Biki.  Also in the link to OFPEC COMREF under playMove, there is a link to an animation viewer that will help you view/select anims to use.

For some of these (salute for example), it might also better/worth trying the action command.  A list of the different actions can alse be found in the Biki.

Good luck!


Offline fizznfire12

  • Members
  • *
Re: Noob help with animations
« Reply #2 on: 26 Jan 2008, 23:06:13 »
Thanks much for the reply- But i have no idea how to script at all... This is what i've tried before:create an SQF file with something like this:
unit switchMove move (Table code: "Usage:s") And change it to this...

unit switchMove "AmovPknlMstpSrasWpstDnon" (Table code: "Usage:p")

Then save it to the mission, spawn a rifleman, give him this in the init line: This exec animation.sqf (assuming that's the sqf file i made)
but when i start, he just stands there. I have also tried putting that in his init line, but it didn't work, as well as
unit_name switchmove "CombatToBinoc" in an sqf and his init line. Nothing seems to have worked though :( 

#Edit: Removed the unnecessary quote..
« Last Edit: 26 Jan 2008, 23:26:10 by h- »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Noob help with animations
« Reply #3 on: 26 Jan 2008, 23:22:10 »
Did you name the unit "unit" or "unit_name" ?  :D

Also; other animations don't work directly from the init field of units, you can use triggers' or waypoints' On Activation fields for them. Try this: put down a single Move waypoint in front of the unit, then write in its On Activation field:

Code: [Select]
this switchMove "AmovPknlMstpSrasWpstDnon"

(in this case, "this" always refers to the leader of the group that activated the waypoint).

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Loyalguard

  • Former Staff
  • ****
Re: Noob help with animations
« Reply #4 on: 26 Jan 2008, 23:44:58 »
Fizz-

Your close, we just need to make some adjustments. In addition to what Wolfrug said above, here is another step by step method:

1) Place your unit in the editor and in the name field name him whatever you want (we'll use unit1 for this example).

2) in unit1's init line place the following code:
Code: [Select]
nul = [] execVM "animation.sqf";
This will run the animation.sqf script when the unit is initialized.

3) In your mission folder, create a script file name animation.sqf (you probably already have done for your description above this so just change as necessary) and enter this code:
Code: [Select]
unit1 playMove "AmovPercMstpSlowWrflDnon_talking";
This script will make unit1 display a talking animation (just an example).  FYI, some animations will play continuously, others will play only once and then return to the units previous state, some animations only work with playMove, others with only switchMove.

4. Preview your mission.

If you are just starting out scripting check out the forums, FAQ, and Editors Depot some more to find examples of other scripts to get ideas on how to put scripts togther.

Also on a side note, try not to quote an entire post in your threads here.  Only quote relevant parts if necessary.

I hope this helps!
« Last Edit: 26 Jan 2008, 23:46:57 by Loyalguard »