Home   Help Search Login Register  

Author Topic: SOLVED: switchMove loop script  (Read 1833 times)

0 Members and 1 Guest are viewing this topic.

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
SOLVED: switchMove loop script
« 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
« Last Edit: 29 Jul 2007, 13:45:47 by Carroll »

Offline DucusSumus

  • Members
  • *
  • I'm a llama!
Re: switchMove loop script
« Reply #1 on: 30 May 2007, 23:23:12 »
Try playMove instead.

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: switchMove loop script
« Reply #2 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

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: switchMove loop script
« Reply #3 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
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline DucusSumus

  • Members
  • *
  • I'm a llama!
Re: switchMove loop script
« Reply #4 on: 31 May 2007, 00:41:28 »
Quote
Thanks for the advice. What is the difference between the two?

playMove
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 {}
« Last Edit: 31 May 2007, 00:46:14 by DucusSumus »

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: switchMove loop script
« Reply #5 on: 31 May 2007, 10:04:52 »
Thanks DucusSumus & johnnyboy, i will look into both replies  :good: