User Tag List

Results 1 to 2 of 2

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

  1. #1
    Banned
    Join Date
    May 2015
    Posts
    141
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    667
    Level
    9
    vBActivity - Bars
    Lv. Percent
    14.48%

    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
    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,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.04%
    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.

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