Lose half Gold

caiopalhares

Villager
Member
Joined
Feb 18, 2018
Messages
8
Reaction score
7
First Language
English
Primarily Uses
RMMV
Hi guys,

Beginner here, so apologies if the question is basic.
I'm trying to make the player lose half its gold, on an specific event.

How do I do that? I didn't quite work out how gold and variables work together.

Thanks in advance,

Caio
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,453
Reaction score
10,858
First Language
English
Primarily Uses
RMVXA
Select Control Variables, choose a variable you are not using. I have 5 variables called TEMP 1, TEMP 2 etc for such things if they are one-offs. However, if this is something that will run more than once it is better to have a dedicated variable switch for it, in which case, name it so that you don't accidentally use it for something else as well.

Select 'Game Data' and click on the ... at the end.
Select 'Other', then Gold from the drop down menu.
This sets the variable to the amount of gold the player has

New event command, select that variable again.
In the 'Operation' choose Div
In the 'Operand' chose 'Constant' and enter 2
This divides the amount of gold by 2

New event command, 'Change Gold'
Select 'Variable', then the switch you've just been working with.

Done. When the event runs, it will take half the gold.

EDIT
I strongly recommend that you have a look at Andar's excellent compilation of info for new users. There you will find a link to a playable tutorial on Switches and Variables.
 

caiopalhares

Villager
Member
Joined
Feb 18, 2018
Messages
8
Reaction score
7
First Language
English
Primarily Uses
RMMV
Thank you so very much for the quick response.
It worked like a charm.

Have the best of days!
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,039
Reaction score
10,258
First Language
Czech
Primarily Uses
RMMV
Or if you want a faster way, use Script command:
Code:
$gameParty._gold /= 2;
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I'm play DQ:XI DE in 2d mode with the synthesized soundtrack, the only way a RPGMAKER creator should play it. :D
:/ it really get on my nerves reading stuff about how to write a resume and they say things like "turn your failures into wins!!!" ... no interview Ive ever had cared to hear anything about my failures, and why would they :( ?
"Huh? You haven't backed up yet? *menacing stare* "
Been having a lot of fun playing Hearts of Iron IV. Had to restart a few times, but now I've finally conquerd Europe with my Axis friends, and am currently invading the Soviet Union.
Guess I'll rework all the existing screens in my game. Except of the save/battle screen. For this I will be lazy and use Yanfly. With my current pace it'll take a few months.

Forum statistics

Threads
93,632
Messages
914,144
Members
123,221
Latest member
Luspeon
Top