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,151
Reaction score
6,300
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,151
Reaction score
6,300
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
472
Reaction score
265
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,151
Reaction score
6,300
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
160
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,151
Reaction score
6,300
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
160
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
507
Reaction score
317
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

Nosey aren't ya?
Veteran
Joined
Feb 11, 2017
Messages
111
Reaction score
209
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 Profile Posts

imgur sure is getting weird, one day I lose gradually all my images, the other I get them back randomly and then again they disappear again.
Despite OPT2 praise it still has some strange stories in it. Lady Mikka is trying to work herself to death because of guilt. Guilt over what? ¯\_(ツ)_/¯ So instead of finding a NPC to have a heart to heart with her they decide the cure is a new kimono. So when she drops dead she'll at least be well dressed. I haven't even got to the strange part yet.
Did so much work on the game today. I wish I could post it all in this status update but there is a character limit of course haha. I thought about making a topic for updates, though... maybe.
The most recent sign that I am old. I have done martial arts for over 4 decades. Never HAD to stretch out. Good, of course, but never required. Was doing some kicks in the kitchen because, why not, and I felt a pop in the back of my thigh. Now I am limping around. Gotta love getting old.
One of the biggest perks of being fluent in English is how many new and interesting recipes I am able to find and try out that I would have hardly come across if I just spoke my mothertounge :3

Forum statistics

Threads
131,683
Messages
1,222,225
Members
173,435
Latest member
TheAmplifier
Top