• 🏆 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!

How to add an ability that has 50 level cap

Status
Not open for further replies.
Level 17
Joined
Jan 21, 2010
Messages
2,111
The title only says little,
In fact i want to make a skill that:
When the hero kills a unit, it will gain + damage in return, or i should say, add + damage item ability,
I had making them, but i can't solve the problen just by using the standart triggering

The problem is:
When the cap is reached, the triggers wont reconized it, and keep increasing the level ability with no limit,

The solution i want is:
How to make the triggers when the cap is reached the triggers won't add more level on the ability, and, how to remove each level's damage bonus, when the heroes skill are increased trough leveling?
Anyone can help?
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

I would say you can use this:
JASS:
if GetUnitAbilityLevel(YourUnit,AbilityCode) <= 50 then
   // Do all the actions here

But I don't know, if this was the function, which doesn't work and always returns 1, so here's another way:

Create an integer variable. Now when ever the ability level is increased, increase the integer variable too. So you can use the condition:
JASS:
if IntegerVaraible <= 50 then
   // All actions

But wondering, if the Level of the Ability has a cap of 50, how the trigger could increase it? Because there is no level 51 at all =O
 
Level 16
Joined
May 1, 2008
Messages
1,605
Split the abilities up into different abilities with 3 levels each instead.

Try to create a map with the abilities you have but with 4 levels. Use Widgetizer on both maps. Notice the difference.

Sounds logical, but nearly every spell is triggered in vJass. So to do the spit way, I need to create a system first, that, if the hero learns an ability above 3, another ability replace it (hope I'm not wrong here).
Also then I need to change and add lines to all the spell, for correct using .. So much work for saving 1 - 2 seconds of load time .. I don't know
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
I haven't benchmarked this but as it converts most widgets into SLK tables (except doodads as it bugs) it will have a remarkable loading time decrease. It's not about 1-2 seconds, at least not for my map Master Arena. Probably a decrease of 20 seconds or something like that after widgetized.

I think this is the reason why DOTA only have 4 levels and same to Rexxar campaign I *think*.
 
Level 9
Joined
Oct 17, 2009
Messages
370
What Adiktuz mean isn't that you should add the function Do nothing, he mean you should add nothing.


When you use If/Then/Else - Multiple functions, if want nothing to happen in the else part, just don't add nothing, keep it empty, there is where you shouldn't add the "Do nothing." action. But IF you use Do nothing, it doesn't really matter, your trigger will be 1 line longer, and with lots of If/Then/Else it will be much longer.

It doesn't matter if you use Do nothing or not.
 
Status
Not open for further replies.
Top