Need help with Rally point with attack command for computer given units

Level 7
Joined
Sep 10, 2023
Messages
112
Hello, so I have 2 triggers

Trigger A: it makes created unit to attack move instead to just move to a rally point

  • attackmoverally
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set VariableSet Rallypoint = (Rally-Point of (Triggering unit) as a point)
      • Unit - Order (Trained unit) to Attack-Move To Rallypoint
      • Custom script: call RemoveLocation(udg_Rallypoint)

Trigger B: Makes created unit to be given to computer X to reduce unit movement lag

  • ZombieRotationDG
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Trained unit)) Equal to Zombie (T1)
          • (Unit-type of (Trained unit)) Equal to Ravenous Zombie (T2)
          • (Unit-type of (Trained unit)) Equal to Mutated Zombie (T3)
          • (Unit-type of (Trained unit)) Equal to Ghoul (T4)
    • Actions
      • Set VariableSet TempUnit1 = (Trained unit)
      • Set VariableSet ZombieIndexP11 = (ZombieIndexP11 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ZombieIndexP11 Equal to 1
        • Then - Actions
          • Unit - Change ownership of (Trained unit) to Player 11 (Dark Green) and Change color
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ZombieIndexP11 Equal to 2
            • Then - Actions
              • Unit - Change ownership of (Trained unit) to Player 17 (Wheat) and Change color
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ZombieIndexP11 Equal to 3
                • Then - Actions
                  • Unit - Change ownership of (Trained unit) to Player 18 (Peach) and Change color
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ZombieIndexP11 Equal to 4
                    • Then - Actions
                      • Unit - Change ownership of (Trained unit) to Player 19 (Mint) and Change color
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ZombieIndexP11 Equal to 5
                        • Then - Actions
                          • Unit - Change ownership of (Trained unit) to Player 20 (Lavender) and Change color
                          • Set VariableSet ZombieIndexP11 = 0
                        • Else - Actions

How Can I make that the zombies given to the computer players are sent to attack like the ones in the Trigger A? I dont even know where to start.
 
Whenever you use Change Ownership, the game engine automatically clears all current orders for that unit.

Order trained unit to attackmove actions to the very bottom of the trigger, after all the ownership If/Then/Else blocks. Since the building still belongs to the original player, the rally point logic should work.

Also, I'd suggest to add a condition to Trigger A- (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green). This prevents the triggers from fighting over the same unit.

Set VariableSet TempUnit1 // I don't see that you're actually using that variable anywhere.
 
Whenever you use Change Ownership, the game engine automatically clears all current orders for that unit.

Order trained unit to attackmove actions to the very bottom of the trigger, after all the ownership If/Then/Else blocks. Since the building still belongs to the original player, the rally point logic should work.

Also, I'd suggest to add a condition to Trigger A- (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green). This prevents the triggers from fighting over the same unit.

Set VariableSet TempUnit1 // I don't see that you're actually using that variable anywhere.
Thanks ill try doing that
 
Back
Top