1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] How to change teams (alliances)

Discussion in 'Triggers & Scripts' started by D3zmodos, Jan 4, 2009.

  1. D3zmodos

    D3zmodos

    Joined:
    Aug 9, 2008
    Messages:
    66
    Resources:
    0
    Resources:
    0
    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:
     
  2. Slaydon

    Slaydon

    Joined:
    Jan 6, 2008
    Messages:
    2,432
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    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)
     
  3. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    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)
     
  4. Xarian

    Xarian

    Joined:
    Aug 19, 2007
    Messages:
    23
    Resources:
    0
    Resources:
    0
    • 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.
     
  5. D3zmodos

    D3zmodos

    Joined:
    Aug 9, 2008
    Messages:
    66
    Resources:
    0
    Resources:
    0
    Yes thank you! (Although I did tell him to enemy already...anyways) :D
    Thanks to everybody who helped.