User Tag List

Results 1 to 7 of 7

Thread: Leave Arrow or Key Room (??)

  1. #1
    Gel
    Join Date
    Mar 2014
    Posts
    24
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    525
    Level
    8
    vBActivity - Bars
    Lv. Percent
    21.61%

    Leave Arrow or Key Room (??)

    Forum,

    Looking to modify the "Leave Your Life or Money" screen to the following:

    "Leave Your Arrow or Key"

    Anybody know how this would be possible? Thanks in advance!

  2. #2
    Gel Floundermaj's Avatar
    Join Date
    Aug 2013
    Location
    Connecticut
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    506
    Level
    8
    vBActivity - Bars
    Lv. Percent
    8.39%
    As far as I know, you cannot modify the built-in room types beyond the catch all in the Screen drop down. You'd have to write this with an FFC script that you attach to an FFC in the room. I'm not quite sure how I'd do it, I'd have to think about it.

  3. #3
    Cor Blimey! CJC's Avatar
    Join Date
    Dec 2002
    Location
    Fading into the darkness
    Age
    36
    Posts
    1,398
    Mentioned
    150 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,640
    Level
    25
    vBActivity - Bars
    Lv. Percent
    4.39%
    Actually, you could get away with this using an item script and two custom items:


    1.) Make an item script that removes the Arrow item from Link's array (I won't pseudo-script right now because I'm a little rusty, but I'm sure someone can help with this)
    2.) Make an item script that reduces the key counter by one.
    3.) Attach these two scripts to two unused item slots in your game. Rename the items "Lose Arrow" and "Lose Key" and give them the same Item Class
    4.) Make a shop type with these two items.
    5.) Set the room type to the newer version of "Potion or HC" (I think it's called Choose Three) and set the shop type of the room to the one created in step 4.


    There's one little setback with this, though... if Link doesn't have the item he can still choose to 'sacrifice' it and bypass the room. I'm not sure how to work around that short of making the game kill Link for such treachery (Buried in the item script, if he picks the item and does not meet the criteria his health is set to 0). Perhaps someone else will have an idea to make it more functional.

  4. #4
    Gel Floundermaj's Avatar
    Join Date
    Aug 2013
    Location
    Connecticut
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    506
    Level
    8
    vBActivity - Bars
    Lv. Percent
    8.39%
    I Wrote an FFC script that seems to work. I have to spend some time commenting it so you can set it up and I'll post it later today or tomorrow.

  5. #5
    Gel
    Join Date
    Mar 2014
    Posts
    24
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    525
    Level
    8
    vBActivity - Bars
    Lv. Percent
    21.61%
    Wow, thanks Flounder! I actually just submitted my first quest to the Forum on Sunday, and I can't wait for it to be published. But no time to rest on my laurels...have to start working on a 2nd quest. Thanks again!!

  6. #6
    Gel Floundermaj's Avatar
    Join Date
    Aug 2013
    Location
    Connecticut
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    506
    Level
    8
    vBActivity - Bars
    Lv. Percent
    8.39%

    Post

    Ok I think this will work. It works on a test quest I made. Actually let me post a link to that too..

    http://1drv.ms/1lxv95c

    I'm assuming you know how to set up an FFC script? If not Anyone here can probably help you.

    Here is the code:

    PHP Code:
    import "std.zh"

    ffc script LeaveXorY  //This script implements a room that requires Link to leave a specified number of a choice of consumable items to progress.
                            //For example, you could require Link to choose between leaving a 2 keys or leaving 10 arrows, or some magic or some life, etc.
                            
    {                //   D0         D1          D2           D3          D4         D5        D6        D7
        
    void run (int CounterXint CounterYint Guyint Msgint TileXint TileYint AmountXint AmountY)
        {        
    // CounterX and Y are the counters to adjust. Use the CR_ constants in std.zh.
                // Guy is the NPC you wish to create for the room.  The NPC_ constants 1-9 in std.zh are the built in guys.
                //Msg is the string number to display.
                //TileX and Y are the tiles to use for the two items.  The numbers are from the tile screen.
                //AmountX and Y are the amount to adjust the specified counters.  
        
            
    if(Screen->State[ST_SECRET])  //This if section will check to see if the room has already been solved, and if so 
            
    {                                //it will open the shutters and skip the rest of the script
                
    int i=0;
                for(
    i=0i<4i++)
                {
                    if (
    Screen->Door[i]==D_SHUTTER)
                    {
                        
    Screen->Door[i]=D_OPENSHUTTER;
                        
    Game->PlaySound(SFX_SHUTTER);
                    }
                
    Game->PlaySound(SFX_SECRET);
                } 
                
    Quit();
            }

            
    npc A=Screen->CreateNPC(Guy);  // this is where the NPC is created and placed.
            
    A->X=120;
            
    A->Y=64;
            
            
    npc flame1=Screen->CreateNPC(5);  // These lines place flames in the room like in the classic quest. 
                                                                                 // if you don't want flames, comment these lines.
            
    npc flame2=Screen->CreateNPC(5);
            
    flame1->X=64;
            
    flame1->Y=64;
            
    flame2->X=176;
            
    flame2->Y=64;
            
            
    Waitframes(30);
            
    Screen->Message(Msg);        //message displayed here
            
    while(!chooseX(CounterXAmountX)&&!chooseY(CounterYAmountY)) //This while loop will display the items until one of the functions is true.
            
    {
                
    Screen->FastTile(28888TileX8OP_OPAQUE);  //the "8" in these lines is the CSet.  you may need to change it.
                
    Screen->FastTile(215288TileY8OP_OPAQUE);
                
    Screen->DrawCharacter(280112FONT_Z11, -10045OP_OPAQUE);
                
    Screen->DrawCharacter(2144112FONT_Z11, -10045OP_OPAQUE);
                
    Screen->DrawInteger(288112FONT_Z11, -100AmountX0OP_OPAQUE);
                
    Screen->DrawInteger(2152112FONT_Z11, -100AmountY0OP_OPAQUE);
                
    Waitframe();        
            }

            
    A->X=-16;  //this section will move the NPCs off screen once the room is solved, and it sets the Secret state to true
            
    A->Y=-16;
            
    flame1->X=-16//remember to comment out the flame lines if not using flames
            
    flame1->Y=-16;
            
    flame2->X=-16;
            
    flame2->Y=-16;
            
    Screen->State[ST_SECRET]=true;
            
            
    int i=0;
            for(
    i=0i<4i++)   //This for loop will open all shutters if they are closed
            
    {
                if (
    Screen->Door[i]==D_SHUTTER)
                {
                    
    Screen->Door[i]=D_OPENSHUTTER;
                    
    Game->PlaySound(SFX_SHUTTER);
                }
            }
            
    Game->PlaySound(SFX_SECRET);
        }

        
    bool chooseX(int CounterXint AmountX)   //These two functions detect which item Link is standing on and adjusts the respective counter.  
                                                    //If Link doesn't have the required item, nothing happens.
        
    {
            if((
    Link->X>80&&Link->X<96)&&(Link->Y>80&&Link->Y<96))
            { 
                if((
    Game->Counter[CounterX]-AmountX)<0) {return false;}
                else {
    Game->Counter[CounterX]-=AmountX; return true;}
            }
            else{return 
    false;}
        }
        
        
    bool chooseY(int CounterYint AmountY)
        {
            if((
    Link->X>144&&Link->X<160)&&(Link->Y>80&&Link->Y<96))
            { 
                if((
    Game->Counter[CounterY]-AmountY)<0) {return false;}
                else {
    Game->Counter[CounterY]-=AmountY; return true;}
            }
            else{return 
    false;}
        }

    Hope this will work!
    Last edited by Floundermaj; 07-01-2014 at 09:04 PM.

  7. #7
    Gel
    Join Date
    Mar 2014
    Posts
    24
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    525
    Level
    8
    vBActivity - Bars
    Lv. Percent
    21.61%
    Perfect - at the moment, I do not know how to work with FFC scripts, but I'll do some research as I'm sure people have posted on that front here in the past. I may shoot you a question in the future, but thanks for going out of your way to look into this and give me a "go by"!

Thread Information

Users Browsing this Thread

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

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