HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why does this simple trigger not work?

07-28-2006, 05:24 PM#1
Sardius
Trigger:
Level
Collapse Events
Unit - A unit owned by Player 1 (Red) Gains a level
Conditions
Collapse Actions
Hero - Set (Leveling Hero) experience to 0, Hide level-up graphics

Pretty simple eh? But it doesn't work, my hero gained a level and his xp was not reduced to 0
07-28-2006, 05:56 PM#2
PipeDream
If you want to remove levels I believe you'll have to specifically remove levels. relevant API things to try:
Collapse JASS:
native          UnitStripHeroLevel  takes unit whichHero, integer howManyLevels returns boolean

native          GetHeroXP           takes unit whichHero returns integer
native          SetHeroXP           takes unit whichHero, integer newXpVal,  boolean showEyeCandy returns nothing

native          GetHeroSkillPoints      takes unit whichHero returns integer
native          UnitModifySkillPoints   takes unit whichHero, integer skillPointDelta returns boolean

native          AddHeroXP           takes unit whichHero, integer xpToAdd,   boolean showEyeCandy returns nothing
native          SetHeroLevel        takes unit whichHero, integer level,  boolean showEyeCandy returns nothing
constant native GetHeroLevel        takes unit whichHero returns integer
07-28-2006, 06:08 PM#3
Sardius
No not trying to remove the level, just a more simplistic experience system to keep the numbers from getting to high... Like to lvl 2 you need 500 xp, to lvl 3 you need 1000, but whenever you gain a level, I want the experience of that hero to fall to 0...
Is this not easily possible?
07-28-2006, 07:10 PM#4
Fin.
I don't think that is possible, since experience is set so it is added with each level not reset to 0, and the set experience trigger can only raise not lower the experience. You would probably have to make a serperate experience system to do what you want. I think any other method would be too messy=/