OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: LeeHunt on 20 Dec 2007, 22:53:06

Title: How can I store a list of troops at mission start for use in formulas at end?
Post by: LeeHunt on 20 Dec 2007, 22:53:06
hi folks,

I did a search of the forums and COMREF but couldn't come up with the solution for this: I'm trying to "store" the number of troops on each side at the beginning of the mission for use in mathematical formulas later.  I know how to get the these numbers (using the brief script below) but not how to store them. So let's say there are 100 Germans at the beginning of this Eastern Front 1944 mission, and only 45 at the end.  Let's also say the starting number of Germans is randomized to make the mission more replayable etc, so next time it could be 87 Germans with only 33 survivors at the end.  How can I store this number and retrieve it?   I'd like to be able to score the player based on what percentage of Germans survived and how many in absolute terms were killed etc.  Thanks so much for your help!

I've played a trigger with OPFOR present that covers the map:

In my script I can get the number, just don't know how to store and retrieve it:

_vehListG = list trigAllGerman
German_loons = []
{{if (alive _x) then {German_loons = German_loons + [_x]}} forEach crew _x} forEach _vehListG
hint format ["Living loons are:\nGerman: %1",{alive _x} count German_loons]

Thanks!

Title: Re: How can I store a list of troops at mission start for use in formulas at end?
Post by: LCD on 20 Dec 2007, 23:37:46
kinda simple :P

all u need is a triger covering da whole area w/ da next setup

condition : germans present (either east or west or reistatnce... i donno which r they)
on activation : num_of_germans = count thislist

if u want u can delete this triger.... or if u wanna use ur script u cud have it so in da 1st time u use da next line

Code: [Select]
num_of_germans = count German_loons
think dats it ?


LCD OUT
Title: Re: How can I store a list of troops at mission start for use in formulas at end?
Post by: LeeHunt on 21 Dec 2007, 01:10:38
ahhhhhhh thanks LCD  :D that worked. 

Title: Re: How can I store a list of troops at mission start for use in formulas at end?
Post by: LCD on 21 Dec 2007, 02:20:03
:D

go register in my recruitment thread ;) :D

ill give u a good role :D  :good:

hope ill get 2 c ur mision done b4 i leave :D

LCD OUT