Jump to content

World Interaction Week - Action Bars

Recommended Posts

  I've added a new data collection to the player data. We've now got 12 slots available for an action bar. These are IDs that would match up with items in our item catalog. So now, lets think about how the interaction will work for the next code pass tomorrow.

  First I'll just set the keys by hand to match a few of the items we support. Then we'll hook up the input tracking for 1-12. If you press one of these items then we'll print out the item in that slot. I also need to add an integer to the player data that tracks the "current" item. Have it default to 0, but otherwise it'll be whichever number you pressed last. Just added that before I forget.

  So you press a key, we set the "current" item, then we need to pass this information to some kind of processor. Perhaps that's what we'll call this as opposed to a Handler. I suppose its really just two words for the same thing. But I kind of feel like Handler's are monobehaviors and I would like a ScriptableObject to take care of this.

  That object will reside on the input controller because that's where we get all of our input information. Then pipe in the index to the "Select item" function.

  The SO will hold an artifact reference to the player and the item catalog. In this way it can set and get the index that was chosen on the player for saving and loading. It can also cross reference the GUID stored in that spot with the catalog to get all the item data.

  From there I need to raise an event for Holding a particular item. I'm not sure what kind of class will handle this yet, but it will be dedicated to the player holding items to use for interactions.

  Now that I think about it...our game actions on items will be really useful for this. I can have items do various things like heal, water plants, or so on. Nice! I'm glad when past me is looking out for future me. I think this is sufficient guidance for tomorrow.


Link to comment
Share on other sites

  • Create New...