So, I dug and dug. And thought of this logic string. First a boolean variable for a unit: "IsAirBase"
Now those units with repair pads this =1;
More specifically:
IsAirBase=1;
Now, for the planes themselves, something like the following
Code: Select all
AirplaneTookDamage()
{
If (health < 50% && currentOrders == Patrolling)
{
UtilizeRepairPad();
}
}
Now, in UtilizeRepairPad() you'd need a "FindFreePad()" returning the ID of a free pad, if none exist (ie none are built), return out and that's it. Or have a set number of attempts at a certain time distance. OR set up a queue for repairpads and auto-equalize them. This would be a matter of swapping ID's for the repair pad. For big pads, with 4 pads themselves, it gets interesting.
Now, the code to land the plane, begin repair and keep it there until it's finished would be tricky.
I noticed that repair pads are pretty consistant in their naming, using "pad" or "land" in the name of the object to be landed on. However someone with more modeling experience may be able to shed more light on this.
My next dig project is for resurection. I loved this ability and would love it again.
-Buggi