[Trigger] Unit Train System

Status
Not open for further replies.
onTrainingFinish (when unit finished training)

MaxIndex = MaxIndex + 1
Building[MaxIndex] = TriggeringUnit
UnitType[MaxIndex] = TrainedUnitType
Player[MaxIndex] = TriggeringPlayer
Location[MaxIndex] = PositionOf(TrainedUnit)


PeriodicTrigger (runs periodicly each 20 seconds)

Loop for CurrentIndex to MaxIndex
----
---- If (Building[MaxIndex] is Alive == True) Then
---- ---- Create UnitType[CurrentIndex] for Player[CurrentIndex] at Location[CurrentIndex]
---- Else
---- ---- Deindex or what ever


If you don't want to spawn all units at once but each unit exactly 20 seconds after first spawn then you need to index a counter variable, too.
In loop you increment/decrement your counter[index] periodicly until you create the unit, then you reset the counter.
 
Status
Not open for further replies.
Top