Nursing Sim: removing medication from inventory when used

LadyAdelaide

Warper
Member
Joined
Jan 23, 2017
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Hey!


I'm making a Nursing Simulator and I'm struggling with a key mechanic.


After the player adds various "medicines" to their inventory as items I want them to be able to:


1. Go a patient, select the medicine needed, select the quantity needed and


2. Have those items and quantities removed from their inventory.


As you can imagine this is a pretty big key mechanic for a nursing simulator. But I am struggling to wrap my head around how to do this.


I feel as though once this is done everything else will flow nicely.


Do you have any idea on how I may tackle this?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Set it up as a key item in the database.  On the event, use the Select Key Item event command and choose a variable.  It will put the item id the player chooses into the variable.  Then use an Input Number command so the player can put in how many they want to use.  Use a second variable for that one.  Now you can do a Change Items to decrease that item by the variable the player put their number into.  You might have to do a conditional branch to check the item id, because Change Items doesn't let you use a variable to select the item to be changed.


Also you have to think about whether you want to limit how many the player can choose.  If you only have 5 and they say to use 10, you can decrease it by 10 and it'll go back to 0 (not -5), but if you want to do something else based on how many they used, you want to use 5, not 10.  For this, you can do Control Variables with a third variable to set it to how many of the item they have in inventory.  Then a conditional branch to see if that is equal to or more than what the player entered.  If it's not, you can either show them a message and go back to the number input, or just set it to how many they have.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
two ways - for single items, just make them consumable.


For multiple items, use control variable and input number to get the numbers you want, then conditional branch together with control variable to find out if the player has enough of them, and lastly change item with control variable to set the number of items to remove.


As you can see, a lot goes around with control variable, one of the most powerfull commands in the game engine.


If you don't know how to use it, follow the link to the starting point in my signature to get to the basic tutorials, especially the variables guide.


Edit: ninja'd
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top