[Help] Units Are Not Getting Transferred

Pyroflame

New Member
Reaction score
4
Probably something silly I'm missing, but I would really like to fix this and I could use some help.

Basically, what I'm trying to do is take collection of units owned by a leaving player, put them under the control of another specific player, and then change the unit type of the unit.

Trigger:
  • Leaver
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is in Human_Players) Equal to True
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Player - Add -1 to (Picked player) Current lumber)
        • Else - Actions
      • Game - Display to (All players) the text: ((Name of (Triggering player)) + has left the game.)
      • Player Group - Remove (Triggering player) from Human_Players
      • Player Group - Remove (Triggering player) from Towns_People
      • Player Group - Remove (Triggering player) from Zombies
      • Player Group - Make (Player group((Triggering player))) treat Towns_People as an Enemy
      • Player Group - Make (Player group((Triggering player))) treat Zombies as an Enemy
      • Set TempGroup = (Units owned by (Triggering player) of type Zombie (Produceable))
        • Unit Group - Pick every unit in TempGroup and do (Actions)
          • Loop - Actions
            • Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Change color
            • Unit - Replace (Picked unit) with a Zombie using The old unit's relative life and mana
        • Custom script: call DestroyGroup (udg_TempGroup)


Again, it's supposed to put the unit type of Zombie (Produceable) into a unit group called TempGroup. From there, it should be taking the units in TempGroup and putting them under the control of Player 9 (Gray) and then replace the just transferred units with just the unit type of Zombie.

This trigger isn't even changing the units over to Player 9's (Gray) control and I'm not sure if it's changing there unit type or not, I'm going to guess no (both models look the same, produceable cost no food)

Any idea what the problem may be? The units that need to be transferred that are the Zombie (Produceable) are most certainly called that and are the ones that the leaving player can only have and create.

Thanks.
 

Executor

I see you
Reaction score
57
Well I don't see a mistake, did you check if the mistake is maybe in some line above the loop?
You should test with Debug messages what's going on and whether the loop is even reached or not.
 

MagnaGuard

Active Member
Reaction score
49
You have the then action to remove the players lumber, the script stops there
However, you have the ELSE action that does all the meaty stuff so when a player leaves all that happens is the lumber being taken away and not adding him to a zombie group
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top