Jump to content

Photo

Cursed Key


  • Please log in to reply
11 replies to this topic

#1 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 04 August 2020 - 01:36 PM

I'm attempting to write an ffc script that will check if Link has a dungeon key in his inventory. If he does he will be Jinxed until he uses the key to unlock a door. What I have below is what I was able to figure out on my own, however, I've tried a number of things and just can figure out a way to have the room check if Link has any keys or not.

 

ffc script CurseKey{
    void run()
    {
        ??????
        {
            Link->SwordJinx = -1;
            Link->ItemJinx = -1;
        }
        Waitframe();
    }
}



#2 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 04 August 2020 - 02:11 PM

So I'm not sure on the actual syntax, but I would check if Link's level key count is > 0.

I think that would do it.
  • Mani Kanina likes this

#3 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 04 August 2020 - 02:12 PM

ZC version? (Really need to include that in script discussion nowadays; 2.55 has drastically different features)



#4 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 04 August 2020 - 03:00 PM

If you want this to be an FFC script you have to put it in basically every room in the dungeon, as well as an FFC that unjinxes link if he leaves it. It might make more sense to make it global.


Edited by Mani Kanina, 04 August 2020 - 03:00 PM.


#5 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 04 August 2020 - 03:00 PM

2.50.2

I tried messing with LKeys[?], but there is something I am failing to understand.

Not sure if Link->LKeys[?] is the proper syntax. Regardless, I am failing to get the room to recognize that Link has one key. I've tried using conditional statements and while loops. What really makes this difficult for me is, while there are examples of scripts doing things when Link has an item, it doesn't seem to work when the item us a key.

My understanding of scripting is very limited, so this script idea might not work. Anyways, I really appreciate the feedback.

#6 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 04 August 2020 - 03:02 PM

Keys are not items, they are a counter like rupees and bombs. `Game->LKeys[]` is what you want. I'd write it for you, but my power just went out so I only have my phone...

#7 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 04 August 2020 - 03:46 PM

if(Game->LKeys[Game->GetCurLevel()]>0){

Probably wanna do one of these. I'd also put both that sucker in a while loop and set both jinxes to something like 10 instead of -1. This way they'll naturally go away once you spend the key instead of leaving you permanently jinxed.



#8 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 04 August 2020 - 04:05 PM

Thanks venrob and Moosh! It worked

 

ffc script CurseKey{
    void run()
    {
        while (true)
        {
            if(Game->LKeys[Game->GetCurLevel()]>0)
            {
                Link->SwordJinx = 10;
                Link->ItemJinx = 10;
            }
        Waitframe();
        }
    }
}

 



#9 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 05 August 2020 - 05:34 PM

Again, you probably want it to be part of a global script, checking for the dungeon; so that you don't need to put the FFC on every single screen. It might make sense to make it more complicated, as this right now will make every key in the dungeon cursed, or make a key only be cursed on certain screens; both of which seem odd.

Additionally, what I didn't mention before, 2.50.2 is an outdated and no longer supported version of ZC; so you should update ASAP.



#10 Yloh

Yloh

    My Face!!!

  • Members
  • Real Name:Michael
  • Location:Mike's Fun House

Posted 05 August 2020 - 08:28 PM

After some consideration, I now believe disabling players weapons and items while holding on to a key might not be the best idea. This was not a waste of time because I am now able to create Phanto from Super Mario Bros 2!

 

As for 2.50.2, I will be upgrading to 2.50.3 soon. Thanks venrob.


Edited by Yloh, 05 August 2020 - 08:32 PM.


#11 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 05 August 2020 - 10:12 PM

After some consideration, I now believe disabling players weapons and items while holding on to a key might not be the best idea. This was not a waste of time because I am now able to create Phanto from Super Mario Bros 2!

 

As for 2.50.2, I will be upgrading to 2.50.3 soon. Thanks venrob.

*2.53

2.50.3 is a different thing, which was unfinished and abandoned, and will not work.

The latest official downloads can be found at: https://www.zeldacla....com/downloads/


  • Yloh likes this

#12 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 25 August 2020 - 03:14 AM

This thread inspired me to allow running an item action script when you use a key, level key, or boss key; although this is somewhat limited in that if you have multiple key items of the same family, you must set the same script to each one. At the least, it woulld allow setting a silent WAV for the door opening sound, and allow you to use a unique sound per lock type.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users