[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,222
Reaction score
13,758
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,390
Reaction score
4,781
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,222
Reaction score
13,758
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,618
Reaction score
13,212
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,618
Reaction score
13,212
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,978
Reaction score
4,730
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

When you realize @Kupotepo is a champion among RM Web users, and it all makes sense now:
Worst nightmare this morning, tried to get 20 minutes of work done on my project before heading to work and got hit with a POWER SURGE. Restarted my computer and the project was CORRUPTED, luckily I made a back up a few days ago so I only lost 4 days of work but still
Ami
what the other name of Elixir?

many games are use that,i want name it different.
What does your project folder look like?
I was told that an iPhone can provide a personal internet hotspot...You learn something new everyday!

Forum statistics

Threads
100,459
Messages
976,192
Members
132,082
Latest member
nwr
Top