OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 29 Apr 2006, 09:38:20

Title: Are we allowed to post here yet?/Check hold fire
Post by: The-Architect on 29 Apr 2006, 09:38:20
Are we allowed to ask questions again?

If so I'd like to know how to check if a unit (AI) has been told to hold fire.
Title: Re: Are we allowed to post here yet?/Check hold fire
Post by: bedges on 29 Apr 2006, 09:57:19
dunno, really. the boards aren't public yet so we won't really be answering questions until they are.

however, i believe the answer is

Code: [Select]
combatMode unit_name
which will return "BLUE" (Never fire), "GREEN" (Hold fire - defend only), "WHITE" (Hold fire, engage at will), "YELLOW" (Fire at will), or "RED" (Fire at will, engage at will).

dunno if that works with explicit "hold fire" instructions, but a quick experiment will tell you.
Title: Re: Are we allowed to post here yet?/Check hold fire
Post by: Artak on 29 Apr 2006, 16:33:43
The command you can give to your squad as the leader results in the same as
unit setcombatmode "blue"
Title: Re: Are we allowed to post here yet?/Check hold fire
Post by: The-Architect on 30 Apr 2006, 01:13:46
I have this guy, a member of my squad. When my squad identifies all of an enemy AI squad he fires a flare.
Only trouble is that with the script I'm running, he fires even when he's told to hold fire. I want to add a bit into the script that detects whether or not he's been told to hold fire, and if he has, to loop until otherwise.
Title: Re: Are we allowed to post here yet?/Check hold fire
Post by: Tyger on 30 Apr 2006, 04:04:01
so....

Code: [Select]
.... other code here...
if !(combatMode _unit == "RED") then {goto "WaitLoop"}

.... more code....

#WaitLoop
~1
if (combatMode _unit == "RED") then {goto "MainLoop"}
goto "WaitLoop"

.... code here...
Title: Re: Are we allowed to post here yet?/Check hold fire
Post by: The-Architect on 30 Apr 2006, 23:29:53
He still fires the flare. He's retarded.  :-[
Title: Re: Are we allowed to post here yet?/Check hold fire
Post by: bedges on 01 May 2006, 00:05:52
my only other suggestion would be a workaround whereby you set up a loop which checks if the loon's combatmode is white, green or blue, and if so remove flares. then jump to another loop which waits until the loon's combatmode is yellow or red and give them back for him to play with, so long as he promises to tidy them up when he's finished. then jump back to the first loop.