Jump to content
Sign in to follow this  

Recommended Posts

Hey could someone tell me step by step how i can let enemy units do animations?

Share this post


Link to post
Share on other sites
Hey could someone tell me step by step how i can let enemy units do animations?

The codeline is

unitname switchMove "animation name"

unitname playMove "animation name"

Get yourself the anim viewer here:

http://www.armaholic.com/page.php?id=6056

and place it once unzipped in your ArmA 2 user folder which should be located in C:Documents\Arma 2 ... bla bla

there should be a mission folder, now place the animviewer in that folder, fire up the editor select Utes and the animviewer and there you can see all the anims available in ArmA II.

You can use the switch/playMove command in trigger activation fields, I personally use them more in scripted intro 'n outros and so on. I got still problems to make them to work in waypoints activation fields. Putting that code line directly in the Units init fields should work, but I haven't tested it yet.

I wish there were still some more different anims at disposal. I hope BIS will add some with OA.

Try and search for some cam scripting tutorials which is definitely the thing to learn when you would like to use anims.

regards

nettrucker:D

edit: Just found a camscripting tutorial browsing in the next thread

http://www.vimeo.com/1545959

Edited by nettrucker

Share this post


Link to post
Share on other sites

hey thx for your message, but the codeline doesent work, if copied it into a unit but the unit doesent do anything?

soldier switchMove "NavigationDriverReverse" ;soldier playMove "NavigationDriverReverse"

thats what i got in the init line

Edited by warghost20

Share this post


Link to post
Share on other sites
thats what i got in the init line

dont use the init line or the init.sqf, it wont work. use either a trigger or call a secondary script from the init.sqf.

Share this post


Link to post
Share on other sites

what wil i have to typ into the trigger?, and what do i have to sync?

Thx!

Share this post


Link to post
Share on other sites

if you want the animations to play at once the mission starts, then use a trigger with the condition set to "Anybody Present", then in the On Act. box you write

soldier switchMove "NavigationDriverReverse" ;

EDIT: make sure your player unit is within the trigger area. On a second note you should try to find the "Mr. Murrays editing guide", thats where i learned about mission making, and animations etc.. Just search the forum for it =)

Share this post


Link to post
Share on other sites

Make sure you are using correct moves for Arma 2.

http://community.bistudio.com/wiki/ArmA2:_Moves

I wasn't able to find "NavigationDriverReverse".

dont use the init line or the init.sqf, it wont work. use either a trigger or call a secondary script from the init.sqf.

And it should work in the init line no problem, dont worry about messing with triggers for it. For example I have "this switchMove "sitUnarm_L_relaxing";" in my init on a soldier and he starts the map sitting down.

Share this post


Link to post
Share on other sites

i got it working now, i placed a trigger on the unit i want to preform an animation, and as soon as the mission starts he preforms that animation, but if i want a unit to keep doing the animation, is that possible?

Share this post


Link to post
Share on other sites

Set the triggers activation to repeatedly? Or create a script which plays the animation over and over again.

And stop bumping your threads just because you don't get any answers.

Share this post


Link to post
Share on other sites

i have set the triggers activations to repeatedly but he only does the animation 1 time, i want to use a script, what name do i have to give to the script and what do i have to typ into the script?

Thanks!

Share this post


Link to post
Share on other sites

Try this one:

_unit = _this select 0;
_animation = _this select 1;
_noWeapons = _this select 2;
_switchMove = _this select 3;

_unit allowDamage false;
_unit setDamage 0;
_unit setVariable ["BIS_noCoreConversations", true];
if (_noWeapons) then {removeAllWeapons _unit};

if (_switchMove) then {
while {true} do {
	_unit switchMove _animation;
	waitUntil {animationState _unit != _animation};
};
} else {
while {true} do {
	_unit playMove _animation;
	waitUntil {animationState _unit != _animation};
};
};

Execute it via:

nil = [pete,"animation",true,true] execVM "animationLoop.sqf";

Share this post


Link to post
Share on other sites
Try this one:
_unit = _this select 0;
_animation = _this select 1;
_noWeapons = _this select 2;
_switchMove = _this select 3;

_unit allowDamage false;
_unit setDamage 0;
_unit setVariable ["BIS_noCoreConversations", true];
if (_noWeapons) then {removeAllWeapons _unit};

if (_switchMove) then {
while {true} do {
	_unit switchMove _animation;
	waitUntil {animationState _unit != _animation};
};
} else {
while {true} do {
	_unit playMove _animation;
	waitUntil {animationState _unit != _animation};
};
};

Execute it via:

nil = [pete,"animation",true,true] execVM "animationLoop.sqf";

thank you very mutch,

1 more question,

were do i change the animation in the script? so if my animation is ''AidlPpneMstpSnonWnonDnon_SleepC_standUp'' were do i put it in the script?,

And if i want to add more scripts i just copy the whole thing?, and do i have to give the unit a name wich i put in the config?, because in the script i see no name for the soldier?

Share this post


Link to post
Share on other sites

Well, maybe i should give you a quick explanation on how to use this script.

1) Create a textfile and change it's format to .sqf and name it "animationLoop.sqf". Put the .sqf in your mission folder.

2) Copypasta the script into it.

3) Place a unit and give it a name. Let's say "jimbob".

4) Look for the animation you want.

5) And then call the script ingame in a trigger or waypoint or init field via:

nil = [jimbob,"AidlPpneMstpSnonWnonDnon_SleepC_standUp",true,true] execVM "animationLoop.sqf";

The things in the array ([x,y,z]) are the parameters for the script. The first thing is the unit that should perform the animation. The second one is the animation itself. The third one removes the units weapons. If you want the unit to have its weapons just change "true" to "false". The last parameter tells the script wether it has to use "swichmove" or "playmove". Don't worry about the last one. If it doesn't work with "true" just try "false".

Share this post


Link to post
Share on other sites

Ok so i just used your very handy script, problem that i have now, is that when the AI is in the animation on the way point, he cannot be killed? is there away around that?

Share this post


Link to post
Share on other sites

Hi, i wrote the script to create some atmosphere like in a camp or town. But i see your problem. Try this one:

_unit = _this select 0;
_animation = _this select 1;
_noWeapons = _this select 2;
_switchMove = _this select 3;

_unit setDamage 0;
_unit setVariable ["BIS_noCoreConversations", true];
if (_noWeapons) then {removeAllWeapons _unit};

if (_switchMove) then {
while {alive _unit} do {
	_unit switchMove _animation;
	waitUntil {animationState _unit != _animation};
};
} else {
while {alive _unit} do {
	_unit playMove _animation;
	waitUntil {animationState _unit != _animation};
};
};

_unit switchMove "";

Not tested, hope it works.

Share this post


Link to post
Share on other sites

Ya i just tested it out when i got the msg there, and it works perfectly the guy dies and loops the animation. thanks a ton

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×