[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,351
Reaction score
14,059
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,479
Reaction score
4,946
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,351
Reaction score
14,059
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,930
Reaction score
13,567
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,930
Reaction score
13,567
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,381
Reaction score
5,032
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 Profile Posts

Latest member to OcRam -plugin suite: OcRam_Layers! Optimized parallax layers (for parallax mapping?) + dynamic layers which can be used in title-, battle and map scenes!
People convinced me to use my old graphics for this new project, i guess i can't run away from blender just yet. https://gyazo.com/2a105847c042bb78c6d4919ec1308660
10/24 done :3 Maybe I can finish 11 and 12 this weekend^^

Forum statistics

Threads
102,960
Messages
996,295
Members
134,426
Latest member
GameVenture
Top