unitReady: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>") |
Lou Montana (talk | contribs) m (Text replacement - ">Posted on November ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-11-$1") |
||
(15 intermediate revisions by the same user not shown) | |||
Line 40: | Line 40: | ||
<dt><dt> | <dt><dt> | ||
<dd class="notedate">Posted on | <dd class="notedate">Posted on 2010-08-26</dd> | ||
<dt class="note">[[User:Rübe|Rübe]]</dt> | <dt class="note">[[User:Rübe|Rübe]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
Line 46: | Line 46: | ||
Why this is important? I'll give you an example: if you're using [[unitReady]] as a condition inside one of your fsm to advance whatever the fsm/group is doing, you really might wanna check that this unit is actually still alive. Otherwise you might end up with really fast and nasty loops in your fsm, eventually accompanied by a stream of radio commands that will last until finally a living leader is in command again.. and that could take a while... nasty, I tell you :) | Why this is important? I'll give you an example: if you're using [[unitReady]] as a condition inside one of your fsm to advance whatever the fsm/group is doing, you really might wanna check that this unit is actually still alive. Otherwise you might end up with really fast and nasty loops in your fsm, eventually accompanied by a stream of radio commands that will last until finally a living leader is in command again.. and that could take a while... nasty, I tell you :) | ||
<dt><dt> | <dt><dt> | ||
<dd class="notedate">Posted on | <dd class="notedate">Posted on 2011-01-17</dd> | ||
<dt class="note">[[User:Rübe|Rübe]]</dt> | <dt class="note">[[User:Rübe|Rübe]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
Line 54: | Line 54: | ||
In consequence you can't just send vehicles around and check if they've arrived with something like: | In consequence you can't just send vehicles around and check if they've arrived with something like: | ||
< | <sqf>waitUntil { unitReady driver _vehicle }; // don't do this!</sqf> | ||
Because it is ''not guaranteed that the driver is in command of the vehicle'' and only that unit will have its unitReady status affected.<br> | Because it is ''not guaranteed that the driver is in command of the vehicle'' and only that unit will have its unitReady status affected.<br> | ||
So in conclusion, '''if you need to check if a vehicle is ready''', try something like this: | So in conclusion, '''if you need to check if a vehicle is ready''', try something like this: | ||
< | <sqf> | ||
_vehicleReady = { | |||
private ["_veh", "_ready"]; | private ["_veh", "_ready"]; | ||
_veh = | _veh = _this; | ||
_ready = true; | _ready = true; | ||
{ | { | ||
if (not isNull _x) then | |||
{ | { | ||
_ready = _ready && ( | _ready = _ready && (unitReady _x); | ||
}; | }; | ||
} | } forEach [ | ||
commander _veh, | |||
gunner _veh, | |||
driver _veh | |||
]; | ]; | ||
_ready | _ready | ||
};</ | }; | ||
</sqf> | |||
<dt><dt> | <dt><dt> | ||
<dd class="notedate">Posted on | <dd class="notedate">Posted on 2015-11-21 - 22:40 (UTC)</dd> | ||
<dt class="note">[[User:Kastenbier|Kastenbier]]</dt> | <dt class="note">[[User:Kastenbier|Kastenbier]]</dt> | ||
<dd class="note"> | <dd class="note"> |
Latest revision as of 23:13, 13 May 2023
Description
- Description:
- Check if the unit is ready. Unit is busy when it is given some command like move, until the command is finished.
- Groups:
- Unit Control
Syntax
Examples
- Example 1:
Additional Information
- See also:
- move
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on 2010-08-26
- Rübe
-
Keep in mind that a) dead units are unitReady and b) that it takes a while until it get's known to group members that a unit is not alive anymore, which leads to c) the current leader of a group might be actually dead (until another group member takes command).
Why this is important? I'll give you an example: if you're using unitReady as a condition inside one of your fsm to advance whatever the fsm/group is doing, you really might wanna check that this unit is actually still alive. Otherwise you might end up with really fast and nasty loops in your fsm, eventually accompanied by a stream of radio commands that will last until finally a living leader is in command again.. and that could take a while... nasty, I tell you :) - Posted on 2011-01-17
- Rübe
-
Regarding vehicles, there is only one single unit (from the vehicle crew) whose unitReady-status is affected by giving that vehicle (or that unit) commands.
While it is the driver unit for a truck, it is the gunner unit for a mg-jeep or the commander for a tank. Generally it is always the unit "in control" of the vehicle.
(because it is only that unit, that is seen as "full unit" to the "outside world". Only he can be adressed with commands.)
In consequence you can't just send vehicles around and check if they've arrived with something like: Because it is not guaranteed that the driver is in command of the vehicle and only that unit will have its unitReady status affected.
So in conclusion, if you need to check if a vehicle is ready, try something like this: - Posted on 2015-11-21 - 22:40 (UTC)
- Kastenbier
-
To check readiness of a vehicle, don't check its crew, driver, gunner, commander, etc., but the vehicle itself, e.g.:
Only tested 11/21/2015 by me with A2 1.63.131129 and A3 1.52.132676 but possibly true since 1964. :PunitReady _yourVehicle;
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Unit Control