Introduction

00:00:00:24 - 00:00:09:19

Peter

In this section, we are going to implement a cell box where we can place our crops and other items to exchange of them for money.


00:00:11:28 - 00:00:36:21

Peter

In terms of the code, we will need to add a couple of scripts and those will be the cell box interaction that will allow us to interact with our cell box, the cell system that will allow us to sell items from the that we have left in our cell box. And this will be connected to our inventory. Since we want to reuse this data structure to start our items.


00:00:37:00 - 00:01:02:06

Peter

This will be also connected. The cell system to the time manager so that we can sell the items at a specific hour and we are going to connect it to our item database so that we can know what type of item are we selling and how much should we give to the player. The next thing that we will need is to have an agent data which will store the amount of money as well as other stats later on.


00:01:02:17 - 00:01:24:10

Peter

And because we create this and this will be a script of objects, we will need to connect it to the player and the player will need to be slightly modified so that it has a reference to its own agent data because these are all we can use it to store. Even their first, our inventory or anything else like fatigue or any other stats that our agents might have.


00:01:24:24 - 00:01:58:02

Peter

Lastly, we are going to have a cell Xbox controller which will control the UI elements that will allow the player to interact with our cell books. So when we interact for sell books, we are going to trigger the cell Xbox controller. It in turn will be connected to the item database. It will be connected to the pause time controller so that we can pause our time and it will be connected to our UI to render because we can reuse a lot of those scripts that we already have because we first had this item, a controller UI and the inventory controller UI.


00:01:58:16 - 00:02:21:07

Peter

So here it is. Now we are going to reuse the same scripts that we already have to control our cell books. You are going to have the application of the pause controller here and here. I want to remove that. But basically we have a lot of those UI scripts that we can reuse like this. You are scrolling item selection and others.


00:02:21:21 - 00:02:50:08

Peter

And lastly, I just want to mention that our inheritance tree using the interact instructions, so our interface is very useful for us to keep everything disconnected because we can simply added the cell box interaction and it will already have the access to the agent. So it is very useful to think in terms of those implementations. So the interfaces and UPS are classes because they allow us to have a maintainable code base.


00:02:50:21 - 00:03:15:12

Peter

Now those UML diagrams that I'm showing you are here just to show you the extent of our project and how many different systems do we have and how we should connect them together in order to be able to use them in an efficient manner. Now I bet some of those solutions could be better, and some of those are working pretty good, like the tool obstruction or the interaction interface.


00:03:15:22 - 00:03:37:07

Peter

Still, the point of me showing those to you is just to show you how much we have created and how much we should think about the architecture when creating a game to keep everything organized, at least to the extent that we can, while creating something that actually works. Anyhow, let's now go back to the project and start implementing this cell system.



Complete and Continue