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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

Making Skills mutually exclusive on heros

Discussion in 'Triggers & Scripts' started by Knightmawk, Dec 7, 2012.

  1. Knightmawk

    Knightmawk

    Joined:
    Apr 17, 2008
    Messages:
    44
    Resources:
    0
    Resources:
    0
    I have a hero with two skills on it that are supposed to be mutually exclusive, as in if you learn one you can't learn the other. So what I've done is created two upgrades and made each skill require one level of the upgrades, then I wrote a script so that if you learned one skill it set the upgrade for the other one to zero, the problem is it isn't working.

    The Script looks like this right now, I'm just going to write it in pseudo code because I don't really know how to wrap it otherwise

    Event
    unit learns a skill
    Condition
    none
    Action
    if ( hero(skill learned) is equal to firstSkill
    Player - set current research level of Upgrade2 to 0 for owner of triggering unit

    if( hero(skill learned) is equal to secondSkill
    Player - set current research level of Upgrade1 to 0 for owner of triggering unit
     
  2. Arhowk

    Arhowk

    Joined:
    Aug 8, 2007
    Messages:
    2,752
    Resources:
    0
    Resources:
    0
    just remove the other ability from the hero? :p

    also, to copy triggers, right click on the top of the trigger where it says the name of the trigger, hit "copy as text", than paste it into one of the
    • tags
     
  3. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,979
    Resources:
    17
    Spells:
    17
    Resources:
    17
    You should use Player - Enable/Disable Ability
    Here's a test map.
     

    Attached Files: