How to lose items and money on game over

Status
Not open for further replies.

VesperCire

Veteran
Veteran
Joined
Feb 9, 2016
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMMV
Not much too much to elaborate on from my title. but I'll make a few things a bit clearer. What I want is that when the player receives a game over, they will lose random items (excluding key items, armor and collectables) and a percentage of money. Is there any way to do this?
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
You can achieve this with a plugin, a couple of variables and some eventing. First, add Hime's Game Over Events plugin into your project. Now when the player dies instead of kicking them back to the main menu, it'll play a common event and you can customize it from there. Now make two variables: One for grabbing the ID of items and another for random numbers. Now for the item variable, you'll have it pick a random number from whatever the starting of your consumable items start to the end of them. Create conditional branches that will correspond to the item ID variable's random numbers. You'll make one for each item. Inside those branches have the second variable run a random number for how many items you want the player to lose. Under that place the item for that branch and have it decrease by the second variable. Now you have the basic setup for losing random items.
For money, you can do that with a single variable. Create a Gold Check Variable and have it check the party's current gold amount. Then multiply that variable with the percentage number you want taken away. Now divide that variable by 100. After that set up the Change Gold to take away gold by the amount of that variable.
 

VesperCire

Veteran
Veteran
Joined
Feb 9, 2016
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMMV
Alright thanks, it worked.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,010
Reaction score
5,316
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 Profile Posts

Woo! Getting another xray today. Much fun, very irradiated.
If the universe is so big then why won't it fight me?
Does anyone know the name of the game where you play as someone called the batter? I can't remember the name of the game...
Got my R-Tree working /o/


Also here's what it looks like in memory (kind of):


The label on the nodes is the bounding box for all the objects it contains (in this case, the rectangles that make up the walls on the room).
"He, who wields the Excaliburn, will shine brighter than the sun itself, only his will can light up the flames of life"

Forum statistics

Threads
107,351
Messages
1,029,019
Members
139,432
Latest member
OhMeGa
Top