OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: muntahunta on 27 Jul 2004, 21:55:35

Title: Units Left Counter
Post by: muntahunta on 27 Jul 2004, 21:55:35
could anyone tell me how to make a counter script that tells you how many units are left on the opposite team...

i would be extremly greatfull if you could tell me as i am going to use it on my new map, which i think will turn out pretty good

thanks
[sT]MuntaHunta
Title: Re:Units Left Counter
Post by: macguba on 27 Jul 2004, 22:43:18
I have this in my Un-Impossible Mission, currently being tested by the OFP in-crowd over on the beta testing board.    (You get it only if you take the Hill and the Base and then, in the hope of getting the Easter egg, elect to clear the island of the remaining enemy.  Its a good egg, you'll like it.)

My version has a radio trigger:-

Activation:  Radio Alpha   repeatedly
On activation:   newCount = true

Then there is another trigger

Area:  whole map
Activation Box:   West present repeatedly
Condition:    this and newCount
On Activation:  hint format ["There are %1 enemy loons remaining.", count thislist]; newCount = false

Every time you make the radio call you get a hint telling you how many enemy are left.

There is only one small problem with this:  it gives the wrong answer.    Or rather, the total reported sometimes goes up.   I'm not entirely sure why this is, but I think at least one cause is vehicles.    The vehicle is counted as one but if the crew get out they are obviously counted as two or three or whatever.    I suspect there is another problem but I can't for the life of me figure out what it is because this should work.
Title: Re:Units Left Counter
Post by: muntahunta on 27 Jul 2004, 23:31:44
thanks alot dude, shall be put to good use
Title: Re:Units Left Counter
Post by: rOk on 28 Jul 2004, 07:15:17
@ macguba

For what it's worth, vehicles are counted as one.