Increase Level up price using switches help

Status
Not open for further replies.

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
663
Reaction score
2,001
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,426
Reaction score
4,483
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
663
Reaction score
2,001
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,374
Reaction score
1,550
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
663
Reaction score
2,001
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,006
Reaction score
4,744
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 Posts

Latest Profile Posts

*sigh* I'm so sick of this heat! :kaosigh::kaoeh:

Between Rona and MZ, might as well buckle down and get serious in dev
I did it. I finish the test after 2 days 6 different subjects. Now I'm freeeeeeee
Got a nice little platform coming along backwards compatible with MV.

Forum statistics

Threads
100,659
Messages
978,202
Members
132,280
Latest member
ju9SW
Top