Making a RPG video Tutorial question
So I've been following a video tutorial series on YouTube about making a RPG. It has a really awesome structure in place for managing equipment, and interactions with objects in the scene. I'm hoping to incorporate stuff from the series into my project. Something that I'm realizing about this series is that it is structured so the inventory management supports a single player character in a scene. For what I'm doing I'd like for it to support more than just one player character in a scene. It uses a semi singlton design to handle the inventory. What I'm looking to do is make it more dynamic, my thought is to be on each player character in the scene. I'm not sure how to approach this, or if its even possible in terms of feasibility. If anyone has suggestions to point me in the right direction.
And furthermore if it is possible how could I then save the equipment of player characters between scenes?
Below is the link to the YouTube series. [link text][1] [1]: https://youtu.be/HQNl3Ff2Lpo
Answer by Alanisaac · Dec 24, 2017 at 04:27 PM
You're on the right track! If you want more than one player character to have inventory, one way to do it is to simply have each character have an instance of the Inventory class. Take the inventory class that is in that video, but instead of creating the singleton logic, add a public Inventory
field to the script for your player. Then in ItemPickup
, you'll need a way to tell which player is picking up the item, so you can get the right Inventory
to place the item in.
As for persisting stuff between scenes, check out this StackExchange post, it's super helpful.
Thanks for your response! I'll definitely give that a try. If that works out, I'll just need to figure out my next dilemma. Long story short I have one scene that will be the world map. Which is a grid of Hexagonal cells. Each cell is played separately from the world map. It currently allows just that, what I would like to make it do in addition is to base the environment separate from the world map according to the position on the world map.
Your answer
Follow this Question
Related Questions
Visual studio debugging [Unable to step. Array subscript out of range.] 1 Answer
Why debugging menu is grayed 0 Answers
How do you execute code every X angles reliably? 2 Answers
Is there a way to "Dubug.Log" which gameobject called a certain function? 3 Answers
GraphicRaycaster.Raycast ArgumentOutOfRangeException 0 Answers