OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Carroll on 30 May 2007, 22:56:40

Title: SOLVED: switchMove loop script
Post by: Carroll on 30 May 2007, 22:56:40
#Update
_obj= _this select 0
_obj switchmove "AmovPercMstpSnonWnonDnon_seeWatch"
~10
:goto #Update

I have not long been editing AA, but i was wondering if someone could help me to get this little script to function as i intend it to. I simply wish to have a soldier check his watch every 10 seconds. Any help would be appreciated.

Carroll
Title: Re: switchMove loop script
Post by: DucusSumus on 30 May 2007, 23:23:12
Try playMove instead.
Title: Re: switchMove loop script
Post by: Carroll on 30 May 2007, 23:36:50
Try playMove instead.

Thanks for the advice. What is the difference between the two?
Oops, i think i just fixed my problem using;

_obj= _this select 0
#Update
_obj switchmove "AmovPercMstpSnonWnonDnon_seeWatch"
~10
goto "Update"

Though i have noticed that a soldier can't be killed while performing the "Talking" playmove, until they finish it??? and it goes for quite some time
Title: Re: switchMove loop script
Post by: johnnyboy on 30 May 2007, 23:46:32
The talking animation will never end, even if shot deat, if started via a playmove.  However, the talking animation can be ended via...

_unit switchmove "";

...if the animation was started via switchmove.  More on this, plus a tiny sample test mission illustrating the point can be found in this thread:

http://www.ofpec.com/forum/index.php?topic=29113.0
Title: Re: switchMove loop script
Post by: DucusSumus on 31 May 2007, 00:41:28
Quote
Thanks for the advice. What is the difference between the two?

playMove (http://community.bistudio.com/wiki/playMove)
switchMove (http://community.bistudio.com/wiki/switchMove)

With regard to the problem of death, Johnny pretty much nailed it. 

If you need more help, then perhaps this script that I wrote could be of assitance to you (note that it is in SQF format):

Code: [Select]
// Conversation by Dux
// Makes it appear as if two people are having conversation for about 1.5 minutes
// If someone dies, they both stop talking
// Parameters:
// Participant one
// Participant two
// Cancel condition (use "false" if you have wish to have no cancel condition apart from death)

_talkerA = _this select 0;
_talkerB = _this select 1;

_talkerA switchMove "AidlPercMstpSnonWnonDnon04";
_talkerA setBehaviour "SAFE";
_talkerB switchMove "AidlPercMstpSnonWnonDnon04";
_talkerB setBehaviour "SAFE";
sleep 1;

_talkerA switchMove "AmovPercMstpSnonWnonDnon_talking";
sleep 3;
_talkerB switchMove "AmovPercMstpSnonWnonDnon_talking";

for [{_i = 0},{_i < 350},{_i = _i + 1}] do
{
_cancel = _this select 2;
sleep .25;
if (_cancel || !(alive _talkerA) || !(alive _talkerB)) exitWith
{
_talkerA switchMove "AidlPercMstpSnonWnonDnon04";
_talkerB switchMove "AidlPercMstpSnonWnonDnon04";
}
};

if (true) exitWith {}
Title: Re: switchMove loop script
Post by: Carroll on 31 May 2007, 10:04:52
Thanks DucusSumus & johnnyboy, i will look into both replies  :good: