[SOLVED]Problems with Level Up item

Status
Not open for further replies.

oddsocks8888

Villager
Member
Joined
Feb 19, 2015
Messages
13
Reaction score
2
First Language
English
Primarily Uses
I have a level up item that seems to reset the characters level to its original level after gaining some exp in battle. Is there any way to retain the level? Here's a screen of the item.levelup.png
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,354
Reaction score
14,060
First Language
English
Primarily Uses
RMVXA
Its probably how your state is working. Show a screenshot of your state too. As it is you need a way to permanently increase the EXP as once you gain EXP it will check your EXP table again and will reset to the old level as your EXP doesn't match the level.
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,480
Reaction score
4,948
First Language
English
Primarily Uses
RMVXA
While gaining EXP can cause the actor's Level to change in most circumstances, I don't think that directly forcing them to Level Up will cause them to gain the EXP that they would normally need to get that Level. (Then, the battle occurs, the EXP is gained for defeating enemies, and the actor's level is recalculated based on their new EXP number, which is why you are seeing them level-down.)

I recommend having your item give EXP to actors directly, rather than giving them Levels directly. There's a useful method called nextRequiredExp() that you can use to get the amount of EXP an actor needs to Level Up. So I think that inside a damage formula, you'd write something like b.changeExp(b.nextRequiredExp(), true) instead of b.levelUp();

Once you get this approach right, you can probably get rid of the "dummy states" for leveling up, too.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,354
Reaction score
14,060
First Language
English
Primarily Uses
RMVXA
Yeah those states are useless, especially as you add and remove them right away like that. You need to either increase the EXP directly or use the change level command in the event list (as that does give you the EXP), as otherwise the level up is temporary if done this way.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,932
Reaction score
13,569
First Language
English
Primarily Uses
RMMV
Why are you doing b.levelUp() + 1 ? That doesn't make much sense. And your item is giving damage equal to b's old level?

The Change Level event command changes the level, and then changes the experience to match the level. You are better off doing this:

b.changeLevel(b.level + 1)
 

oddsocks8888

Villager
Member
Joined
Feb 19, 2015
Messages
13
Reaction score
2
First Language
English
Primarily Uses
Yeah those states are useless, especially as you add and remove them right away like that. You need to either increase the EXP directly or use the change level command in the event list (as that does give you the EXP), as otherwise the level up is temporary if done this way.
I cant remember exactly how the thread went but there was a thread on this site that recommended to use dummy states as the formula wouldn't work without them (the thread kinda ended there and didn't really make any mention of the state having an affect on it, I assumed the formula itself handled everything). I had researched more after that and all threads pretty much came to the same conclusion.

Why are you doing b.levelUp() + 1 ?
Coz I don't know what the hell I'm doing XD Your fix works though. Thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,932
Reaction score
13,569
First Language
English
Primarily Uses
RMMV
If it's all working for you now, just report your first post and let the mods know, and they'll lock the thread for you.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,392
Reaction score
5,034
First Language
Dutch
Primarily Uses
RMXP
Since I'm here anyway, I'll go ahead and close it.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

@wrigty12 hi! thanks for showing interest in my work. Sadly the tablet I'm using broke, so I wasn't able to create anything for weeks. Got a new one with display, I'm still not used to it though, so I'm still practicing, doing basic drawings again. Also I'm in my last year of college. Thesis, projects and other activities takes most of my time ;_;.
I'll get back to it whenever I get a free time.
Any artists here planning on participating in the Inktober art prompts this October?
It's right around the corner.
It's rpg maker related so I'll post it here, I worked on a little free rpg maker zine and this was my piece. Play Grimm's Hollow if you haven't already, I liked it a lot. (i don't remember if posting a link to a product even if free is allowed via profile posts, so if anyone knows lemme know)

Suddenly arrived to work and got the pink slip on a contract O_O wait, did i forget something??? (sobbing in corner rn)

Forum statistics

Threads
103,017
Messages
996,725
Members
134,491
Latest member
Achikimiko
Top