User Tag List

Results 1 to 9 of 9

Thread: Script Help Request (again)

  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
    1,107
    Level
    11
    vBActivity - Bars
    Lv. Percent
    44.09%

    Question Script Help Request (again)

    Ok, so far I found scripts for what I want to do with a few things, but there is one thing I don't have a script for. I've already tried a few times to get this to work but was frustrated by failure and scrapped it to keep things simple. But since I started Dichotomy (which might be getting back burner-ed sadly) I wanted to do this and couldn't figure out how to do it.

    What I'm trying to do is create an item that unlocks specific chests, basically a treasure chest key. At the same time it was meant to work only on specific chests. The original idea was Overworld and Overworld cavern chests would be opened by the keys, leaving treasure chests in dungeons to be opened by level keys. If the idea works I could have the same kind of Overworld chests show up randomly in dungeons as well only open-able by chest keys, with other dungeon chests open-able by the finite number of level keys available in that level.

    Also there would be a lot of these treasure chests, and the keys would be rare drops from certain enemies or sold by merchants.

    So, scripting guru's... how is this done? I wouldn't mind someone doing the scripting for me, but I would still want to know how it works so I could utilize that knowledge in future projects or just to flesh out older ones and finally release them.
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

  2. #2
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    And this is why we need a Treasure Chest (Level Key Only) combo.
    Can't you just disable the key item in the dungeons?

  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
    1,107
    Level
    11
    vBActivity - Bars
    Lv. Percent
    44.09%
    I tried that, for some reason it doesn't work. The key counter shows 0 for level keys and I don't show the counter for normal keys. But with a counter of 0 Level keys, it still consumed one of my normal keys to open a door anyway, which of course means that it makes the difference in keys kind of moot if you include both types.
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

  4. #4
    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
    1,107
    Level
    11
    vBActivity - Bars
    Lv. Percent
    44.09%
    Bumping thread in the hopes that a dev can shed some light on this....
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

  5. #5
    Keese ywkls's Avatar
    Join Date
    Feb 2016
    Posts
    62
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    476
    Level
    7
    vBActivity - Bars
    Lv. Percent
    86.27%
    The only place you'd need a script would be inside a dungeon. On the overworld, you can have a level too! Even if you set the level as zero, a level-specific key for that wouldn't work in dungeons. That's how I had locked chests in one of my quests.

    As for chests in dungeons that require specific keys, that's something that would need a script. Let me cogitate on it and get back to you.

  6. #6
    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
    1,107
    Level
    11
    vBActivity - Bars
    Lv. Percent
    44.09%
    Why didn't I think of that. Lol
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

  7. #7
    Keese ywkls's Avatar
    Join Date
    Feb 2016
    Posts
    62
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    476
    Level
    7
    vBActivity - Bars
    Lv. Percent
    86.27%
    Alright, try this. No guarantees it will work, because it is untested. Place the ffc (that looks like a chest) on top of a solid combo that looks like the open chest and set the flag to Run Script at Screen Init.

    CODE: Show

    ffc script Locked_Treasure_Chest{
    void run(int item_ID,int Key_Counter){
    if(Screen->State[ST_CHEST]){
    this->Data = 0;
    Quit();
    }
    while(!Activated(this,Key_Counter))
    Waitframe();

    this->Data = GH_INVISIBLE_COMBO;
    CreateItemAt(item_ID,Link->X,Link->Y);
    Game->Counter[Key_Counter]--;
    Link->Action = LA_HOLD2LAND;
    Link->HeldItem = item_ID;
    Screen->State[ST_CHEST]=true;
    ` KeepAUnpressed();
    this->Data = 0;
    }
    }

    bool Activated(ffc this, int Key_Counter){
    if(Game->Counter[Key_Counter]==0)return false;
    if(Link->Dir!=DIR_UP)return false;
    if(Link->X<this->-8)return false;
    if(Link->X>this->X+8)return false;
    if(Link->Y<this->Y+8)return false;
    if(Link->Y>this->Y+16)return false;
    if(!Link->PressA)return false;
    return true;
    }

    void KeepAUnpressed(){
    while(Link->InputA){
    Link->InputA = false;
    Link->PressA = false;
    Waitframe();
    }
    }


    The basics for this script were created by Saffith, I just modified it. The key item would have to increase the custom counter and that would be what you'd have to display onscreen, probably separate from the normal key counter. To initialize the counter, just add a section like this to either a global init script or the global active script above the while loop.

    CODE: Show

    int MaxKeys =100;//This needs to be outside of all loops.

    Game->MCounter[CR_SCRIPT1] = MaxKeys;//This part would be inside the init script or in the active script before the while loop.



    Let me know if that works!
    Last edited by ywkls; 05-08-2016 at 11:38 PM.

  8. #8
    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
    1,107
    Level
    11
    vBActivity - Bars
    Lv. Percent
    44.09%
    If I ever get around to testing it, I will.
    Lost my wings and grew 8 tentacles... I've seen enough Hentai to know where this is going....

  9. #9
    Keese ywkls's Avatar
    Join Date
    Feb 2016
    Posts
    62
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    476
    Level
    7
    vBActivity - Bars
    Lv. Percent
    86.27%
    Edited the script slightly. This idea could also be used for a block that vanished if you examine it with a certain item in your inventory. Could also work for Npcs that move aside whenever you speak to them and have an item. Really, there are tons of things this could do.

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