Home   Help Search Login Register  

Author Topic: How can I store a list of troops at mission start for use in formulas at end?  (Read 1173 times)

0 Members and 1 Guest are viewing this topic.

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
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!


Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
ahhhhhhh thanks LCD  :D that worked. 


Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
: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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta