OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Drozdov on 22 Aug 2003, 14:19:13
-
Is there any way to loop an action using the playmove command? I want to loop one of the talking effect actions. I'd rather not have to write a script since I don't know how.
Also, is there any way to keep a person sitting, apart form using the switchmove "FXstandsitdownstill" which obviously has its drawbacks. All the other ways of commanding someone to sit allow them to stand up again a few seconds later. And hey, even soldiers need to rest sometimes.
-
What I tried and it works is a 3 line script that can go in a trigger or in th init:
#repeat
unitname SwitchMove "EffectStandTalk"
GoTo repeat
Problem is the unit will do continuously until the mission ends or you plant a bullet in his head! :)
-
Thanks, that's all I was looking for. It's only really for atmosphere (I was going to use it for civvys in towns) so it doesn't matter if it goes on for ever. Although there should be a way to specify the number of loops it does...
Edit: The Exit command might stop the script. That'd halt the chatterbox ::).
-
Three minor details:
A loop must always have a time delay like this:
~1
The label must be in quotes.
goto "repeat"
And a good loop always includes a conditional line, so that you can escape. For example,
? stopLoop: exit
If you want to do it with a counter your loop will look like this
_counter=0
#repeat
_counter=_counter+1
? _counter > 12: goto "end"
~1
loon1 SwitchMove "EffectStandTalk"
goto "repeat"
#end
loon1 SwitchMove "null"
exit
-
Thanks macguba. That should do it. Now about the sitting down thing... ;)