Home   Help Search Login Register  

Author Topic: Total mision casualties  (Read 502 times)

0 Members and 1 Guest are viewing this topic.

Polipel

  • Guest
Total mision casualties
« on: 21 Mar 2004, 22:06:27 »
    I have made diferent scripts that present statistics about the damage of all the troops in a mission... men alive, wounded and died... Is usefull not only for the information about final results, also is usefull to see the mission evolution and to calibrate de dificult. Also you can use this scripts to change the men behaviour when their side have many casualties.

    the scripts are called by radio, by the action menu... or at the mission end.

    I write scripts, in plural, because i'm not able making a general script that works in every mission.

    Can anyone help me?

    Thanks

Offline rhysduk

  • Former Staff
  • ****
Re:Total mision casualties
« Reply #1 on: 23 Mar 2004, 17:39:16 »
I think you need to do something along ht elines of this..

1.) Name all the units you want to calulate thier condition (dead, alive etc)

2.) Make a big trigger covering mission area.

3.) Use somtihng along the lines of {[_x] exec "your script.sqs"} foreach thislist

Im not even 40% sure on this, but i figured that a little help is better than no help at all :)

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Polipel

  • Guest
Re:Total mision casualties
« Reply #2 on: 24 Mar 2004, 00:21:13 »
Thx Rhysduk  :)

I have been trying things like those but without success...

Example:

- A big trigger activated by east with this on activation: eastlist = list TriggerName
- Other big trigger activated by west with this on activation: westlist = list TriggerName
- Other for Resistance
- Another for civilian

- This in init field of my unit to exec the script when i want: casualties=UnitName addaction ["casualties","Casualties.sqs"]

- The script Casualties.sqs:

liveeast=0
woundedeast=0
badwoundedeast=0
deadeast=0
livewest=0
woundedwest=0
badwoundedwest=0
deadwest=0
livecivil=0
woundedcivil=0
badwoundedcivil=0
deadcivil=0
liveresistencia=0
woundedresistencia=0
badwoundedresistencia=0
deadresistencia=0


#easta

?(count eastlist)==0:goto "westa"

_i=0

#easti

?(getdammage (eastlist select _i))==0:liveeast=liveeast+1
?(getdammage (eastlist select _i))<0.5 and (getdammage (eastlist select _i))>0:woundedeast=woundedeast+1
?(getdammage (eastlist select _i))>=0.5 and (getdammage (eastlist select _i))<1:badwoundedeast=badwoundedeast+1
?(getdammage (eastlist select _i))==1:deadeast=deadeast+1
_i=_i+1
?(count eastlist)==_i:goto "westa"
goto "easti"


#westa

?(count westlist)==0:goto "Resistencia"

_i=0

#westi

?(getdammage (westlist select _i))==0:livewest=livewest+1
?(getdammage (westlist select _i))<0.5 and (getdammage (westlist select _i))>0:woundedwest=woundedwest+1
?(getdammage (westlist select _i))>=0.5 and (getdammage (westlist select _i))<1:badwoundedwest=badwoundedwest+1
?(getdammage (westlist select _i))==1:deadwest=deadwest+1
?(count westlist)==_i:goto "Resistencia"
_i=_i+1
goto "westi"


#Resistencia

?(count resistencialist)==0:goto "civila"

_i=0

#resistenciai

?(getdammage (resistencialist select _i))==0:liveresistencia=liveresistencia+1
?(getdammage (resistencialist select _i))<0.5 and (getdammage (resistencialist select _i))>0:woundedresistencia=woundedresistencia+1
?(getdammage (resistencialist select _i))>=0.5 and (getdammage (resistencialist select _i))<1:badwoundedresistencia=badwoundedresistencia+1
?(getdammage (resistencialist select _i))==1:deadresistencia=deadresistencia+1
_i=_i+1
?(count resistencialist)==_i:goto "civila"
goto "resistenciai"


#civila

?(count civillist)==0:goto "Presentacion"

_i=0

#civili

?(getdammage (civillist select _i))==0:livecivil=livecivil+1
?(getdammage (civillist select _i))<0.5 and (getdammage (civillist select _i))>0:woundedcivil=woundedcivil+1
?(getdammage (civillist select _i))>=0.5 and (getdammage (civillist select _i))<1:badwoundedcivil=badwoundedcivil+1
?(getdammage (civillist select _i))==1:deadcivil=deadcivil+1
_i=_i+1
?(count civillist )==_i:goto "Presentacion"
goto "civili"


#Presentacion
titletext [format["              East - West - Resistencia - Civiles\nIlesos:       %1   -   %2   -   %3   -   %4\nHeridos:       %5   -   %6   -   %7   -   %8\nIncapacitados: %9   -   %10   -   %11   -   %12\nMuertos:       %13   -   %14   -   %15   -   %16",liveeast,livewest,liveresistencia,livecivil,woundedeast,woundedwest,woundedresistencia,woundedcivil,badwoundedeast,badwoundedwest,badwoundedresistencia,badwoundedcivil,deadeast,deadwest,deadresistencia,deadcivil],"plain down"]

exit

¡BUT IT WONT WORK!
 >:(

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Total mision casualties
« Reply #3 on: 24 Mar 2004, 00:53:20 »
I haven't checked through your whole script, but just part of it.

Try this:

#easta

_etot = count eastlist
?(count eastlist)==0:goto "westa"

_i=0

#easti

?(getdammage (eastlist select _i))==0:liveeast=liveeast+1
?(getdammage (eastlist select _i))<0.5 and (getdammage (eastlist select _i))>0:woundedeast=woundedeast+1
?(getdammage (eastlist select _i))>=0.5 and (getdammage (eastlist select _i))<1:badwoundedeast=badwoundedeast+1
?(getdammage (eastlist select _i))==1:deadeast=deadeast+1
_i=_i+1
?_i==(_etot-1):goto "westa"
goto "easti"


If you do a similar process for West, Resistance and Civilian also maybe it will work.

You don't actually say what happens.


Planck
« Last Edit: 24 Mar 2004, 01:03:52 by Planck »
I know a little about a lot, and a lot about a little.