• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Making Skills mutually exclusive on heros

Status
Not open for further replies.
Level 3
Joined
Apr 17, 2008
Messages
44
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
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
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
 
Status
Not open for further replies.
Top