Jump to content

World Interaction Week - Holding Items and Placing Items

Recommended Posts

Hey Folks,

So the next thing I want to setup is holding items. If we want to place items it makes sense that we'd need to be able to hold them. I haven't really thought about how we should do this but I'm going to spitball here and see what captures us. The Player Handler only does a few things currently:

  1. Saves and Loads Player Data.
    1. This actually also includes WORLD data as well currently, just out of convenience.
  2. It tracks the player position and updates that positional data.
  3. Contains the various artifacts critical to the game running so that they can be saved and loaded to.

That's not much, in fact 1 and 3 are basically the same thing. I think the lean nature of the player handler is very ideal. I'm going to try to not sully this in the long term.

And just as I'm writing this I realize I'm forgetting about another class on the Player Object. Our Player Input Handler takes care of all the KBM or Controller inputs of the human player. Well maybe Human, maybe cats will ant to play this, I don't judge. Regardless, we have a class that handles this information. I worry that this class has gotten far too big, basically the inverse to our player handler's lean nature.

So what we can do is create an HandlerInteractorPlayer component, this will be the container that houses all of our interactor logic. Likely including rulings like "open handed" or similar. It will also pipe the "currently held item" back and forth from the player data inside the player handler. We can connect this to our Player Input Handler with an artifact like everything else.

From there we can communicate player inputs through the interactor. This does leave me wondering if I want to break up the player input handler into some ScriptableObjects rather than multiple components. This would be easier to pipe into a game menu elsewhere. Perhaps that will be our first experiment this coming week.

I think we'll go this route, make the base class with all our functionality then contain it within an artifact. Sure...ok. For now I think we only need to track what item that is selected. For now that can be handled with some keyboard commands, but later will likely be h...oh! I'll have it be the number row, maybe this will be a good time to put in a dummy UI for your inventory quickbar.

Fun! Ok, that's it then. See you this coming week!

Link to comment
Share on other sites

  • Create New...