User Tag List

Results 1 to 10 of 14

Thread: items.zh

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,764
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.6%
    Quote Originally Posted by Lunaria View Post
    Does anyone have a mirror of this library? The download links are all dead, most likely due to dropbox killing public folders.
    I have some of his functions cloned in my old ItemHandling.zh header. I may have the newer one, on a server somewhere.

    Is there a specific function, or set of utilities that you needed from it, failing that?

    THis old, ugly weapon script uses some of them, but it does not have L/R Ex item buttons in it. The general premise for that, is this:

    Store an item ID to a button somehow.
    When the button is pressed, read the item stored to it.
    Set that item to A or B.
    Fake a press of A or B (respectively).

    Not pretty, and the one frame graphical glitch will probably irritate you; which means scripting a visual fix for it.

    Future ZC Notes and Notions
    Spoiler: show

    I'm leaning toward adding something along the lie of Game->RunItemScript() to ZScript in the future to allow using a scripted item from any button, and possibly Link->UseItem() if i want to lose more sleep, and more sanity. I've considered adding buttons mapped to all of the eight non-directional buttons for 2.60. That'll be joyful, and merit a other case of whiskey.

  2. #2
    Banned
    Join Date
    Jun 2017
    Posts
    17
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    144
    Level
    4
    vBActivity - Bars
    Lv. Percent
    39.67%
    Well I was both wanting to look into how it handled things in code as well as maybe implementing it depending on how it worked, I'm not yet certain exactly what kind of solution I want so I really can't see exactly what I need from it. If you do find it that would be appreciated.

    Also paging @SUCCESSOR in case you're still around and have it.

  3. #3
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,564
    Level
    30
    vBActivity - Bars
    Lv. Percent
    52.25%
    Quote Originally Posted by Lunaria View Post
    Well I was both wanting to look into how it handled things in code as well as maybe implementing it depending on how it worked, I'm not yet certain exactly what kind of solution I want so I really can't see exactly what I need from it. If you do find it that would be appreciated.

    Also paging @SUCCESSOR in case you're still around and have it.
    Sorry for the late reply. I have updated the OP with a new link on my onedrive. I don't really know what is happening with dropbox. I'll try getting that one fixed as well.


    Quote Originally Posted by Lelouche Vi Britannia View Post
    Any updates? Having more equipment buttons is a nice thing.
    Sorry, I have not really updated this. Lost touch with ZC and ZScript. If there is anything lacking, faulty, or other such let me know! I realize this reply is coming a year late, but it goes to anyone else who might have a similar question.
    Last edited by SUCCESSOR; 10-09-2017 at 04:18 PM.

  4. #4
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,764
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.6%
    Quote Originally Posted by SUCCESSOR View Post
    Sorry for the late reply. I have updated the OP with a new link on my onedrive. I don't really know what is happening with dropbox. I'll try getting that one fixed as well.

    Sorry, I have not really updated this. Lost touch with ZC and ZScript. If there is anything lacking, faulty, or other such let me know! I realize this reply is coming a year late, but it goes to anyone else who might have a similar question.
    @SUCCESSOR : You may want to consider adding it to the databases on zeldaclassic.ocm and pureze.com.

    One nice thing that I added to 2.54 and above, thatwill benefit this, and to which you may want to update it (once released), is:


    int SetItemSlot(int itm_id, int slot, int force);

    /**
    * This allows you to set Link's button items without binary operations, and to decide whether to
    * obey quest rules, or inventory.
    *
    * When using this, 'itm_id' is the ID number of the item.
    * Set 'slot' to one of the following: 0 == Slot B, 1 == Slot A
    * Other buttons may be added in the future, and other values for 'slot' are thus, reserved.
    * Set the flags on 'force' as follows:
    * const int ITM_REQUIRE_NONE = 0
    * const int ITM_REQUIRE_INVENTORY = 1
    * const int ITM_REQUIRE_A_SLOT_RULE = 2
    * Thus, require both inventory, and following quest slot rules, force == 3.



    Thus, needing to set up a subscreen, or using idiotic functions to page through items, is a duck.

    I want to add either, or both, RunitemScript(int script) and Useitem(int item_id) at some point--I may have mentioned this in the thread earlier, but I've forgotten--and I want to add bitem slots for the extra buttons, plus L and R; hence the configuration for SetItemSlot(), which can be expanded to cover additional slots, if we add more.

    The real issue, is the suibscreen: I could add item slots for more buttons, but making the subscreen show them would be hellish.

    Quote Originally Posted by Lunaria
    Well I was both wanting to look into how it handled things in code as well as maybe implementing it depending on how it worked, I'm not yet certain exactly what kind of solution I want so I really can't see exactly what I need from it. If you do find it that would be appreciated.
    One of the things that I did, to suppress the graphical inconsistency, was this:

    Set the tile positions for A and B item slots (the subscreen icons) as constants:
    const int SUBSC_PSV_ITEM_A_X = n;
    const int SUBSC_PSV_ITEM_A_Y = n;
    const int SUBSC_PSV_ITEM_B_X = n;
    const int SUBSC_PSV_ITEM_B_Y = n;

    Draw a solid black tile over the item that I am substituting.
    Draw the item tile for the item the item that is truly held in that slot (the one that I am temporarily shifting out) over the black tile.

    This overrides the graphics of the item that I am using for a frame, so that the graphical glitch is less obvious.

    I was more clever with 2.54, and in that version, I do:

    Code:
    //global
    
    const int TEMP_ITM_B_ID = 0;
    const int TEMP_ITM_B_TILE = 1;
    const int TEMP_ITM_A_ID = 2;
    const int TEMP_ITM_A_TILE = 3;
    const int TEMP_ITM_L_ID = 4;
    const int TEMP_ITM_L_TILE = 5;
    
    int tempitem[8]; //holds the item that should be in the slot, and its tile. 
    // Item that should be there: item id (B), tile (B), item id (A), tile (A) 
    //item that we are using this frame tempidtem_id, tempitem_tile
    
    
    void UseItemOnL(int itm_id)
    {
    	itemdata temp = Game->LoadItemData(GetItemSlot(SLOT_B)); 
    	itemdata itmL = Game->LoadItemData(itm_id);
    	//store the original item information for the slot
    	tempitem[TEMP_ITM_B_ID] = temp->ID; //what was in the slot.
    	tempitem[TEMP_ITM_B_TILE] = temp->Tile; //..
    	tempitem[TEMP_ITM_L_ID] = itm_id;
    	tempitem[TEMP_ITM_L_TILE] = temp->Tile; //the original tile for the temporary item
    	itmL->Tile = tempitem[1];
    	Link->SetItemSlot(itm_id, SLOT_B, 0);
    	Link->PressB = true;
    	Waitframe();
    }
    
    void RestoreItemB()
    {
    	itemdata temp = Game->LoadItemData(tempitem[TEMP_ITM_L_ID]);
    	itemdata real = Game->LoadItemData(tempitem[TEMP_ITM_B_ID]);
    	Link->SetItemSlot(tempitem[TEMP_ITM_B_ID], SLOT_B, 0); //restore the true item
    	temp->Tile = tempitem[TEMP_ITM_L_TILE]; //restore the original tile. 
    }

  5. #5
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,564
    Level
    30
    vBActivity - Bars
    Lv. Percent
    52.25%
    Quote Originally Posted by ZoriaRPG View Post
    @SUCCESSOR : You may want to consider adding it to the databases on zeldaclassic.ocm and pureze.com.
    Maybe, if I get around to it.

    Quote Originally Posted by ZoriaRPG View Post
    Thus, needing to set up a subscreen, or using idiotic functions to page through items, is a duck.
    You don't need to set up a subscreen for this. subscreens by default let you toggle linearly through all items. It's custom subscreens that can be a problem for this header. Other than that cycling through items isn't really so much of an issue so far as I can tell. And seems to rarely be visible. If people actually start using it in quests we might get a better idea though. Most people generally just want to have an extra button for a single constant item, from what I've seen.

  6. #6
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,764
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.6%
    Quote Originally Posted by SUCCESSOR View Post
    Maybe, if I get around to it.



    You don't need to set up a subscreen for this. subscreens by default let you toggle linearly through all items. It's custom subscreens that can be a problem for this header. Other than that cycling through items isn't really so much of an issue so far as I can tell. And seems to rarely be visible. If people actually start using it in quests we might get a better idea though. Most people generally just want to have an extra button for a single constant item, from what I've seen.
    Eh? Of course you need a subscreen. You can't change the item on A or B to another item without a subscreen, as the 2.50 functions to set Link's equipment make use of the subscreen layout, to page through items until you find the one that you want. Thus, if you want to temporarily substitute an item into B, if you do not have it on the subscreen, or paging through the subscreen in a linear manner would not land upon it, you would not be able to set it.

    The default subscreens allow you to cycle through the default items in ZC, if that is what you mean. That is not true, if you add special/new items to a quest. This method is also horrific and slow, as it requires iterating the subscreen objects, and that does quite a lot (internally).

  7. #7
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,564
    Level
    30
    vBActivity - Bars
    Lv. Percent
    52.25%
    Quote Originally Posted by ZoriaRPG View Post
    Eh? Of course you need a subscreen. You can't change the item on A or B to another item without a subscreen, as the 2.50 functions to set Link's equipment make use of the subscreen layout, to page through items until you find the one that you want. Thus, if you want to temporarily substitute an item into B, if you do not have it on the subscreen, or paging through the subscreen in a linear manner would not land upon it, you would not be able to set it.

    The default subscreens allow you to cycle through the default items in ZC, if that is what you mean. That is not true, if you add special/new items to a quest. This method is also horrific and slow, as it requires iterating the subscreen objects, and that does quite a lot (internally).
    I'm well aware of all of that. But the options are limited. If someone adds an item to the default subscreen and don't match the behavior to it, they're an idiot. I can't help the stupidity of others. The quest developer needs to understand how this works and adjust their quest accordingly. If there are improvements I can make to this for an official ZC release let me know and I will try to get to it before school starts up again and sucks me back into the void.

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social