Trevaz

Villager
Member
Joined
Nov 9, 2022
Messages
9
Reaction score
2
First Language
portuguese
Primarily Uses
RMMV
Is it possible to create a system in RPG Maker that leaves all the player's gold at the point where he died?

For example, the player carries 50 gold, when he dies he will have 0 and he will have to go back to the point where he died to recover it.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,019
Reaction score
6,008
First Language
English
Primarily Uses
RMMZ
This is entirely possible, but it may be best to use a script/plugin that supports event spawning so that you can create an interactable gold object that'll give your original money back.
 

Trevaz

Villager
Member
Joined
Nov 9, 2022
Messages
9
Reaction score
2
First Language
portuguese
Primarily Uses
RMMV
This is entirely possible, but it may be best to use a script/plugin that supports event spawning so that you can create an interactable gold object that'll give your original money back.
Maybe it can be done using only conditional events, but how to store the amount of gold?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,019
Reaction score
6,008
First Language
English
Primarily Uses
RMMZ
Maybe it can be done using only conditional events, but how to store the amount of gold?
You can set a variable to the player's gold amount using the game data operand.

It is theoretically possible with conditional events, but you'd need a "lost gold" event on every map and when you place a new one you'd have to unset every other one so you don't end up with multiple piles.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
453
Reaction score
254
First Language
English
Primarily Uses
N/A
You could repurpose map vehicles if you're not using them. Because their location can be set and save on any map.
So you can set a vehicle to the player's death point.
When the player returns to it, you could have a common event as a parallel process watching to see if the player ever gets "on" a vehicle. Then just clear the vehicle, and acquire lost gold and whatnot.

I don't recommend using the [on/off vehicle] event command. If you've ever done it outside of water, the player will zip to the nearest edge. Which is surprising. With the airship, the game can lock up getting on and off simultaneously.
So instead, I'd use a script call inside the conditional branch that checks if the player is on a vehicle
JavaScript:
$gamePlayer._vehicleGettingOn = false;
$gamePlayer._vehicleGettingOff = false;
$gamePlayer._vehicleType = "walk";
This way the player character will walk onto the vehicle, but not appear to board.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,019
Reaction score
6,008
First Language
English
Primarily Uses
RMMZ
You could repurpose map vehicles if you're not using them. Because their location can be set and save on any map.
So you can set a vehicle to the player's death point.
When the player returns to it, you could have a common event as a parallel process watching to see if the player ever gets "on" a vehicle. Then just clear the vehicle, and acquire lost gold and whatnot.

I don't recommend using the [on/off vehicle] event command. If you've ever done it outside of water, the player will zip to the nearest edge. Which is surprising. With the airship, the game can lock up getting on and off simultaneously.
So instead, I'd use a script call inside the conditional branch that checks if the player is on a vehicle
JavaScript:
$gamePlayer._vehicleGettingOn = false;
$gamePlayer._vehicleGettingOff = false;
$gamePlayer._vehicleType = "walk";
This way the player character will walk onto the vehicle, but not appear to board.
I thought of the same thing but I figured it might cause some weird graphical issues.
 

GmOcean

Veteran
Veteran
Joined
Nov 29, 2020
Messages
195
Reaction score
159
First Language
English
Primarily Uses
RMMZ
I feel like a single event on each map, using autorun checking for a switch and comparing variables, and a single common event handling the switch and a variables would suffice.

When the player dies, flip switch_1 ON. The common event will then write to variable_1 the RegionID of the top-left tile. Next, store the players gold into Variable_3. Then the common event flips switch_2 ON, and turns switch_1 OFF.

On every map, the top-left corner should have a different region ID, 1 for map 1, 2 for map 2, etc..
Then in that same spot put an event that is set to auto-run and the look for switch_2. It'll then write to variable_2 the RegionID of the top-left tile. Next, it'll run a conditional branch to check if Variable_1 == Variable_2. If it does, move the event to the location of the player, turn Self-Switch A ON. If it doesn't, erase the event. Then on the event page that is listening for Self-Switch A, you just change it's sprite, make it same as chracter, and action trigger. Then you make it give the player gold that was previously stored in variable_3. Lastly, turn switch_2 off and erase the event.

I'm 99% certain this should work and would allow for 255 maps (since that's the regionId count by default). Not at my project station so I can't test it.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,019
Reaction score
6,008
First Language
English
Primarily Uses
RMMZ
I feel like a single event on each map, using autorun checking for a switch and comparing variables, and a single common event handling the switch and a variables would suffice.

When the player dies, flip switch_1 ON. The common event will then write to variable_1 the RegionID of the top-left tile. Next, store the players gold into Variable_3. Then the common event flips switch_2 ON, and turns switch_1 OFF.

On every map, the top-left corner should have a different region ID, 1 for map 1, 2 for map 2, etc..
Then in that same spot put an event that is set to auto-run and the look for switch_2. It'll then write to variable_2 the RegionID of the top-left tile. Next, it'll run a conditional branch to check if Variable_1 == Variable_2. If it does, move the event to the location of the player, turn Self-Switch A ON. If it doesn't, erase the event. Then on the event page that is listening for Self-Switch A, you just change it's sprite, make it same as chracter, and action trigger. Then you make it give the player gold that was previously stored in variable_3. Lastly, turn switch_2 off and erase the event.

I'm 99% certain this should work and would allow for 255 maps (since that's the regionId count by default). Not at my project station so I can't test it.
That seems overcomplicated for a system that will only really serve to limit your max map count to me. I'd probably use a notetag in the name field and a self switch on the gold events and then just have a placement common event that turns off that self switch on all events with that tag before placing the current one. Then you wouldn't need to worry about region ID limits.
 

GmOcean

Veteran
Veteran
Joined
Nov 29, 2020
Messages
195
Reaction score
159
First Language
English
Primarily Uses
RMMZ
That seems overcomplicated for a system that will only really serve to limit your max map count to me. I'd probably use a notetag in the name field and a self switch on the gold events and then just have a placement common event that turns off that self switch on all events with that tag before placing the current one. Then you wouldn't need to worry about region ID limits.
Yea it's a bit complicated, but I was trying to go for a method that wouldn't require any script writing of any sort. Mainly because I can't recall the proper $gameX or $dataX to grab the information. I usually have to mess around on the console to get that information. Can't remember them by heart yet.
 

KawaiiKid

Local Weeb
Veteran
Joined
Oct 13, 2015
Messages
457
Reaction score
277
First Language
English
Primarily Uses
RMMV
I have this exact system a side project I've been working on: https://voidmoon-studio.itch.io/the-depths-of-delmora

Basically, if you die it drops all your essence (gold) into a glowing orb that shows up on the map exactly where you died. If you recover it without dying by interacting with it, you gain 1/2 your essence back and the orb disappears. I did this all with just eventing, and the only convoluted thing was having the glowing orb event having to be event #1 on every map.
 

TESTOSTERONE

Villager
Member
Joined
Feb 11, 2017
Messages
22
Reaction score
17
First Language
English
Primarily Uses
RMMV
and the only convoluted thing was having the glowing orb event having to be event #1 on every map.
^ that's actually a pretty clever way of doing it without any scripting.
 

Latest Threads

Latest Posts

Latest Profile Posts

So... me, always ALWAYS late.. have started reading the One Piece manga. So far I'm impressed with it. It's definitely a fun read. The only thing I need to get used to is every... single... character having a flashback story. Wifey is a huge fan and she's asked me to draw Nami and Boa Hancock for her. So I may post those drawings here XD
My brother makes some inane complaint about one of my stories in the comment section. My mom: if your bro doesn't understand it make it simpler. That prolly means others have questions too.☺️Me: Sorry. I can't do that. I don't speak stupid.
If you are ever looking for your cat among a room full of identical looking cats just find the one that is doing it's best to ignore you.
Isn't "tableau" such a fun word to say? Even better is that our resident artists know what it means without google and probably get to say it regularly.
ScreenShot_3_27_2023_4_30_39.png
one of the benefits of doing almost all the assets myself is being able to add my friend's OC from his comic book into my game as an NPC.

Forum statistics

Threads
129,894
Messages
1,206,047
Members
171,074
Latest member
BleedingBrimstone
Top