Using an Item to Level Up

Status
Not open for further replies.

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
No matter what I do it levels up the whole party. But for context
1.png2.png

Is there a specific script call that I can do to make it work on who it was selected on? Like any other growth like item. Thanks in advanced. It was in the MV version still for the entire party... but I want this remaster to only be for one character and used.
 

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
In a sense, it's like a Rare Candy from Pokemon. That's where I got the idea from.
 

Sheklon

Veteran
Veteran
Joined
Jan 28, 2020
Messages
59
Reaction score
22
First Language
Portuguese
Primarily Uses
RMVXA
What does the common event do?
 

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
What does the common event do?

Use item, common event, since level up is not something that can be targeted by an item otherwise. But it levels up the whole party instead. So, thought I'd ask around to see if it can be narrowed to select character.
 

Sheklon

Veteran
Veteran
Joined
Jan 28, 2020
Messages
59
Reaction score
22
First Language
Portuguese
Primarily Uses
RMVXA
Use item, common event, since level up is not something that can be targeted by an item otherwise. But it levels up the whole party instead. So, thought I'd ask around to see if it can be narrowed to select character.
I see it now, and I just reproduced that. It seems that having the variable set to 0 is the equivalent to "whole party" when you use the level up command.

You'll have to use the damage formula to get the target id. Put this there:
Code:
v[X]=b.id;0
Replace X by the variable ID.

Edit: also, I don't think you need to manually remove the item through the common event. If the item is set as consumable, it will get automatically removed once you use it. Having that additional removal through the common event will make so that, if the player has 2 eggs, he will lose both on a single use.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
656
Reaction score
184
First Language
English
Primarily Uses
RMMZ
I think you're going to run into a problem with item use validation. If the actor you are trying to use it on is at max level, you will still end up using the item, but it won't do anything.

I think for the most optimal way to get this effect, you'll need to use a plugin.
 

Sheklon

Veteran
Veteran
Joined
Jan 28, 2020
Messages
59
Reaction score
22
First Language
Portuguese
Primarily Uses
RMVXA
I think you're going to run into a problem with item use validation. If the actor you are trying to use it on is at max level, you will still end up using the item, but it won't do anything.

I think for the most optimal way to get this effect, you'll need to use a plugin.
In that case it's possible to create a conditional branch that checks whether the target is at the max level or not (by using the ID variable to get the actor's level).

It's not optimal, but it works.
 

Attachments

  • Lvl Up System.PNG
    Lvl Up System.PNG
    18.1 KB · Views: 4

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
656
Reaction score
184
First Language
English
Primarily Uses
RMMZ
In that case it's possible to create a conditional branch that checks whether the target is at the max level or not (by using the ID variable to get the actor's level).

It's not optimal, but it works.
It terms of usability, I think it'd be a bit weird but it would work.

Back in the MV era (so a few years ago xD) Dekita made a Rare Candies plugin for MV, I had a copy of it in my old projects, threw that plugin into MZ, and it looks to work just fine!

The link to the original post is here:
https://forums.rpgmakerweb.com/index.php?threads/rare-candies.50343/

It looks like the original link is broken, but further down there is a wayback link that seems to work? Since I already had it downloaded from years ago I didn't check.
 

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
It terms of usability, I think it'd be a bit weird but it would work.

Back in the MV era (so a few years ago xD) Dekita made a Rare Candies plugin for MV, I had a copy of it in my old projects, threw that plugin into MZ, and it looks to work just fine!

The link to the original post is here:
https://forums.rpgmakerweb.com/index.php?threads/rare-candies.50343/

It looks like the original link is broken, but further down there is a wayback link that seems to work? Since I already had it downloaded from years ago I didn't check.

Well I found the plugin since I couldn't get the variables and common eventing to work to my liking. But I will remain adamant about finding out how to get this to work without the plugin, since the only downside is that it doesn't say [X] learned [skill]. But thank you nonetheless.

I see it now, and I just reproduced that. It seems that having the variable set to 0 is the equivalent to "whole party" when you use the level up command.

You'll have to use the damage formula to get the target id. Put this there:
Code:
v[X]=b.id;0
Replace X by the variable ID.

Edit: also, I don't think you need to manually remove the item through the common event. If the item is set as consumable, it will get automatically removed once you use it. Having that additional removal through the common event will make so that, if the player has 2 eggs, he will lose both on a single use.

Thank you for trying to help, but I couldn't get it to work... could be my lack of actual variable knowledge. Everything I tried and suggested, even the other picture you posted, couldn't exactly get it to work as it still leveled the entire party.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
656
Reaction score
184
First Language
English
Primarily Uses
RMMZ
Well I found the plugin since I couldn't get the variables and common eventing to work to my liking. But I will remain adamant about finding out how to get this to work without the plugin, since the only downside is that it doesn't say [X] learned [skill]. But thank you nonetheless.

With the power of plugins, (almost) anything is possible!

If you want that level up message, you could dive into the plugin's code and change the line
Code:
this.changeLevel(this.level+1,false);
to
Code:
this.changeLevel(this.level+1,true);

If you do this, once you use the item and back out of the menu, the leveled up message will appear. It's not perfect, but I think that's what you want? (See if it works for your game. I'm using Visustella plugins so it's possible I have a bit of a different experience).
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,374
Reaction score
615
First Language
indonesian
in MZ we can store Last Target Actor ID in a variable...
Change Variable -> Operand Game Data -> Last -> Last Target Actor ID
to store the target actor id in a variable...
let's say we store it to variable 7.

then we also need some check does the actor max level or not... can be using
Conditional Branch -> Script:
Code:
$gameActors.actor($gameVariables.value(7)).level < 99
don't forget to add else branch...
then put inside the true condition

Change Level -> Variable 7 -> add 1 lv
instead of Fixed actor ID.
remove the rare candy item -1

at the else branch... add some notification that the actor level is maxed...

this is the screenshot example:
item rare candy: (make it NOT consumeable since we will remove it manually at common event)
1606371108789.png

common event rare candy:
1606371145127.png
i use variable 7 to store the target actor id.
the level up message is also using escape code
\n[\v[7]] Level UP !!

hope this help

edit: this also did not show X learn Y skill message though...
it's possible to show learn skill using combination of event + script call... but not recommended for beginner... better use plugin instead...
 
Last edited:

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
With the power of plugins, (almost) anything is possible!

If you want that level up message, you could dive into the plugin's code and change the line
Code:
this.changeLevel(this.level+1,false);
to
Code:
this.changeLevel(this.level+1,true);
If you do this, once you use the item and back out of the menu, the leveled up message will appear. It's not perfect, but I think that's what you want? (See if it works for your game. I'm using Visustella plugins so it's possible I have a bit of a different experience
I too am using their plugins. Worked, but I see what you mean now. Just need to add in and EndScene script.
 
Last edited:

Sheklon

Veteran
Veteran
Joined
Jan 28, 2020
Messages
59
Reaction score
22
First Language
Portuguese
Primarily Uses
RMVXA
in MZ we can store Last Target Actor ID in a variable...
Change Variable -> Operand Game Data -> Last -> Last Target Actor ID
to store the target actor id in a variable...
Oh, I didn't remember that. That's quite convenient. @Riku_Masamune should do this way instead, then.

@estriole offered a nice alternative that you should probably use, but I'll still explain what I did just to give you an insight. It's good to know different methods of doing the same thing because you acquire familiarity with the engine.

Well I found the plugin since I couldn't get the variables and common eventing to work to my liking. But I will remain adamant about finding out how to get this to work without the plugin, since the only downside is that it doesn't say [X] learned [skill]. But thank you nonetheless.



Thank you for trying to help, but I couldn't get it to work... could be my lack of actual variable knowledge. Everything I tried and suggested, even the other picture you posted, couldn't exactly get it to work as it still leveled the entire party.
Okay, so I'm doing this in VXA because it's the only RM I have installed right now, but it should work the same in MV (at least the damage formula seemed to be the same when I tested the trial).

The first step is to make the item deal damage, only it's a "fake damage" (the 0 in the formula I sent above), because what you actually wanna do is get the actor ID ("b.id") of the hero which the item is being used on.

What the formula I sent means is basically:
Define variable X as the target; then deal 0 damage.

Now you can check the print I attached to see how to set the item in the database. Notice that I used X as "1" because, on the above screenshot, I'm using variable 0001 to define "Character".
 

Attachments

  • Lvl Up Item.PNG
    Lvl Up Item.PNG
    22.1 KB · Views: 4

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
With the power of plugins, (almost) anything is possible!

If you want that level up message, you could dive into the plugin's code and change the line
Code:
this.changeLevel(this.level+1,false);
to
Code:
this.changeLevel(this.level+1,true);

If you do this, once you use the item and back out of the menu, the leveled up message will appear. It's not perfect, but I think that's what you want? (See if it works for your game. I'm using Visustella plugins so it's possible I have a bit of a different experience).
in MZ we can store Last Target Actor ID in a variable...
Change Variable -> Operand Game Data -> Last -> Last Target Actor ID
to store the target actor id in a variable...
let's say we store it to variable 7.

then we also need some check does the actor max level or not... can be using
Conditional Branch -> Script:
Code:
$gameActors.actor($gameVariables.value(7)).level < 99
don't forget to add else branch...
then put inside the true condition

Change Level -> Variable 7 -> add 1 lv
instead of Fixed actor ID.
remove the rare candy item -1

at the else branch... add some notification that the actor level is maxed...

this is the screenshot example:
item rare candy: (make it NOT consumeable since we will remove it manually at common event)
View attachment 169073

common event rare candy:
View attachment 169074
i use variable 7 to store the target actor id.
the level up message is also using escape code
\n[\v[7]] Level UP !!

hope this help

edit: this also did not show X learn Y skill message though...
it's possible to show learn skill using combination of event + script call... but not recommended for beginner... better use plugin instead...

This did the trick! Thank you, and I did the show level up option for conveniences sake on the player to let them know they learned something.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,374
Reaction score
615
First Language
indonesian
in case someone still want to use eventing + script call to show the learned skills... here's the improved version of the common event:
1606373213715.png

since it's quite long here's the bottom part:
1606373336551.png

in that common event example i use:
variable 7 -> to store Last Target Actor ID
variable 8 -> to store ALL SKILLS LIST learned at that level
variable 9 -> to grab one skill from variable 8 to show in the text
variable 10 -> i use this to store the level raised to what number so we can show it as
Reid level up to level x

if you're confused... alternatively you can grab my plugin demo here...
i put the common event there and you can copy it. (and change the variable according to your project)
 

Riku_Masamune

Veteran
Veteran
Joined
Aug 23, 2016
Messages
50
Reaction score
19
First Language
English
Primarily Uses
RMMZ
Thank you again. It is good to know I was on somewhat the right track when I made this item in MV. But really wanted it to work on just one (without editing the core files to add in LV in the other default growth). But I didn't know about the change in variable targets in MZ, so thank you again very much; to everyone who helped and assisted too!
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,783
Reaction score
4,726
First Language
English
Primarily Uses
RMMZ

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.

Latest Threads

Latest Posts

Latest Profile Posts

I'm moving on from RMXP finally. I've been stuck in a difficult decision between XP and MZ, and I've given up and moved on to MZ. Overall I'm really liking it, I wish tilesets were easier to setup like XP, but it's actually not that bad!
Have you ever gone full 'Ship of Theseus' while frankenspriting? Because I just did.
I saw my new eye doctor today, he reminds me of Satoru Iwata for some reason
I've been using a modified version of a script called Multiple Messages. It makes my text boxes look like a Mario & Luigi game! There is something about it that bothers me a little bit, but I shouldn't worry about that now.

Side note, Mist's walking animation is almost perfectly in sync with Loose Yourself by Eminem.
Starting work on some stuff for the community. Hopefully it will be fun, and useful to somebody.

Forum statistics

Threads
107,771
Messages
1,032,026
Members
139,914
Latest member
smudge
Top