Increase Level up price using switches help

Status
Not open for further replies.

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
682
Reaction score
2,046
First Language
English
Primarily Uses
RMMV
I wanted my project to have a feature where instead of leveling up immediately after battles, they'd just use the currency to do so anytime they want (similar to Code Vein). So, I want to know how can I change the price amount the more the player level up?
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,438
Reaction score
4,492
First Language
English
Primarily Uses
RMMV
How do you set the price? And how does your system work? Do you do everything through eventing? You could set a formula that would put the price into a game variable:
Code:
var price = 500 * $gameParty.members()[0].level;
$gameVariables.setValue(10, price);
If you use this as a script call, you can easily change the price formula. Change the 0 in the [ ] to the index of the party member (the order in the party). Change the 10 on line 2 to the variable you want to use.
 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
122
Reaction score
148
First Language
French, German
Primarily Uses
RMMV
You can use the EXP curve to define the cost. Since you'll be using money instead of EXP, why not pretend EXP = money?

To find out how much EXP you need to level up (and therefore how much money to spend to level up):
Code:
Control Variables : #0001 = $gameParty.members[0].nextRequiredExp()
This is for the first member in you party. For the second member, use members[1] instead of members[0]. And so on.

Finally, you can simply use the Event Commands:
Actor -> Change EXP...
or
Actor -> Change Level...
to increase your characters' level or experience.

Which one you choose depends on how you want your player to spend their money.
If they should spend the full amount to level up, use "Change Level..."
If they can invest little by little to level up, use "Change EXP..." instead.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
682
Reaction score
2,046
First Language
English
Primarily Uses
RMMV
I'm sorry that it took me centuries to respond!
@Nolonar
I'll just use the Code in the Common Event list and set the trigger to parallel?
EDIT: Stupid question, and it worked beautifully! Thank you so much!
EDIT2: Should I set the variable's operation to set, or add?
 
Last edited:

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
122
Reaction score
148
First Language
French, German
Primarily Uses
RMMV
I'm sorry that it took me centuries to respond!
@Nolonar
I'll just use the Code in the Common Event list and set the trigger to parallel?
EDIT: Stupid question, and it worked beautifully! Thank you so much!
EDIT2: Should I set the variable's operation to set, or add?
You should use "set", not "add", otherwise the cost would increase every time the player wants to know how much a level up will cost.

"How much to level up?"
"500 Gold."
"Ok, wait a minute."
* 1 minute later *
"I want to level up, here's 500 Gold."
"1000 Gold."
"You said 500 Gold back then."
"1500 Gold."

:kaoback:
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,382
Reaction score
1,567
First Language
English
Primarily Uses
RMMV
You should use "set", not "add", otherwise the cost would increase every time the player wants to know how much a level up will cost.

"How much to level up?"
"500 Gold."
"Ok, wait a minute."
* 1 minute later *
"I want to level up, here's 500 Gold."
"1000 Gold."
"You said 500 Gold back then."
"1500 Gold."

:kaoback:
The 2004 demo of my game actually had something like this when the main character is accosted by a couple of inept bandits demanding money from him. The amount keeps going up every time you refuse unless you do so like 20 times, at which point he gets fed up of arguing and just takes 5 gold off you.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
682
Reaction score
2,046
First Language
English
Primarily Uses
RMMV
@Nolonar
Actually, I want the EXP price increase the more they level up so, I think add is the right answer in my case ^^"
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,029
Reaction score
4,770
First Language
Dutch
Primarily Uses
RMXP

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

How do you cure sleep problem? It has been 7 months and it's 3 AM now..
Darn you, Seals! Why do you gotta be so cute when on land?:kaoluv:
So dragonbones getting laggy xD
I even removed the fingers armatures.

Have to remake this guy after crashing ( corrupted file).
:rtear:

Although limited to only this shop for room decorations, I like this aspect for previewing items.
So yesterday I got a follower (follow my NSFW art account) who dmed me and said to me :
if you continue to be friends with [name of the artists] which make me uncomfortable I will have to unfollow and I am like :
... do it?

Forum statistics

Threads
100,837
Messages
980,122
Members
132,487
Latest member
AnthonyDewitt
Top