Quote Originally Posted by CJC View Post
Hmmm, actually if you're locking two items to the two buttons you might be able to do this by another means.
@SUCCESSOR is developing a script header to control inventory mechanics. One of his functions forces ZC to set a particular item to a particular button. If you were to run this script every time the Start button is pressed (so it would refresh when the subscreen is opened and closed) and just adjust WHICH item is forced based on which state Link is in (States 1 through 7, set variables ForcedB and ForcedA when switching to that state and then have SUCCESSOR's function equip those items) you could achieve what you're after. It wouldn't work if you want more than two items per state (since there are only two viable item buttons at the moment) but it might be easier than adding and removing the items from the inventory.
Funny I opened this thread to read it before I left then came back home and finished reading it to find you had tagged me.
@Spacepoet all of the things you mentioned are possible with Zscript. I can share my header with you but it is not in a state for public consumption yet. If you'd like it I will PM you a link. It sounds like the best solution for you would be a simple array that organizes what items are in each group and whether or not The player actually has that item. You could use the 0 index as an indicator of the current active set. This of course means you need to be comfortable with arrays (some people seem to have trouble grasping them for some reason). such as:

const int NUM_ITEMS_IN_SETS = 2; //however many per set

int itemSets[] = {0,I_SWORD,I_BRANG,I_BOW,I_WHISTLE,I_HOOKSHOT,I_BO MBS...}
const int ITEM_SET_POSITION = 0;//the element that tells what set is in use


Then itemSets[1+ITEM_SET_POSITION * NUM_ITEMS_IN_SET] would be A
itemSets[1+ITEM_SET_POSITION * NUM_ITEM_SET +1] would be B

And youwould script so that any items in inactive sets would be removed from Link->Items[]. Indicating that link has the item whether or not it is in the actual game inventory can be done in another portion of the array or (as I like to do) in the same index as the position for the item with a decimal.


(Sorry this is all probably very sloppy. I am running on very little sleep of poor quality and a few too many cappuccinos)