Hmmmm, 26 scripts to make a simple view/close inventory? I suspect there is a much easier way to achieve this.
Here are my thoughts on a possible system:
Variables:
- Utilize one variable per slot. The value of each variable determines what is placed within the slot. (This will be hard-coded for each game)
- Utilize a single variable to save how many slots are already within use.
The system:
- When an item is picked up and the developer wants it to be placed into the inventory, then have it:
--- Check what value the "slot number variable" is. Based upon it's value, insert the proper value into the needed "slot variable".
- When the inventory is openned, all "slot variables" are checked and the proper picture is displayed for each.
The only downside to this is you're going to need a picture of every possible item for every possible slot.
So let's say you have 9 slots and there are 5 possible items that can be within those slots.
5*9 = 45 HUDs total just for viewing the inventory.
The one and only,
Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.