OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Dagon on 06 Sep 2005, 12:21:09

Title: Help w/ switchmove
Post by: Dagon on 06 Sep 2005, 12:21:09
I'm trying to make certain loons play dead with the

"This SwitchMove "CombatDeadVer3""

string. Yet they refuse to play dead, and no other 'dead' animations (nor medic animations which I need too - they're playing dead and being healed by medics) seem to work.

Any help?
Title: Re:Help w/ switchmove
Post by: Fragorl on 06 Sep 2005, 12:35:14
Sometimes commands that are run as soon as the game starts (ie in the init fields of a unit) don't work - they need a short delay - and switchmove seems to be one of them. you have a couple of options.-

1.) name the units you want to start off injured. Make a trigger, and change it's Activation field from 'this' to 'true', select the 'countdown' option, and in the min, mid and max boxes, put a small delay, such as 0.2. Then in the activation field, put this:
{_x switchmove "CombatDeadVer3"} foreach [unit1, unit2, unit3]
where unit1 and so on are the names you gave the units.

2.) create a new script.
;Animate.sqs
~0.2
(_this select 0) switchmove "CombatDeadVer3"
In each unit you want to start off dead, put the following: [this] exec "animate.sqs"

Apologies if you know all the coding stuff already. Just covering my bases in case you didn't ;)
Title: Re:Help w/ switchmove
Post by: nominesine on 06 Sep 2005, 12:56:15
you have a couple of options.... create a new script.
;Animate.sqs
~0.2
(_this select 0) switchmove "CombatDeadVer3"

Or even easier, write:
Code: [Select]
~0.01
{_x switchmove "CombatDeadVer3"} foreach [unit1, unit2, unit3]
in the init.sqs