User Tag List

Results 1 to 5 of 5

Thread: Script Request: Shutters at Item Quantity

  1. #1
    Octorok Lelouche Vi Britannia's Avatar
    Join Date
    Oct 2015
    Location
    Britannia - Area 11
    Posts
    173
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    943
    Level
    10
    vBActivity - Bars
    Lv. Percent
    65.66%

    Script Request: Shutters at Item Quantity

    This is for another project I'm working on. I have no idea how to even begin this one or if its possible.

    I would like a script that will only open a set of dungeon Shutters if you have a specific number of a collectable item. The script does not have to be fancy, just able to take 2 arguments; item to look for, and quantity of that item.

    Option for more than one unique item would be nice but not necessary. Thanks to whoever decides to attempt this one.
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

  2. #2
    The Timelord
    QDB Manager
    ZC Developer
    ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,339
    Mentioned
    109 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,460
    Level
    21
    vBActivity - Bars
    Lv. Percent
    8.74%
    D0: Item ID. Use a negative value for a counter ID.
    D1: Counter minimum if D0 is < 0.
    D2: Door direction to open. Uses standard direction values (see std_constants.zh)

    Code:
    ffc script OpenShutters
    {
         void run(int itm, int quantity, int direction)
         {
              bool do_open;
              while(1)
              {
                   if ( itm < 0 ) //counter
                   {
                        if ( Game->Counter[itm*-1] >= quantity )
                        {
                             do_open = true;
                        }
                   }
                   else if ( itm > 1 && itm < 256 )
                   {
                        if ( Link->Item[itm] )
                        {
                             do_open = true;
                        }
                   }
                   if ( do_open )
                   {
                        Screen->Door[direction] =D_OPEN;
                        Game->PlaySound(SFX_SHUTTER);           
                        this->Data = 0; Quit();
                   }
                   Waitframe();
              }
         }
    }
    Last edited by ZoriaRPG; 03-25-2018 at 08:50 AM.

  3. #3
    Octorok Lelouche Vi Britannia's Avatar
    Join Date
    Oct 2015
    Location
    Britannia - Area 11
    Posts
    173
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    943
    Level
    10
    vBActivity - Bars
    Lv. Percent
    65.66%
    Woot! Zoria to the rescue. Thanks a lot for this. I do feel a bit silly though as the script is simpler than I thought it would be.

  4. #4
    The Timelord
    QDB Manager
    ZC Developer
    ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,339
    Mentioned
    109 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,460
    Level
    21
    vBActivity - Bars
    Lv. Percent
    8.74%
    Quote Originally Posted by Lelouche Vi Britannia View Post
    Woot! Zoria to the rescue. Thanks a lot for this. I do feel a bit silly though as the script is simpler than I thought it would be.
    Not a problem. Opening shutters is quite easy. I wasn't sure if you wanted counter-based mechanics, from reading your post, but it's the only thinng that makes sense for a 'quantity' field, per yourrequest.

    Closing shutters is just a matter of writing to Screen->Door[], too..

    I fixed a typo in the script, in the event that you didn't catch it.

  5. #5
    Octorok Lelouche Vi Britannia's Avatar
    Join Date
    Oct 2015
    Location
    Britannia - Area 11
    Posts
    173
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    943
    Level
    10
    vBActivity - Bars
    Lv. Percent
    65.66%
    Haven't copied it yet but thanks for that.

    And yeah quantity was what I was really looking for. The quest idea has a central hub with teleporters that lead to dungeons. Each one has a collectable. Once enough collectables are gained, the shutters open revealing the next sets of dungeons. So kinda like Gauntlet Dark Legacy only in Zelda form. There is a lot more to it than this but this script is necessary for the main method of advancement further into the content.
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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