playMaker

Author Topic: Picking up invetory items and dropping them  (Read 3961 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Picking up invetory items and dropping them
« on: January 04, 2016, 06:31:11 PM »
Last year I tried to set up a simple inventory system where the game only lets you pick up 2 items to unlock a door. Here's what a thought recently...

So you have a inventory system that picks up items right? What about picking up objects/items then discarding item or drop them. Like ammo being limited and could be easily used up. Or acquiring items that could be placed in the game physically.

Is there a solution for this with int actions or arraymaker?

Thanks.


phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: Picking up invetory items and dropping them
« Reply #1 on: January 05, 2016, 06:33:28 AM »
Sure, PM is flexible to do that but you need to build the logic yourself of course - there are no "preset" Inventory modules. That said I used several Arrays on my last Inventory attempt Storing different Values of an Item the Array ID was lined up with the Inventory Slot ID - so I could look what object is in a certain Slot of the inventory and what Values/Attributes it had. According to those values you could easily spawn an "real" object once you drop something outside your Inventory.


Some tools might be helpful though like GDE (Game Data Editor) to simplify your array management a little. It can get pretty complicated fast - i.e. switching two Items in  the inventory, special inventory slots that only accept certain types of objects (i.e. ammo) or limiting stacks etc.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Picking up invetory items and dropping them
« Reply #2 on: January 05, 2016, 04:17:26 PM »
Sure, PM is flexible to do that but you need to build the logic yourself of course - there are no "preset" Inventory modules.

Putting paid assets aside, what would that mean for something as simple or limited like just picking up items where there isn't a whole "inventory GUI" system. For example, your prototype game.

My goal is to create a system where the player picks up items that they can use via scroll wheel of a mouse to select a item before they can drop it as oppose to displaying a GUI inventory menu.

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: Picking up invetory items and dropping them
« Reply #3 on: January 06, 2016, 07:24:36 AM »
I don't understand what your question here is really. Even if you don't have the GUI representation of the Inventory that might just save you from the Inventory interaction handling or simplify it.
But besides that you still need to store/handle your picked up objects somehow. So a thing that works well is storing them in an Array (or several) you can also set them as "child of gameobject XYZ" so you could have an unsorted group of objects but that might be harder to carry between two gamesessions. There are various ways to address this and that's all pretty doable within Playmaker.

If you asking me to figure it out for you I'm sorry, don't got the time for it right now to make an example tutorial for this.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Picking up invetory items and dropping them
« Reply #4 on: January 06, 2016, 10:48:01 PM »
I don't understand what your question here is really. Even if you don't have the GUI representation of the Inventory that might just save you from the Inventory interaction handling or simplify it.

You know how in car combat games or FPSs you had to press a button to switch weapons after picking up ammo? That's what I mean compared to pausing the game and selecting items from an inventory menu.

But besides that you still need to store/handle your picked up objects somehow. So a thing that works well is storing them in an Array (or several) you can also set them as "child of gameobject XYZ" so you could have an unsorted group of objects but that might be harder to carry between two gamesessions. There are various ways to address this and that's all pretty doable within Playmaker.

Putting aside setting children on the player(parent). Don't understand how a manager that communicates with the player or another FSM added could use arraymaker actions to drop a item that the player previously picked up and stored to their inventory.

Have a difficult time wrapping my head around it, especially when it comes to the Start global transition.


phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: Picking up invetory items and dropping them
« Reply #5 on: January 14, 2016, 04:33:34 AM »
You know how in car combat games or FPSs you had to press a button to switch weapons after picking up ammo? That's what I mean compared to pausing the game and selecting items from an inventory menu.

it's not limited to pausing the game - you could easily have "hotslots" with items in there to be used/switched durring play

Putting aside setting children on the player(parent). Don't understand how a manager that communicates with the player or another FSM added could use arraymaker actions to drop a item that the player previously picked up and stored to their inventory.

Have a difficult time wrapping my head around it, especially when it comes to the Start global transition.

i.e. you can recreate the Gameobject from a pool object or prefab once it is selected using the arrays containing data.

Vâel

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Picking up invetory items and dropping them
« Reply #6 on: October 03, 2017, 08:45:35 AM »
Hey there, I made up Inventory like on the video but I have no clue how to to do swap item or change slot.

Some help will be appreciated.

Thanks