OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 02 Sep 2005, 21:33:04

Title: Allunits "Combat"
Post by: The-Architect on 02 Sep 2005, 21:33:04
Is there a way that I can make all units within a trigger area go to combat?

Something like this,
All units setcombatmode "combat"

or maybe,

"_x setcombatmode Combat" forEach units in trigger X's area

Title: Re:Allunits "Combat"
Post by: bedges on 02 Sep 2005, 21:52:30
almost there. trigger, activated by side present, large enough to cover anyone you need to set to combat, dependant on whatever your condition is, on activation -

Code: [Select]
{_x setcombatmode "yellow"} foreach units _this
i believe that's the correct syntax. ;)
Title: Re:Allunits "Combat"
Post by: bored_onion on 02 Sep 2005, 21:54:12
im probably wrong (or even equally correct) but maybe

Code: [Select]
foreach units in thislist
or something???
Title: Re:Allunits "Combat"
Post by: THobson on 02 Sep 2005, 21:54:20
Code: [Select]
{_x setcombatmode "yellow"} foreach units thislist
EDIT:
Bored_onion - I thought you beat me by 8 seconds.  If you had not used in then you would have ;)

EDIT2:

Should it not be:

Code: [Select]
{_x setBehaviour "COMBAT"} foreach units thislist
?

I thought CombatMode "Yellow" was 'open fire'
Title: Re:Allunits "Combat"
Post by: bored_onion on 02 Sep 2005, 21:57:48
ah shucks!!! ;D
Title: Re:Allunits "Combat"
Post by: The-Architect on 02 Sep 2005, 22:01:08
I'm getting an error message.

Type array, expected, object, group

If it helps, the units I want to go combat are all enemy AI
Title: Re:Allunits "Combat"
Post by: THobson on 02 Sep 2005, 22:03:03
Damn I was in too much of a hurry.  Get rid of the word units as in:

Code: [Select]
{_x setBehaviour "COMBAT"} foreach thislist
 :-[
Title: Re:Allunits "Combat"
Post by: bedges on 02 Sep 2005, 22:05:32
combatmode, behaviour, potato, patatto...

it's all good ;)
Title: Re:Allunits "Combat"
Post by: The-Architect on 02 Sep 2005, 22:06:01
Ok, the error message disappeared but every one of the bad guys just stayed in "Safe" mode.
Title: Re:Allunits "Combat"
Post by: THobson on 02 Sep 2005, 22:12:56
Try:

{_x setDammage 1} foreach thislist  

just to check you are picking up the right loons.

Do the loons have leaders outside the trigger area?

{(leader group _x) setBehaviour "COMBAT"} foreach thislist  

might then need to be the answer.

Quote
combatmode, behaviour, potato, patatto...
:) :)

I have to go now.  I hope the above helps