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

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
12,002
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,150
Reaction score
10,714
First Language
Czech
Primarily Uses
RMMV
Or if you want a faster way, use Script command:
Code:
$gameParty._gold /= 2;
 

Latest Threads

Latest Posts

Latest Profile Posts

It does sometimes get a little embarrassing that I often come here to ask for help with something and seldom have anything to actually show for it. If there is one thing though I can commend myself for, it's for sticking with an idea I've been tinkering with for this long now and gradually making headways. Even though I've been reserved about my progress, I can say I'm farther now than where I initially started.
I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!
Haven't been on here actively in awhile, project is going strong my biggest issue is the STORY, i'm refining the plot and learning so much i decided to take a writers class to improve even more but the programming and functionality of the game is stepping up nicely!
Hi everyone! Here's what I'm working on today! It's one of the dorms on campus. I know I said I wouldn't use assets but I reused a few things from the cafeteria hehe.
FCuxBOMXMAICK5e

Forum statistics

Threads
116,127
Messages
1,096,000
Members
151,545
Latest member
Asleen
Top