How to lose items and money on game over

Status
Not open for further replies.

VesperCire

Veteran
Veteran
Joined
Feb 9, 2016
Messages
36
Reaction score
1
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,890
Reaction score
1,279
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
36
Reaction score
1
First Language
English
Primarily Uses
RMMV
Alright thanks, it worked.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,050
Reaction score
4,260
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

Kingdom Under Fire: The Crusaders is finally being ported to PC. I loved playing that game on the original Xbox.
A friend told me to stop making nomnom or gulping noise when eating or drinking. Plot twist of my life. I thought people can't hear that!
Inside you are two wolves. They take in oxygen while getting rid of the Co2 gas in your body...
Ah wait, sorry. Lungs. Not wolves. that'd be silly. Wolves are huge. You probably couldnt even fit one wolf inside you.
Tag: hack and slash | gameplay: point and click. Me: "How tf two are related to each other?"

Forum statistics

Threads
94,406
Messages
920,721
Members
124,194
Latest member
kasaoli
Top