Can't change team

feelingparty

New Member
Reaction score
3
***SOLVED***

I'm trying to make so that when a special unit is killed the killing unit claims the dying player for his team. I can't make it work though. I'm posting the triggers. If anybody knows what's wrong I'd appreciate his help.

Triggers:
Trigger:
  • FortresDies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Footman
    • Actions
      • Player Group - Pick every player in (All allies of (Owner of (Dying unit))) and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Dying unit)) as an Enemy
          • Player - Make (Owner of (Dying unit)) treat (Picked player) as an Enemy
        • Player - Make (Owner of (Dying unit)) treat (Owner of (Killing unit)) as an Ally with shared vision
      • Player Group - Pick every player in (All allies of (Owner of (Killing unit))) and do (Actions)
        • Loop - Actions
          • Player - Make (Owner of (Dying unit)) treat (Picked player) as an Ally with shared vision
          • Player - Make (Picked player) treat (Owner of (Dying unit)) as an Ally with shared vision
        • Else - Actions


What happens is that the teams stay exactly the same - You allies are still your allies (shared sight, don't attack you, yellow selections) as well as your enemies are still your enemies (no sight, attack you, red sellections)
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Hmm. I think you should try it this way... It should work and it should be MUI i.e when many units die at the same time it probably won't malfunction...

Trigger:
  • Footman Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set X_Killing_Unit = (Killing unit)
      • Set X_Dying_Unit = (Triggering unit)
      • Set X_Owner_of_KUnit = (Owner of X_Killing_Unit)
      • Set X_Owner_of_DUnit = (Owner of X_Dying_Unit)
      • Set X_Allies = (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of (Owner of X_Dying_Unit)) Equal to True))))
      • Set X_Enemies = (All players matching ((((Matching player) controller) Equal to User) and ((((Matching player) slot status) Equal to Is playing) and (((Matching player) is an ally of (Owner of X_Killing_Unit)) Equal to True))))
      • Player Group - Pick every player in X_Allies and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat X_Owner_of_DUnit as an Enemy
          • Player - Make X_Owner_of_DUnit treat (Picked player) as an Enemy
      • Custom script: call DestroyForce(udg_X_Allies)
      • Player Group - Pick every player in X_Enemies and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat X_Owner_of_DUnit as an Ally with shared vision
          • Player - Make X_Owner_of_DUnit treat (Picked player) as an Ally with shared vision
      • Custom script: call DestroyForce(udg_X_Enemies)
 

feelingparty

New Member
Reaction score
3
Thanx Igor Z. The problem was actually in the fact that I was testing my map instead of running it via wc3 and that means no players but Player 1 (Red) which somehow bugged the triggers. Anyway thanx for the reply.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top