Issues creating attack waves when named actor's are destroyed
Posted: Thu Jun 06, 2019 1:40 pm
Hi All,
I've run into a slight snag. I have 2 enemy infantry facilities and 2 enemy vehicle facilities, with scripted events at various intervals that spawn attack waves, where the attacking forces are built from a pre-defined facility. All of these facilities are available on map start and so have Actor Names. I've referenced these names when declaring the attacking forces as follows:
NODAttackWave1 = { barracks = NODHand2, types = { "e1", "e1", "e1", "e1", "e3", "e3" }, factory = { }, vehicles = { } }
NODAttackWave2 = { barracks = NODHand2, types = { "e4", "e4" }, factory = NODAirF2, vehicles = { "bggy" } }
NODAttackWave3 = { barracks = NODHand1, types = { "e3", "e3", "e4", "e4" }, factory = { }, vehicles = { } }
NODAttackWave4 = { barracks = NODHand1, types = { "e3", "e3" }, factory = NODAirF1, vehicles = { "ltnk" } }
NODAttackWave5 = { barracks = NODHand1, types = { "e1", "e1", "e1" }, factory = NODAirF1, vehicles = { "arty" } }
The problem I have is that when the player destroys one of the named actors, subsequent attacks fail regardless if the enemy re-builds the facility. I assume that this is because when the new actor is created, it is not known by the original Actor Name.
It appears I may have made the wrong decision when choosing to hard code the Actor Name of the production facility? Is there a way to have an attack wave be created by defining the ActorType of "hand" or "afld"? Does it matter that I have multiple production facilities, Or will the creation of the attack wave be shared amongst all necessary ActorType's it finds?
Ideally, if the enemy has 2 Hand of NODs and one of them is destroyed, the attack wave will continue to be created from the remaining Hand of NOD. Again, thank you for all the support you've provided so far. (I've added my new LUA script file with additional code that handles AI rebuilds)
Cheers,
Dave.
I've run into a slight snag. I have 2 enemy infantry facilities and 2 enemy vehicle facilities, with scripted events at various intervals that spawn attack waves, where the attacking forces are built from a pre-defined facility. All of these facilities are available on map start and so have Actor Names. I've referenced these names when declaring the attacking forces as follows:
NODAttackWave1 = { barracks = NODHand2, types = { "e1", "e1", "e1", "e1", "e3", "e3" }, factory = { }, vehicles = { } }
NODAttackWave2 = { barracks = NODHand2, types = { "e4", "e4" }, factory = NODAirF2, vehicles = { "bggy" } }
NODAttackWave3 = { barracks = NODHand1, types = { "e3", "e3", "e4", "e4" }, factory = { }, vehicles = { } }
NODAttackWave4 = { barracks = NODHand1, types = { "e3", "e3" }, factory = NODAirF1, vehicles = { "ltnk" } }
NODAttackWave5 = { barracks = NODHand1, types = { "e1", "e1", "e1" }, factory = NODAirF1, vehicles = { "arty" } }
The problem I have is that when the player destroys one of the named actors, subsequent attacks fail regardless if the enemy re-builds the facility. I assume that this is because when the new actor is created, it is not known by the original Actor Name.
It appears I may have made the wrong decision when choosing to hard code the Actor Name of the production facility? Is there a way to have an attack wave be created by defining the ActorType of "hand" or "afld"? Does it matter that I have multiple production facilities, Or will the creation of the attack wave be shared amongst all necessary ActorType's it finds?
Ideally, if the enemy has 2 Hand of NODs and one of them is destroyed, the attack wave will continue to be created from the remaining Hand of NOD. Again, thank you for all the support you've provided so far. (I've added my new LUA script file with additional code that handles AI rebuilds)
Cheers,
Dave.