User Tag List

Results 1 to 2 of 2

Thread: [2.50.2] Lens rapidfire Item Scripts ( Tentatively Fixed -Z )

  1. #1
    Keese
    Join Date
    May 2015
    Posts
    67
    Mentioned
    30 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    317
    Level
    6
    vBActivity - Bars
    Lv. Percent
    52.12%
    Daily Activity
    0%
    Weekly Activity
    4.69%
    Monthly Activity
    4.56%

    Sick Bug [2.50.2] Lens rapidfire Item Scripts ( Tentatively Fixed -Z )

    Step 1: Be using the lens
    Step 2: Use another item that has an item script
    Step 3: Watch as the item script that is supposed to run will repeatedly run every single/other frame until you stop using the lens

    Basically, the lens is like a machine gun, only with scripts. Any item that has an item script will have it's item script be run repeatedly and rapidly if you use the item while you have the lens on until you turn off the lens. Tested in both Zodiac: Story of the Guardian and Link's Quest for the Hookshot 2. Only tested with swords that have an item script so far. Could someone please test if this is the case for other item types besides sword?

  2. #2
    ZC Contirbutor ZC Developer ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,030
    Mentioned
    95 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,586
    Level
    19
    vBActivity - Bars
    Lv. Percent
    17.77%
    Daily Activity
    0%
    Weekly Activity
    51.56%
    Monthly Activity
    15.49%
    Quote Originally Posted by Dimentio View Post
    Step 1: Be using the lens
    Step 2: Use another item that has an item script
    Step 3: Watch as the item script that is supposed to run will repeatedly run every single/other frame until you stop using the lens

    Basically, the lens is like a machine gun, only with scripts. Any item that has an item script will have it's item script be run repeatedly and rapidly if you use the item while you have the lens on until you turn off the lens. Tested in both Zodiac: Story of the Guardian and Link's Quest for the Hookshot 2. Only tested with swords that have an item script so far. Could someone please test if this is the case for other item types besides sword?
    I'll check it tomorrow, however, there was another rapid-fire bug related to swords, and items that had a magic cost, that caused them to repeatedly act, that was fixed in 2.50.3 Evan reported that one, and "Saffith fixed it, so this may have been fixed at that time.

    No, this is clearly still a bug. I do not know how it went unnoticed for three years, but it certainly is a thing. It might stem from this code which is shared between the lens code, and items running scripts:

    Code:
    if(dowpn>-1 && itemsbuf[dowpn].script!=0 && !did_scripta && checkmagiccost(dowpn))
            {
                ZScriptVersion::RunScript(SCRIPT_ITEM, itemsbuf[dowpn].script, dowpn & 0xFFF);
                did_scripta=true;
            }
    Ah, I think that I see it.

    Code:
    ZScriptVersion::RunScript(SCRIPT_ITEM, itemsbuf[dowpn].script, dowpn & 0xFFF);
    When the item script runs, it sets dowpn to its ID, and then the lens begins running the script from another item.

    Verified. This is indeed the problem. Tentatively fixed, although my fix allows the lens to run its script every frame. I believe that this was the original intent. ???

    This is the change, in Link.cpp:

    Code:
    if(isWpnPressed(itype_lens) && !LinkItemClk() && !lensclk && checkmagiccost(itemid))
        {
            if(lensid<0)
            {
                lensid=itemid;
                
                if(get_bit(quest_rules,qr_MORESOUNDS)) sfx(itemsbuf[itemid].usesound);
            }
            
            paymagiccost(itemid);
            
            if(itemid>=0 && itemsbuf[itemid].script != 0 && !did_scriptl)
            {
                ZScriptVersion::RunScript(SCRIPT_ITEM, itemsbuf[itemid].script, itemid & 0xFFF);
                did_scriptl=true;
            }
            
            lensclk = 12;
        }
    I will push this after I clean up my master repo and apply the change there, too.

    Pull requests 118 and 119 resolve this for master, and for 2.50.x, respectively.
    Last edited by ZoriaRPG; 08-20-2017 at 07:56 PM.


    Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
    ZScript & ZC-Related Pastebin | Quests and ZScript Repository | ZC Dev & Betas | Latest ZC 2.54 Beta | YouTube Channel
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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