
Building X is a very complicated and essential part of my design. It needs to look big and evil, so I want to position a bunch of guards around the building, which don't only look cool, but also act as a defensive mechanism when it comes under attack.
Now, I could just make these infantry models child pieces of the building X model, and then mount them as turrets.
However, I would prefer if these units were actually spawned units, because:
- They have individual health, and can be killed individually
- They can be respawned individually
- They don't eat up UVmap space for texturing Building X
- Numerous advantages by having an actual unit be present with it's own personal AI and weapon ID's rather then just being a faked unit that is really a turret attached to a building
The problem with this is that it is essential that these guards:
1) Stand guard at designated positions around the building. Like, two outside doors, etc. This is more complicated then it seems; they need to stand straight at attention, and be facing the right direction.
2) When the building comes under attack, they need to move to designated areas on the model (eg: sandbagged areas), from where they can fire at the enemy. Preferably I'd want them to occupy these positions, though simply keeping them rooted where they are is an acceptable alternative which I can design around.
3) If the building is no longer under attack, the units need to move back to their original positions in number 1)
4) When a unit is killed, and the building respawns him (probably on say, a 45 second timer), that new unit needs to move to an unoccupied position (ie: the position of the previously killed unit), not to a position that is random or already taken.
Most of the numbered points I can accomplish through a complex animation sequence (except for the killing/replacing of units, which would take a zwzsg-esque script), but this removes all the advantages I noted in the dashed points, which are really cool, and allow me a lot more flexibility in the design.
The infantry units are not standard infantry troops employed in regular use, and can have their own private scripts attached that don't need to work for general combat-unit usage.
... So, scripting gurus, can the dashed points and the numbered points be resolved to accomplish what I need through LUA?
Presume (more or less correctly) that I have no foreknowledge of LUA methods or implications.
Other ideas as to how I might resolve this concept in a similar way to what I need are always welcome.