What is happening in the mission: The Russians have a bunch of mortars.
What I want to do with this mission: Judge player performance in my mission based on how many of those mortars are destroyed.
How I am currently achieving what I want to do with mission: Current version of achieving mission objectives is essentially making a bunch of variables that check if each individual mortar is alive, and if one of those isn't it creates a public variable, and then if that variable is true then create another variable (to prevent the variable from being counted a second time) and add a value to a third variable. So for each gun there are two variables attached to it and a value being added in the background of the mission. The mission perams will then judge performance of the players in the mission based on the final value of my...value. So if they kill like 4 guns it'll say "mission complete objective partially destroyed". Also I cannot group the mortars because they are vehicles and thus not groupable, I don't care about the dudes on the mortars as much as the mortars themselves.
What I am inquiring about: I suck at scripting, I am stealing code from a mission I made years ago. I am sure there is a more elegant solution to this problem. Can someone point me in the right direction? or help me with the code?
To make 100% clear, I have a method that works. What I am asking for is a method that fulfills my intended outcome more efficiently.
Edited by azzwort, 2015-03-21 @ 05:20.