OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Chunky heffer on 27 Sep 2005, 22:34:55

Title: Ticking Off multiple units in Briefing
Post by: Chunky heffer on 27 Sep 2005, 22:34:55
Sorry if repost but I searched for an hour.

Anway please could you tell me how to tick off a convoy for instance in the briefing.

i have set up a trigger and its dimensions are 0 and 0.  

Condition = NOT ALIVE T1;NOT ALIVE T2;NOT ALIVE T3
On Activation = "3" objstatus "DONE"

This above does not work. I get (Type Bool, expected nothing)

but if I put one unit in the Condition field it does work. e.g
Condition = NOT ALIVE t1.

it works.

Help me, please.  I am slowly going bald
Title: Re:Ticking Off multiple units in Briefing
Post by: macguba on 27 Sep 2005, 22:43:51
(not alive t1) and (not alive t2) etc

You can use 'or' instead of 'and' in appropriate circumstances.   Semicolons in the Condition line are meaningless which is why you are getting the error.

Oh, and

Welcome to the forum!

Well done for searching so hard ... that's a very difficult one to find.

If T1 and the rest are vehicles rather than soldiers, I'd recommend not using the alive command.  It can be unreliable with vehicles: the vehicle looks destroyed but hasn't registered as not alive.   Use not canMove (and/or canFire if appropriate) instead.
Title: Re:Ticking Off multiple units in Briefing
Post by: Chunky heffer on 27 Sep 2005, 22:58:22
Wow thank you for quick response.  Thanks for welcoming me.
Title: Re:Ticking Off multiple units in Briefing
Post by: Triggerhappy on 28 Sep 2005, 01:44:24
you could also do this:
"alive _x" count [T1,T2,T3,etc] = 0
or for vehicles:
"canmove _x" count [T1,T2,T3,etc] = 0

slightly less typing
Title: Re:Ticking Off multiple units in Briefing
Post by: bedges on 28 Sep 2005, 09:24:08
if that's for a conditional field it should be

Code: [Select]
? (("alive _x" count [T1,T2,T3,etc]) == 0)
or for vehicles:

Code: [Select]
? (("canmove _x" count [T1,T2,T3,etc]) == 0)
i find the brackets help keep the logic neatly packaged.
Title: Re:Ticking Off multiple units in Briefing
Post by: macguba on 28 Sep 2005, 09:56:13
Triggerhappy's otherwise excellent answer has one small mistake:  the = should be ==.

Also, I never use == when it can be avoided.  I don't trust either the game or the computer not to make a mistake.    I'd use <0.4 instead of ==0.

If its for the condition field of a trigger you don't need the ? at the start.  
Title: Re:Ticking Off multiple units in Briefing
Post by: The-Architect on 28 Sep 2005, 12:40:13
Don't confuse him. Macca your first answer should do fine. He can always come back for more advanced info later on.  ;)
Title: Re:Ticking Off multiple units in Briefing
Post by: 456820 on 28 Sep 2005, 13:02:48
also gto save using a few words you can use
!alive t1 and !alive t2 and !alive t3

basically the ! acts as a not or isnt its the same as Mac's idea but using a tiny bit of text but i dont think it matters much
Title: Re:Ticking Off multiple units in Briefing
Post by: Triggerhappy on 28 Sep 2005, 22:25:51
Triggerhappy's otherwise excellent answer has one small mistake:  the = should be ==

if its not 1 small error its another....

mac is a good spell-checker ;D :P