[General] create and load unit into transport

Status
Not open for further replies.
So there are types of buildings in the map called burning coral and they have transport load/unload ability. What I'm trying to do is create one unit for each one and load it in. When the building dies the unit is unloaded. the training time is 1.
Because of this I tried to make the coral train its own unit and load it. Not working exactly. Is there something wrong here?
  • load nagas
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Coral_Transport = (Units owned by Player 6 (Orange) of type Burning Prison Coral)
      • Unit Group - Pick every unit in Coral_Transport and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to (Number of units in Coral_Transport), do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to train/upgrade to a Naga Myrmidon
              • Unit - Order (Trained unit) to Load (Picked unit)
 
Last edited:
Ok, thnaks for the advices! This here works:

  • load nagas
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Coral_Transport = (Units owned by Player 6 (Orange) of type Burning Prison Coral)
      • Unit Group - Pick every unit in Coral_Transport and do (Actions)
        • Loop - Actions
          • Set Coral_Pos = (Position of (Picked unit))
          • Unit - Create 1 Naga Myrmidon for Player 6 (Orange) at Coral_Pos facing Default building facing degrees
          • Unit - Order (Picked unit) to Load (Last created unit)
          • Custom script: call RemoveLocation(udg_Coral_Pos)
 
Status
Not open for further replies.
Top