Increase Level up price using switches help

Status
Not open for further replies.

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
663
Reaction score
1,996
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,421
Reaction score
4,480
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
1,996
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,371
Reaction score
1,537
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
1,996
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,001
Reaction score
4,743
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

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,611
Messages
977,813
Members
132,227
Latest member
YourBaka
Top