• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] How to change teams (alliances)

Status
Not open for further replies.
Level 4
Joined
Aug 9, 2008
Messages
67
Ok now the solution for this is probably something very stupid that I forgot so I apologize in advance for that:grin:
But here is the problem:
I am making a tag map (similar-ish to tree tag) when the hunter kills a runner, that runner becomes the hunter. Of course I want to change the visibility (an that goes with alliance) settings to accommodate this change.
Here are the actions I take:
  • Events:
  • When a unit dies
  • Actions:
    • For each integer A 1 - 12:
      • Player - set ((Owner of the dying unit's) alliance to (Integer A) to Enemy
      • Player - set (Integer A) alliance to ((Owner of the dying unit's) to Enemy
      • Player - set ((Owner of the killing unit's) alliance to (Integer A) to Ally shared vision
      • Player - set (Integer A) alliance to ((Owner of the killing unit's) to Ally shared vision
    • Player - set ((Owner of the killing unit's) alliance to ((Owner of the dying unit's) to Enemy
Now that causes a problem because the killing unit there can still see the dying unit (this only happens the first time) and I have no idea why.
Please help:cry:
 
have you tried
  • Events:
    • When a unit dies
  • Actions:
    • For each integer A 1 - 12:
    • Player - set ((Owner of the dying unit's) alliance to (Integer A) to Enemy
    • Player - set (Integer A) alliance to ((Owner of the dying unit's) to Enemy
    • Player - set ((Owner of the killing unit's) alliance to (Integer A) to Ally shared vision
    • Player - set (Integer A) alliance to ((Owner of the killing unit's) to Ally shared vision
    • Player - set ((Owner of the killing unit's) alliance to ((Owner of the dying unit's) to Enemy
    • Unit - Kill (dying unit)
 
Maybe you have to set alliance first instead of enemy first?
That could be the problem?
Cause first you set (owner of(dying)) enemy with everyone, and vice versa (the same other way round) and THEN you set (owner of (killing)) alliance to EVERYONE (including the (owner of(dying))
If you change the order, you wont have the extra action either; (May work, but i DONT KNOW)
 
  • Events:
  • When a unit dies
  • Actions:
    • For each integer A 1 - 12:
      • Player - set ((Owner of the dying unit's) alliance to (Integer A) to Enemy
      • Player - set (Integer A) alliance to ((Owner of the dying unit's) to Enemy
Okay, every player becomes the enemy of the dying unit and the dying unit becomes their enemy

  • Player - set ((Owner of the killing unit's) alliance to (Integer A) to Ally shared vision
  • Player - set (Integer A) alliance to ((Owner of the killing unit's) to Ally shared vision
Now every player becomes the ally of the killing unit and the killing unit becomes their ally

  • Player - set ((Owner of the killing unit's) alliance to ((Owner of the dying unit's) to Enemy
This resolves half the problem - now the killing unit considers the dying unit an enemy, but not the opposite.

I suggest that you simply do things in the opposite order...
  • Events:
  • When a unit dies
  • Actions:
    • For each integer A 1 - 12:
      • Player - set ((Owner of the killing unit's) alliance to (Integer A) to Ally shared vision
      • Player - set (Integer A) alliance to ((Owner of the killing unit's) to Ally shared vision
      • Player - set ((Owner of the dying unit's) alliance to (Integer A) to Enemy
      • Player - set (Integer A) alliance to ((Owner of the dying unit's) to Enemy
In this case, everyone first becomes allies with everyone (because they were only enemies with the killing unit previously) and then the dying unit becomes everyone's enemy.

See if that fixes your problem.
 
Status
Not open for further replies.
Back
Top