OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 2nd Ranger on 19 Jun 2005, 16:54:28

Title: Counting living units on the enemy side
Post by: 2nd Ranger on 19 Jun 2005, 16:54:28
Hello,

I am making a mission which I want to end when the East side has only a few men left alive. I don't want to use East not present, because then you might be there for a while hunting down the last man.

Can the SideEnemy command help here? To clarify, I'd like a condition something like the following;

"alive _x" count units SideEnemy < 10

(That doesn't work, but it's basically what I'd like to happen).

Thanks for any help offered.
Title: Re:Counting living units on the enemy side
Post by: bedges on 19 Jun 2005, 17:13:15
make a trigger, covering the whole map, east present, in the 'on activation' field put

Code: [Select]
all_east = thislist
in your end trigger condition field, put

Code: [Select]
(count all_east)<10
that should work.
Title: Re:Counting living units on the enemy side
Post by: Chris Death on 19 Jun 2005, 18:30:02
Sorry bedges, but that won't work.

If you say at mission start:

all_east = thislist

then all_east will remain always the same - an array
containing all east units inside the trigger area.

I asume you were already thinking one step further when posting
this - didn't you?  ;D

Well, the start sounds good:

trigger which covers the whole area, or atleast which covers
all east units on the map.

detected by: east present /activation once
condition: this
onActivation: all_east = thislist

And for the end trigger you use:

"alive _x < 10" count all_east

~S~ CD
Title: Re:Counting living units on the enemy side
Post by: 2nd Ranger on 19 Jun 2005, 18:32:01
EDIT

Thanks, but that doesn't seem to work either;

When I put "alive _x < 10" count all_east into the end trigger condition field, I get the error

 Type number, expected bool
Title: Re:Counting living units on the enemy side
Post by: qqqqqq on 19 Jun 2005, 18:57:02
trigger east present
condition count thislist < 10



Your syntax is wrong in the example I think.   Try

"alive _x" count all_east < 10
Title: Re:Counting living units on the enemy side
Post by: bedges on 19 Jun 2005, 19:01:40
the answer. see attached ;)
Title: Re:Counting living units on the enemy side
Post by: 2nd Ranger on 19 Jun 2005, 19:09:02
Both of those work great. Thanks very much for the help folks  :)
Title: Re:Counting living units on the enemy side
Post by: Chris Death on 19 Jun 2005, 22:18:55
trigger east present
condition count thislist < 10



Your syntax is wrong in the example I think.   Try

"alive _x" count all_east < 10

Hell, that happens when i put my fingers on things i didn't work with
for a long time, without looking before into one of my old missions  ::)

thx for sorting the syntax qqqqqq  ;)

~S~ CD
Title: Re:Counting living units on the enemy side
Post by: Sui on 20 Jun 2005, 04:16:26
Can the SideEnemy command help here? To clarify, I'd like a condition something like the following;

"alive _x" count units SideEnemy < 10

(That doesn't work, but it's basically what I'd like to happen).

East countside (list Triggername) < 10

;)
Title: Re:Counting living units on the enemy side
Post by: Chris Death on 20 Jun 2005, 08:29:33
Just to let you know 2nd Ranger,

Sui's line is worth a go, as my experience told me that
this version is more safe to work for sure when it's about
multiplayer.

There was always an issue, when units where mounted onto
vehicles, or when groups (including player or players) didn't
get the information like: oh no xxx is down.

Dead groupmembers were then still counted to the group, and
triggers or other conditions didn't fire.

Of course you can say now you don't want make multiplayer
maps, but then at least you know know  :)

btw - 'lo Sui - long time no met in a post  :D

~S~ CD
Title: Re:Counting living units on the enemy side
Post by: 2nd Ranger on 20 Jun 2005, 14:44:16
The mission was indeed intended for Multiplayer, so I guess I'll give Sui's method a try then. Thanks again.
Title: Re:Counting living units on the enemy side
Post by: Sui on 21 Jun 2005, 10:47:57
Good to see you're still lurking around the place, Chris mate ;)