Lets make up an illustration here.
There are huts, which can contain objects. The world could have anywhere from 100 to 500 huts at a time.
There are also sticks. There's quite a variety of different kinds of sticks, somewhere in the area of a few dozen to several hundred different kinds.
Each hut can hold one of every kind of stick. So if there are 200 kinds of sticks, each of the 500 huts can hold 200 sticks.
That's 100,000 sticks. More than BYOND can handle.
So I tried an alternative approach.
Since a stick type is a static object, the variables of which do not change throughout the game, I decided that I could create a list storing each of the stick types, then just refer to that list whenever I needed information about a specific stick type.
var/list/stick_list = list("stick type" = new /stick/datum object)
Now all 200 stick types are stored in one list, so there are 500 huts and only 200 sticks. 700. A much more managable number.
Now here's the problem.
Each hut has two statpanels. One statpanel is supposed to allow the player to gather new sticks, and the other statpanel shows which sticks are currently in the Hut.
But, here's a catch. The sticks in the hut need to have a switch that determines whether or not they're in the hut's fireplace. So ideally I'd want to click on a stick type from the hut statpanel and, perhaps modifying the associated value in the list containing all the sticks in the hut, determine whether the stick is in the fireplace or not.
So, from the Gathering statpanel, clicking on a stick type should move it to the Hut statpanel. From the Hut statpanel, clicking on the stick type should determine whether the stick is in the fireplace or not.
Trouble is, there doesn't seem to be any way to make this work. So, help!
Copyright © 2015 BYOND. All rights reserved.