[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,223
Reaction score
13,759
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,402
Reaction score
4,791
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,223
Reaction score
13,759
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,626
Reaction score
13,220
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,626
Reaction score
13,220
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
6,982
Reaction score
4,734
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

Got inspired and started writing a simple tower defence battle system last night :o
Good news! I have located an amazing 3D website called SketchFab that has rotatable renderings of famous statues!
Picked up a physical copy of Megadimension Neptunia VII for the PS4 today. It's pretty good. I'm having a lot of fun with it.
The only upside of this remote semester was the plenty of funny photoshop material those facecams provided. Not that I would do that. Ever.

Forum statistics

Threads
100,514
Messages
976,695
Members
132,080
Latest member
nwr
Top