It's been a long time since I've visited this forum. Since it was always the premiere source for editing help it's good to be back.
I'm working on populating the entire map with randomly patrolling enemy units. When the player squad gets within a certain range the units are created by script. When the player squad gets out of that range I want to delete the units.
My primary question is what would be the best way to keep track of the units that were deleted so that they can be re-spawned if the player squad comes within the range again? Let's say, for example, player engages a 10 man squad of enemy, kills 3 and then retreats. I want to leave the dead where they lay, delete the others, keep track of what kind of units they were (rifleman, grenadier, machinegunner, etc.) and re-spawn them if the player comes back within a distance that he might re-engage.
I have no problem sorting out who's dead, who's alive or what type of unit they are. I just don't know where to store that information for re-use. At this point I'm thinking of a constantly running script but wondering if there is a better way.
Second question - For each of the enemy squads I'm creating the leader on the map and defining his patrol area. The enemy forces that I spawn are assigned to, and deleted from, the various leaders. I did it this way so that the leader could continue the group's patrol and his underlings would be created at whatever location they would have been at had they not been deleted. So... there will be at least one unit for each group on the map at all times. My question is whether or not there is a more efficient way. Perhaps a way to delete the leader also in an effort to be kind to resources.
Any tips, ideas or insights are greatly appreciated.
Thanks