OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ace Productions on 04 May 2004, 07:26:04

Title: @commited...
Post by: Ace Productions on 04 May 2004, 07:26:04
Hi everybody,

I've seen in several scripts the use of the command @commited etc

Can someone please advice me how this command is used? Let's say I order a unit via a script to DoMove GetPos Spot and I want the unit to do an action when he reaches Spot how can I apply the @ command?
Title: Re:@commited...
Post by: Artak on 04 May 2004, 08:33:57
I don't know any commited command unless it's the camcommitted command you're talking about. camcommitted checks if a camera has finished committing.. like moving ect.

If you want to know in general how the @ function works I can tell you that it waits for a boolean value true to continue and while waiting it checks it's condition on every frame.
The answer to your example there would be to use the following

@unitready unit1
or
@unit1 distance place1 < 30
Title: Re:@commited...
Post by: h- on 04 May 2004, 08:34:38
...
_unit doMove _pos
@unitReady _unit
_unit  doMove _pos2
...

@ checks wether the condition is met in every frame (or did I remember correctly?) so it can be a CPU stresser...

EDIT:
Argh, Artak beat me to it  ;D
Well, repetition has never harmed anyone...  ::)
Title: Re:@commited...
Post by: Ace Productions on 04 May 2004, 08:41:45
Thank you both guys for your replies.