Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Request: Food bag system

Cait

Member

I got an idea for a food bag system. You would have three bags you can get through the game: small, medium, and large and each bag would have a set limit on what you could hold. The whole point is have a set amount of food to give you MP (as I call it in my game: KI), and thus you can't just use whatever power you have randomly.

I am in the middle of trying to create a system for a food bag. There should be three bags with a set limit as to what it can hold. When you use it, it should fill up your MP points and when it's empty, you will go to a food vender to refill it. I would like the ability for you to select between CHECK and USE. I assumed that I could use it through common events, and item menu, but I am suspecting that I will need a script instead.

SMALL BAG = 100
MEDIUM BAG = 400
LARGE BAG = 600
Food decreases by one, two or five each use (I haven't decided on a set #)

Way to have the bag empty or full, plus the vendor to fill your bag

I thought I could do that through variables, but it doesn't work.
 
Here's how to do it in common events.

You just need 4 variables for this. :)
1 - Bag which holds food
2 - UseFromBag which dictates how much is used from bag
3 - BagSize which is only used for replenishing the bag
4 - MPReplenisher which will fill your party's MP depending on how much food they use from bag,
I've set it to Used Food * 10

This is one common event, call it something like Open Bag.
Code:
 

Label: start

Text: The Bag is open.

Show Choices: Check, Use, Close Bag

 : When [Check]

    Text: There is \v[1] food in the bag.

    Jump to Label: start

 : When [Use]

    Label: too_much

    Conditional Branch: Variable [0001: Bag] == 0

    Text: We have no food!

    Jump to Label: start

    : Branch End

    Text: How much will we take?

    Input Number: [0002: UseFromBag], 1 digit(s)

    Conditional Branch: Variable[0001: Bag] < Variable [0002: UseFromBag]

        Text: We don't have that much!

    Jump to Label: too_much

    : Branch End

    Conditional Branch: Variable [0002: UseFromBag] > 5

    Text: We can't take that much!

    Jump to Label: too_much

    : Else

    Control Variables: [0001: Bag] -= Variable [0002: UseFromBag]

    Control Variables: [0004: MPReplenisher] = Variable [0002: UseFromBag]

    Control Variables: [0004: MPReplenisher] *= 10

    Text: Your party restored \v[4] MP.

    Change SP: Entire Party, + Variable [0004: MPReplenisher]

    Jump to Label: start

    : Branch End

  : When [Close Bag]

  

  : Branch End

 

As for Refilling the bag create another common event like this

Code:
 

Conditional Branch: Variable [0003: BagSize] == 1

  Control Variables: [0001: Bag] = 100

Branch End

Conditional Branch: Variable [0003: BagSize] == 2

  Control Variables: [0001: Bag] = 400

Branch End

Conditional Branch: Variable [0003: BagSize] == 3

  Control Variables: [0001: Bag] = 600

Branch End  

 

And that's it. You really shouldn't use scripts for these things. :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top