User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 30

Thread: Gameboy-Zelda Style Bottomless Pits/Lava Script

  1. #1
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,300
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.29%

    Gameboy-Zelda Style Bottomless Pits/Lava Script

    Code:
    const int linkfalling = 0; // set here the first tile of your 5 tile Link Falling animation
    const int linklava = 0; // set here the first tile of your 5 tile Link Drowning animation
    const int fallingsfx = 0; // set here the SFX that plays when Link falls
    const int lavasfx = 0; // set here the SFX that plays when Link drowns in lava
    const int invis = 0; // set here the item ID of an item with Link Tile Modifier to make Link completely invisible
    
    ffc script hole{
        void run(int lava, int warpx, int warpy, int combotype, int tile){    
            int sfx = fallingsfx;
            if(warpx == 0 && warpy == 0){Waitframes(5); warpx = Link->X; warpy = Link->Y;}
            if(tile == 0){tile = linkfalling;}
            if(combotype == 0){combotype = 35;}
            if(lava != 0){if(tile == linkfalling){tile = linklava;}sfx = lavasfx;}
            int timer; bool switch;
            int x; int y; bool falling;
    
            while(true){
                if(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0){
                    if(Link->Action != LA_FROZEN && !falling){
                    falling = true;
                    }
                    while(falling && Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0 && timer < 5){
                        timer++;
                    Waitframe();
                    }
                    for(timer = 0; timer < 40; timer++){
                        if(!switch){Game->PlaySound(sfx); switch = true; x = Link->X; y = Link->Y;}
                        Link->Item[invis] = true;
                        Link->Action = LA_FROZEN;
                        if(lava == 0) Screen->DrawTile(2, x, y, tile+Floor(timer/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                        else Screen->DrawTile(2, x, y, tile+Floor(timer/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                    Waitframe();
                    }
                    switch = false;
                    Link->Item[invis] = false;
                    Link->X = warpx; Link->Y = warpy;
                    Link->Action = 0;
                    Link->HP -= 8;
                    Game->PlaySound(19);
                }
            Waitframe();
            }
        }
    }
    Make sure to set the Constant Integers at the beginning, and also to include them into the script file.

    Arguments:
    D0: If D0 is equal to '0', the script makes pits. If D0 is not equal to '0', the script makes lava.
    D1 && 2: D1 && 2 are the coordinates to have Link re-spawn at after falling into a pit. If left at 0, he will respawn where he entered the screen.
    D3: The combotype for 'Pit' combos. If left at '0', they will be 'centre statue' combos, by default.
    D4: The tile to be used for the 'Link Falling' animation. If left at '0', the ones set in the integers are the beginning will be used.

  2. #2
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,692
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,930
    Level
    28
    vBActivity - Bars
    Lv. Percent
    42.29%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    Awesome! Joe, you are an amazing scripter!
    Play The Darkness Within, my newest ZC Quest! Download here:
    http://www.purezc.net/index.php?page=quests&id=374

    Quote Originally Posted by rock_nog View Post
    Well of course eveything's closed for Easter - don't you know of the great Easter tradition of people barricading themselves up to protect themselves from the return of Zombie Christ?


  3. #3
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,300
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.29%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    Thanks :)

    [advertising]If you wanted a demonstration of this script in action, The Legend of Zelda: The Fort Knights is a good way of finding out how it works :)[/advertising]

  4. #4
    Octorok Beta Link's Avatar
    Join Date
    Jan 2007
    Age
    30
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,122
    Level
    11
    vBActivity - Bars
    Lv. Percent
    50.77%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    Hmm... Well, depending on how well it works, I might use it! Way to go on this! :)

  5. #5
    Developer
    ZC Developer

    Join Date
    Aug 2006
    Location
    Australia
    Age
    37
    Posts
    2,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,848
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.24%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    Instead of manually moving Link and changing his HP, you could just set his Action to LA_DROWNING. It's like I said in build 643:
    If you set it to LA_DROWNING, and Link isn't on a water tile, then he will 'drown', but his sprite won't be drawn at all.

  6. #6
    Patra Jigglysaint's Avatar
    Join Date
    Nov 2000
    Location
    Shady Oaks
    Age
    44
    Posts
    7,738
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,881
    Level
    26
    vBActivity - Bars
    Lv. Percent
    95.27%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    Cool. If I ever get this quest off the ground, I might use it.
    The name might be missleading, I'm not jigglypuff.


    "...A Bible! A Bible! We have got a Bible, and there cannot be any more Bible."
    Second Nephi 29:3

  7. #7
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,300
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.29%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    Do I not need to worry about the invisible LTM then?

  8. #8
    Octorok Beta Link's Avatar
    Join Date
    Jan 2007
    Age
    30
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,122
    Level
    11
    vBActivity - Bars
    Lv. Percent
    50.77%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    Hey! I tried compiling it in Zquest, and I got multiple errors. This is in b718, btw...

    Line 10- Function waitframes is undeclared
    Line 18- Function comboat is undeclared
    Line 19- Variable LA_Frozen is undeclared
    Line 22- Function comboat is undeclared
    Line 29- Variable LA_Frozen is undeclared
    Line 30- Function floor is undeclared
    Line 31- Function floor is undeclared

    So I guess the problems are "waitframes", "comboat", "LA_Frozen", and "floor". Waitframes is supposed to be "waitframe", isn't it? That's the only thing I could make out.

  9. #9
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,300
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.29%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    *sigh*

    Don't go and change all the 'Waitframes();' to 'Waitframe();', that won't do you any good.

    How many scripts are you using?

    It it's more than one, make sure they're all in the same .z file.
    Also, it'd probably be a good idea for you to put
    Code:
    import "std.zh"
    on the first line of the file

    The things that aren't compiling were declared within std.zh, and you haven't told ZScript to load it, therefore it doesn't know what they are.

    What I don't understand is why they're not just loaded by default.

  10. #10
    Octorok Beta Link's Avatar
    Join Date
    Jan 2007
    Age
    30
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,122
    Level
    11
    vBActivity - Bars
    Lv. Percent
    50.77%

    Re: Gameboy-Zelda Style Bottomless Pits/Lava Script

    ah, so that's the problem. Thanks!

    Don't go and change all the 'Waitframes();' to 'Waitframe();', that won't do you any good.
    Yeah, I thought so.

    Edit: Ugh, what now? The script compiled fine, but it's not working! At all! Someone must really not want me to use scripts in my quest.

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