Jump to content

Photo

Letter / Secret Script


  • Please log in to reply
7 replies to this topic

#1 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 20 November 2017 - 10:59 AM

I'd like help setting up a script where I can use either the letter (or a scripted item) to present to this NPC (and others in shops like this) which can be used to open this shutter using secret combos. 

 

PnqMJ8a.png



#2 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 20 November 2017 - 12:25 PM

There are a couple of simple options that might work. Here's an item that will trigger secrets:
item script TrggerSecrets
{
    void run()
    {
        if((Screen->Flags[SF_MISC]&4)==0)
            Quit();
        Screen->State[ST_SECRET]=true;
        Screen->TriggerSecrets();
    }
}
Here's an item that will open any shutters (but not 1-way shutters):
item script OpenShutters
{
    void run()
    {
        if((Screen->Flags[SF_MISC]&4)==0)
            Quit();
        for(int i=0; i<4; i++)
        {
            if(Screen->Door[i]==D_SHUTTER)
            {
                Screen->State[i]=true;
                Screen->Door[i]=D_OPENSHUTTER;
            }
        }
    }
}
Both of those run only when the screen flag "General Use 1 (Scripts)" is set. Will either of those do?
  • ShadowTiger likes this

#3 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 20 November 2017 - 02:06 PM

I need the item to only specifically work for these screens. It's like a membership card thing where you show the item to the NPC in these particular screens to permanently access the room behind them. I wouldn't want the item to work everywhere or on every shutter in the game. 



#4 Anthus

Anthus

    Lord of Liquids

  • Members
  • Location:Ohio

Posted 20 November 2017 - 04:16 PM

I need the item to only specifically work for these screens. It's like a membership card thing where you show the item to the NPC in these particular screens to permanently access the room behind them. I wouldn't want the item to work everywhere or on every shutter in the game. 

 

It looks like you can make them work only on the screens/ doors you need with the screen flag Saffith mentioned.


  • TheLegend_njf likes this

#5 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 20 November 2017 - 07:48 PM

It looks like you can make them work only on the screens/ doors you need with the screen flag Saffith mentioned.

 

How did I miss that? 

 

Though I'm already using General Purpose 1 for sideview ladders and may have already used up all my general use flags except maybe General Purpose 5? There really should be more of these flags in Zquest if you ask me. 


  • Anthus likes this

#6 ywkls

ywkls

    Master

  • Members

Posted 20 November 2017 - 07:55 PM

How did I miss that? 

 

Though I'm already using General Purpose 1 for sideview ladders and may have already used up all my general use flags except maybe General Purpose 5? There really should be more of these flags in Zquest if you ask me. 

A good way to keep from doing this is to utilize combinations of flags.

For example, one thing requires only flag 1 and not any other.

The next requires flag 1 and flag 2 but no others.

And so forth.

Doing it this way means that instead of having 5 combinations of flags per screen; you actually have 25.



#7 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 21 November 2017 - 01:43 PM

How about a DMap flag? Would that work okay? You could also use combo flags or types, or some combination of factors. There are all sorts of things you can do to specify the screens where it should work.

#8 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 21 November 2017 - 06:17 PM

Well, I realized that General Use 1 can be used more than once depending on what FFC is on the screen. So I guess I can put this FFC on the shopkeeper, and when Link presses the button for the item, it should open the doors? Perhaps I should have it where it probably plays a string too, something to acknowledge your membership has been accepted and the NPC welcomes you in.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users