Jump to content

Photo

Pit Script by Joe123


  • Please log in to reply
5 replies to this topic

#1 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 24 October 2010 - 05:36 PM

At least I'm pretty sure he wrote it. But anyways, is there any way to make this script activate ... "instantly"? There's a bug of sorts, a person can simply jump across any pit with roc's feather if they're quick enough. I mean like huge pits that take up most of the room. Call it a "double jump" of sorts. There's like a split second before the script kicks in and link falls into the pit.

CODE
const int linkfalling = 10; // set here the first tile of your 5 tile Link Falling animation
const int linklava = 30; // set here the first tile of your 5 tile Link Drowning animation
const int fallingsfx = 81; // set here the SFX that plays when Link falls
const int lavasfx = 82; // set here the SFX that plays when Link drowns in lava

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 i; int x; int y; bool falling;

        while(true){
            falling = false;
            while(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] != combotype || Link->Z > 0 || Link->Action == LA_FROZEN) Waitframe();

            i = 0;
            while(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0 && Link->Action != LA_FROZEN && i < 5){
                i++;
                if(i==5) falling = true;
            Waitframe();
            }

            if(falling){
                Screen->ClearSprites(3);
                Game->PlaySound(sfx);
                x = Link->X; y = Link->Y;
                for(i=0;i<40;i++){
                    Waitframe();
                    Link->Action = LA_DROWNING;
                    if(lava == 0) Screen->DrawTile(2, x, y, tile+Floor(i/8), 1, 1, 6, -1, -1, 0, 0, 0, 0, true, 128);
                    else Screen->DrawTile(2, x, y, tile+Floor(i/8), 1, 1, 6, -1, 1, 0, 0, 0, 0, true, 128);
                }
                Link->X = warpx; Link->Y = warpy;
                Link->Action = 0;
                Link->HP -= 8;
                Game->PlaySound(19);
            }
        }
    }
}


#2 MarioBrosCom

MarioBrosCom

    Adept

  • Members
  • Real Name:Stylianos
  • Location:Canada

Posted 24 October 2010 - 07:30 PM

The problem is in this block:
CODE
i = 0;
while(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0 && Link->Action != LA_FROZEN && i < 5){
    i++;
    if(i==5) falling = true;
    Waitframe();
}

The script seems to give you five frames to jump back in the air after you land.

If you replace that block with this one, jumping back in the air should no longer prevent you from falling into a pit.
CODE
i = 0;
while(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Action != LA_FROZEN && i < 5){
    i++;
    if(i==5) falling = true;
    Waitframe();
}



#3 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 25 October 2010 - 08:11 AM

Thanks! I'll try it now. *copypastes and compiles and tests*

#4 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 09 November 2010 - 02:52 PM

Neither version of this script would compile for me.
I've been trying to get this script to work:

pitscript

but I get the error that there is no misc variable..

#5 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 09 November 2010 - 11:19 PM

I have had some weird problems with this script too. For example:
•If a whistle whirlwind carries link over a pit, he will be caught in an endless loop
•If link's boomerang is out when he falls in a pit, it will continually make noise
•On certain screens, falling in pits will make Link appear in the bottom left corner of the screen instead of where he enters from
•Link can sometimes walk diagonally past a pit formation like this:

OX O=pit
XO X=solid ground

If I put a pit here:

XX
XO

this is no longer a problem...

Can someone explain and/or fix these problems?

#6 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 10 November 2010 - 05:29 PM

I'm on the verge of scripting screens to give/take away flippers.
Not an ideal solution.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users