OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: wcrvieira on 01 Apr 2007, 15:01:14

Title: Displaying the amount of targets
Post by: wcrvieira on 01 Apr 2007, 15:01:14
Hello there!

Rellikki is doing a mission and has a question that is bugging him for a while, but as he can't login I am here to ask you lads if you can help.

Let's imagine that there are five places to clear of enemies. How do I display a hint telling how many there are left to clear everytime one place has been cleared?

Thank you lads! ;)
Title: Re: Displaying the amount of targets
Post by: Mandoble on 01 Apr 2007, 15:16:00
Place a trigger per place with desired radious (enemy presence) and continuous check. Give each trigger a name. In the "deactivation" field of each trigger put:

Code: [Select]
hint format["%1 enemies left", (count list trigger1name) + (count list trigger2name) + (count list trigger3name) + ...]
Each time one trigger is deactivated (no presence of enemies) the deactivation action will be executed.
Title: Re: Displaying the amount of targets
Post by: wcrvieira on 01 Apr 2007, 15:55:50
It works perfectly, however the triggers count the amount of enemies while he wanted it to count the amount of places (the triggers)...

Thank you anyway
Title: Re: Displaying the amount of targets
Post by: Mandoble on 01 Apr 2007, 16:30:29
Then just put num_free_places = num_free_places + 1 in the deactivation field of every trigger followed by a hint shound num_free_places.
Set num_free_places = 0 in the init.sqs
Title: Re: Displaying the amount of targets
Post by: wcrvieira on 01 Apr 2007, 21:31:11
Works like a charm mate.

Thank you a lot :good: