Jump to content

Photo

Script Help: Hookshot rips off shield


  • Please log in to reply
22 replies to this topic

#16 RephireZeKasual217

RephireZeKasual217

    Initiate

  • Members

Posted 29 December 2019 - 05:12 PM

aside from std.zh, are there any other scripts i need for this to compile , because it says that 'l->Type' is not a correct pointer variable.


Edited by RephireZeKasual217, 29 December 2019 - 05:15 PM.


#17 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 29 December 2019 - 05:42 PM

uhh, might need to be `->ID`? I forget.



#18 RephireZeKasual217

RephireZeKasual217

    Initiate

  • Members

Posted 29 December 2019 - 05:48 PM

okay it works, but the original problem is still apparent where only the handle breaks it, not the hook.



#19 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 29 December 2019 - 05:58 PM

for(int q = 1; q <= Screen->NumLWeapons(); ++q)
{
    lweapon l = Screen->LoadLWeapon(q);
    if(l->ID == LW_HOOKSHOT)
    {
        for(int w = 1; w <= Screen->NumNPCs(); ++w)
        {
            npc n = Screen->LoadNPC(w);
            if(Collision(n, l))
                n->BreakShield();
        }
    }
}
How about this?

#20 RephireZeKasual217

RephireZeKasual217

    Initiate

  • Members

Posted 29 December 2019 - 06:06 PM

Still happening, is the hook somehow a different lweapon to the handle, like with the candle and the flame?



#21 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 29 December 2019 - 06:10 PM

As soon as the script works right way, I'd be one of the first to load it...
Great Idea!


Edited by Bagu, 29 December 2019 - 06:10 PM.


#22 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 30 December 2019 - 08:48 AM

Oh, you know, I'm blind. You're only running the script for 1 frame. You need to put it in a while loop, you know, or it won't work.
And also, that can't be done in an item script unless you are using 2.55. Let me just write the whole thing:
 

2.55 Version

2.53 Version

 

The 2.55 version could be made to only take shields from certain sides, though that'd take extra logic.

...hell the 2.55 version could probably be made an lweapon script to be even easier, but meh, this is what I have time for now.


  • ShadowTiger likes this

#23 RephireZeKasual217

RephireZeKasual217

    Initiate

  • Members

Posted 31 December 2019 - 02:19 AM

OOHHHH, it just needed to be a global script. It works perfectly now, thank you so much for the help.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users