• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Stopping hero from gaining more tahn 1 level at a time

Status
Not open for further replies.
Level 9
Joined
Sep 5, 2015
Messages
369
If i have a hero that is level 1, and there are 2 level 50 heroes with it killing level 50 enemies, the level 1 will spike up multiple levels. this prevents me from using a trigger to remove 1 ability point from them unless they're certain levels.

I set this trigger to prevent heroes from gaining an ability point unless it's set to specific levels, where they will gain 3. these levels are 4, 12, and 20. they have 3 abilities with a max level of 3. so at level 20, the abilities are maxed.

Now if a level 3 hero, kills or is near the kill of a level 50 monster, it's going to jump to (for example:) level 12, bypassing my trigger, and literally giving the hero (12(current hero level) - 3(hero level) - (trigger effect) 8 ability points at level 12! at level 12 they should have only recieved 6 total!

I would just change the skip level but it would have to be formulative, and i want the numbers to be 4, 12, and 20 for specific reasons. if i used skip level in the object editor it would have to be something like levels 6,12,18...or... 5 10 15, etc. and i dont care to explain why this won't work for me.

------------------------------------------------
-------------LONG STORY SHORT----------------
------------------------------------------------
How can i make it so heroes can't gain more than 1 level when they gain experience.

im having trouble with low level heroes killing higher level heroes and jumping from level 1 to 4, skipping some triggers ive set up. ive tried disabling experience after a hero levels, but it only goes off after the heroes gone from level 1 to 19483923, which doesn't help.






any help would be appreciated

lol bump. THIS IS FOR MONSTER MASTERS 2 have you guys no courtesy? lel @srs@notsrs@srs
 
Last edited by a moderator:
Level 9
Joined
Sep 5, 2015
Messages
369

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,239
Design your levelling system to be more robust. The idea is that given any level it updates the hero appropriately. This way it does not matter if the hero gains 1, 10 or even 100 levels.

Firstly compute the total number of skill points the hero should have at its new level. This could be algorithmically computed if skill points are awarded at regular intervals, otherwise you will need to use some sort of table lookup to find the appropriate number if they are not allocated by a formula.

After doing this you then tally the total levels of all hero abilities on the hero (where points were spent). You subtract the total number of skill points by the number of skill points in abilities. The result is the number of free skill points the player can allocate.

Finally you modify the number of skill points on the hero to reflect this desired amount. Not sure how the native works but if it only modifies skill points (changes them by an amount, not sets them) then you need to work out the difference by getting the desired hero skill points and subtracting the current hero skill points from it.

This form of implementation is much more robust, it would even allow for level cheat codes for debugging.
 
Status
Not open for further replies.
Top