• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Help with a trigger to make a certain spell usable only after a certain level

Status
Not open for further replies.
Level 7
Joined
Jul 7, 2008
Messages
332
Hello.
I finally made a hero builder thingy.
But when I buy Ultimates I can use them right away, how do I make them usable when I reach level 6 for example?
 
Level 3
Joined
May 3, 2004
Messages
46
Make a dummy ability. And when the hero reaches level X then remove the dummy ability, and add the real ability.

(Yes, unfortunately you will need to make a dummy for each ultimate)
 
Level 3
Joined
May 3, 2004
Messages
46
Just prevent your hero from buying those skills if he doesnt match the requirements

A Hero Builder map usually "selects" the abilities at start, and they appear as normal unit abilities that improves as the hero gains levels. And at the start of the map, the heroes are usually level 1, and if the Ultimate requires lets say level 6, none of the Heroes can get an Ultimate.
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Just add a condition checking the casting hero's level. And then stop him.

Like this:

  • Spell Trigger
    • Events
      • Unit - A unit begins casting an ability (so it wont drain mana)
    • Conditions
      • Level of (casting unit) is Lesser or equal to 5.00
    • Actions
      • Unit - Issue order (casting unit) to stop
The trigger names might not be 100% correct as I didnt bother to check them, but they exsist and you should be able to find them with this.
 
Level 7
Joined
Mar 12, 2006
Messages
407
Ok i was thinking of games like The Great Strategy or Custom Hero Survival where u buy skills.
If it works the way Red Baron wrote ure fine but i think for passive ultimates and stuff you should make a dummy skill name it somewhat like Ultimate and give a tooltip which says that the ultimate will be automatically learned when ure level 6

So if you choose the ulti u have it saved to an array and if your hero levels up to 6 you remove the ultimate dummy, and add the skill saved in the array
or
i think u use items to select your abilities. then just move the item of your ultimate to a special place and give it to the hero when he reaces lv 6
 
Level 12
Joined
Aug 22, 2008
Messages
911
How about making your ability's mana cost gigantic, and when hero reaches level, modify it (if possible) or replace with low mana cast ability?
Another solution might be to disable the ability for a PLAYER (considering that's the only unit of the player that has the ability) and enabling it when hero reaches level.
A really cool solution would be create a Unit requirement for the ability, while the unit's name is "Level 6" or something, then creating it for the owner of the hero once the hero reaches level 6.
Help you, one of these solutions will, I think. Good luck, may the Force be with you!
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Ok i was thinking of games like The Great Strategy or Custom Hero Survival where u buy skills.
If it works the way Red Baron wrote ure fine but i think for passive ultimates and stuff you should make a dummy skill name it somewhat like Ultimate and give a tooltip which says that the ultimate will be automatically learned when ure level 6

So if you choose the ulti u have it saved to an array and if your hero levels up to 6 you remove the ultimate dummy, and add the skill saved in the array
or
i think u use items to select your abilities. then just move the item of your ultimate to a special place and give it to the hero when he reaces lv 6

Inded, I forgot to take passive into consideration, a buff checker might do the trick though, but oh well dummy works as well.

A really cool solution would be create a Unit requirement for the ability, while the unit's name is "Level 6" or something, then creating it for the owner of the hero once the hero reaches level 6.
I dont believe this can be done... in the form you talk about without triggers.
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
One nice-looking way is to do this:

Create a dummy unit named "Level 6"

Set your ultimate spells to require the dummy unit.

Create a trigger that whenever a hero reaches level 6 adds a "Level 6" dummy unit to the owner of the hero.


In game, you will see the ability as disabled, and when hovvering over it, it will say: Required - Level 6
 
Level 7
Joined
Jul 7, 2008
Messages
332
One nice-looking way is to do this:

Create a dummy unit named "Level 6"

Set your ultimate spells to require the dummy unit.

Create a trigger that whenever a hero reaches level 6 adds a "Level 6" dummy unit to the owner of the hero.


In game, you will see the ability as disabled, and when hovvering over it, it will say: Required - Level 6

That's so simple and usefull <3 I love you!
 
Level 7
Joined
Jul 7, 2008
Messages
332
Thank you also, I got another problem now.
The dummy requiment doesn't work for passive skills :(

I also have a problem with a custom skill based on metamorphis, When the effect ends the unit losing all its skills O_O
 
Last edited:
Level 35
Joined
Oct 9, 2006
Messages
6,392
Thank you also, I got another problem now.
The dummy requiment doesn't work for passive skills :(

I also have a problem with a custom skill based on metamorphis, When the effect ends the unit losing all its skills O_O

I would advice making the metamorphis into a trigger spell if making a hero builder. Wont be that hard. Then you just shift between the units when ability is used, and make sure that the units keep up with each other. (a little triggering needed though)
 
Level 12
Joined
Aug 22, 2008
Messages
911
Make sure that the abilities that the morphed unit has are identical to the ones that the regular hero has. You should take a good look at the Demon Hunter and his morphed form in the object editor and compare between them, including the Metamorphosis ability itself. In the case of buying abilities, that would require some good triggering as said by Red Baron.
About the Passive ability- create a different requirement or add it via triggers, I'll take a look around the solutions offered here and edit it when I have an idea.
EDIT: I stick to the solution of a dummy ability replaced by the real ability in lvl 6, but only if this is one or few passive abilities.
The dummy ability should have the disabled icon of the real ability and a tooltip that says "Requirement - Level 6" + the ability's regular tooltip. Also they should have the same X,Y placement in the icons to make it more realistic.
The trigger should look something like this:
  • Hero Ability Trigger
    • Events
      • Unit - A unit gains a level
    • Conditions
      • And (All Conditions)
        • (Triggering Unit) has (DummyPassiveAbilityName) equal to True
        • Level of (Triggering Unit) equal to 6.00
    • Actions
      • Unit - Remove DummyPassiveAbilityName for (Triggering Unit)
      • Unit - Add RealPassiveAbilityName for (Triggering Unit)
 
Level 12
Joined
Aug 22, 2008
Messages
911
Okay, you're right terradont. But I'm including my response for ProfessorZmurge's need for a passive ability just in case you thought my entire thread was on the metamorph again.
About the Passive ability- create a different requirement or add it via triggers, I'll take a look around the solutions offered here and edit it when I have an idea.
EDIT: I stick to the solution of a dummy ability replaced by the real ability in lvl 6, but only if this is one or few passive abilities.
The dummy ability should have the disabled icon of the real ability and a tooltip that says "Requirement - Level 6" + the ability's regular tooltip. Also they should have the same X,Y placement in the icons to make it more realistic.
The trigger should look something like this:
  • Hero Ability Trigger
  • Events
    • Unit - A unit gains a level
  • Conditions
    • And (All Conditions)
      • (Triggering Unit) has (DummyPassiveAbilityName) equal to True
      • Level of (Triggering Unit) equal to 6.00
    • Actions
      • Unit - Remove DummyPassiveAbilityName for (Triggering Unit)
      • Unit - Add RealPassiveAbilityName for (Triggering Unit)
 
Level 10
Joined
Jun 1, 2008
Messages
485
ok, for metamorph (?) you must make the ability permanent.
just add this trigger
  • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(),true,'A005')
A005 ability raw code, change it to your ability raw code, to see it in object editor press ctrl + d. it must have ' character before and after the raw code.
GetTriggerUnit() means it will make the ability permanent for triggering unit.
true means it will make the ability permanent. if false, it will make the ability not permanent.
 
Level 13
Joined
May 11, 2008
Messages
1,198
instead of making a dummy ability just make a dummy level?
so until you hit level 6 the ability is at level one but just call it level 0 and make it do nothing and cost nothing. you should be able to edit the level skip requirement so he can't learn it until level 6 but then he can't learn level two on it until like 11 or 12 or something like that.
a dummy ability might be better but a dummy level might work just fine.
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
instead of making a dummy ability just make a dummy level?
so until you hit level 6 the ability is at level one but just call it level 0 and make it do nothing and cost nothing. you should be able to edit the level skip requirement so he can't learn it until level 6 but then he can't learn level two on it until like 11 or 12 or something like that.
a dummy ability might be better but a dummy level might work just fine.

Sorry but the whole point was that he cant just use an ability, he would need to somehow replace the unit, or make him actually learn it. The point is that its a hero builder, which is the problem.
 
Status
Not open for further replies.
Top