Okay. Say a questline has me start a city and hire some city guards. They all have hunting rifles for starters. Say there are 70 total guards (large number I know but bear with me. The addon i'm doing this for actually uses this large a number. Oh, and to make things even more complicated, some of these guards already have scripts attached to them. And the ones that don't have one, there's another addon that adds another script to them.)
Okay, the first quest comes up in this questline, and it gets completed. What the quest entails is irrelevant. What is, is that the guards after this quest is completed should now have Sniper Rifles.
2nd quest comes and goes. The guards now have Gauss rifles (don't ask where they get them. This is just an example).
3rd quest comes and goes. The guards now have Alien Disintegrators (again don't ask. Just an example).
And so on and so fourth.
In other words, as you progress in the quest line, ALL the guards get better weapons.
Keep in mind, in order for this to work right this has to work on THE LIVING. Not soldiers that respawn or new spawns after said benchmarks.
And while we're on this subject. Let's take this a step further. Another thing I could use help with.
Say that instead of several different weapons to upgrade to, there's just two or three. HOWEVER, there's only so many of them to go around so instead of ALL the soldiers getting their weapons repalced after the completion of each mission, Only a few, random soldiers have their weapons replaced.
And on top of that, after the third weapon becomes available, some soldiers will become support units instead of regular soldiers, and use this weapon instead of their normal loadout.
Like so:
Mission 0 Complete: All soldiers have AK-47s.
Mission 1 Complete: The G36E becomes available. However, there isn't enough supply to meet demand. So only 10% of all currently living soldiers have G36Es instead of AK-47s. The rest hang on to their AK-47s.
Mission 2 complete: 25% of all currently living soldiers have G36Es instead of AK-47s now. The rest still have the AK-47s.
Mission 3 complete: 50% of all Currently Living Soldiers have G36Es instead of AK-47s now. HOWEVER, of those 50%, 10% of them will instead have the MG36 variant instead of the Normal Variant. (the 10% number of MG36 vs G36E doesn't change at all, as opposed to the AK47s vs G36Es)
Mission 4 complete: 100% of all Currently Living Soldiers have G36s instead of AK-47s now. HOWEVER, %10 of the soldiers will instead have the MG36 variant instead of the Normal Variant.
Yes, this is rather a complicated thing it seems. Plus theres a LOT of soldiers to cover. Not to mention this has to apply to any new soldiers that spawn too (Like say through a Encalve Commander addon)
If anyone has any ideas on how to make this work... I'd be very grateful.