Jump to content

Photo

Pull?


  • Please log in to reply
5 replies to this topic

#1 NineLives

NineLives

    Boom. Zoom. Dakota.

  • Members
  • Location:Los Angeles, California

Posted 07 April 2008 - 01:59 PM

I dont know if someone has already done it, but can someone make a script where link can grab stuff and pull?
And if he pulls on a block that is moveable, the block gets pulled?

Anyone can do that?

#2 Joe123

Joe123

    Retired

  • Members

Posted 07 April 2008 - 03:24 PM

I started coding this a long time ago, and I had it going quite nicely, but it was pretty buggy, and I had problems duplicating it so that it worked in all directions.
I can post the code up if someone else wants a go, I'm not going to be returning to it anytime soon.

#3 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 08 April 2008 - 03:22 AM

Did you use Ltm's and disable inputs? That's probably the best way to go about it. I'm thinking you "lock" Link in place and move the ffc and Link together.

Hmm..another problem is no ones really made any modular psudo-solidity type scripts yet. I'm planning to, if the next dam beta ever gets compiled. :#$%&

#4 Joe123

Joe123

    Retired

  • Members

Posted 08 April 2008 - 10:08 AM

Nono, mine works with hard-coded blocks.

It makes Link invisible, sticks an ffc where he is, and moves him to the other side of the block.
You then push the block from the other side, so it looks like you're pulling it.

#5 NineLives

NineLives

    Boom. Zoom. Dakota.

  • Members
  • Location:Los Angeles, California

Posted 08 April 2008 - 11:41 AM

thats interesting! Haha, I never thought it might work that way, I just thought the block just moves with link when he moves backwards or something.
So... may I have it? (PM if you must.)

#6 Joe123

Joe123

    Retired

  • Members

Posted 08 April 2008 - 11:52 AM

Well, that's the effect created, it looks like that's what happens, but it's not.

CODE
ffc script pullblock{
    void run(){
        int invis = 131;
        int tile = 9206;
        int leftswitch = 0;
        int rightswitch = 0;
        int downswitch = 0;
        int upswitch = 0;
        int movelinkswitchleft = 0;
        int movelinkswitchright = 0;
        int comboatswitch = 0;
        int timer;
        int orig;
        int x;
        int y;
        int framedelay;
        while(true){
            if(Screen->ComboF[ComboAt(Link->X+16, Link->Y)] == 61 //left of block detection function
             && Screen->ComboF[ComboAt(Link->X, Link->Y)] != 61
             && Link->InputL == true
             && Link->InputLeft == false
             && Link->InputRight == false
             && Link->Dir == DIR_RIGHT
             && Link->X > 16){
                leftswitch = 1;
                noroll = 1;
            }

            if(Screen->ComboF[ComboAt(Link->X-16, Link->Y)] == 61 //right of block detection function
             && Screen->ComboF[ComboAt(Link->X, Link->Y)] != 61
             && Link->InputL == true
             && Link->InputLeft == false
             && Link->InputRight == false
             && Link->Dir == DIR_LEFT
             && Link->X < 240){
                rightswitch = 1;
                noroll = 1;
            }

            if(leftswitch == 1){    //left of block main function
                Link->InputDown = false;
                Link->InputRight = false;
                Link->InputUp = false;
                Link->Dir = DIR_LEFT;
                Link->Item[invis] = true;
                Link->Item[I_CLOCK] = true;
                if(movelinkswitchleft == 0){
                    Link->X = Link->X+32;
                    movelinkswitchleft = 1;
                }
                if(comboatswitch == 0){
                    x = Link->X;
                    y = Link->Y;
                    orig = Screen->ComboT[ComboAt(x, y)];
                    Screen->ComboT[ComboAt(x, y)] = 0;
                    comboatswitch = 1;
                }
                if(Screen->ComboF[ComboAt(Link->X-16, Link->Y)] == 61){Screen->DrawTile(2, Link->X-32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);}
                if(Link->InputLeft && leftswitch == 1 && Screen->ComboF[ComboAt(Link->X-32, Link->Y)] != 67 && Screen->ComboF[ComboAt(Link->X-16, Link->Y)] == 61 && Link->X >= 16){
                    comboatswitch = 2;
                    for(timer = 0; timer < 4; timer++){
                        Link->InputRight = false;
                        Link->InputDown = false;
                        Link->InputUp = false;
                        Screen->DrawTile(2, Link->X-32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                        Waitframe();
                    }
                    for(timer = 0; timer < 32; timer++){
                        if(framedelay == 1){Link->X = Link->X - 1; framedelay = 0;}
                        else{framedelay++;}
                        Link->InputLeft = false;
                        Link->InputRight = false;
                        Link->InputDown = false;
                        Link->InputUp = false;    
                        Screen->DrawTile(2, Link->X-32, Link->Y, tile+1, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                        Waitframe();
                    }
                    for(timer = 0; timer <15; timer++){
                        Link->InputRight = false;
                        Link->InputDown = false;
                        Link->InputUp = false;
                        Link->InputLeft = false;
                        Screen->DrawTile(2, Link->X-32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                        Waitframe();
                    }
                    Link->InputLeft = false;
                    Link->InputRight = false;
                    Link->InputDown = false;
                    Link->InputUp = false;    
                    Screen->DrawTile(2, Link->X-32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                }
                if(comboatswitch == 2){Screen->ComboT[ComboAt(x, y)] = orig; comboatswitch = 0;}
                if(Link->InputL != true || Screen->ComboF[ComboAt(Link->X-16, Link->Y)] == 66){
                    Link->Item[invis] = false;
                    Link->Item[I_CLOCK] = false;
                    leftswitch = 0;
                    noroll = 0;
                    if(movelinkswitchleft == 1){
                        Link->X = Link->X-32;
                        movelinkswitchleft = 0;
                        Link->Dir = DIR_RIGHT;
                    }
                    if(comboatswitch > 0){Screen->ComboT[ComboAt(x, y)] = orig; comboatswitch = 0;}    
                }
            }

            if(rightswitch == 1){    //right of block main function
                Link->InputDown = false;
                Link->InputLeft = false;
                Link->InputUp = false;
                Link->Dir = DIR_RIGHT;
                Link->Item[invis] = true;
                Link->Item[I_CLOCK] = true;
                if(movelinkswitchright == 0){
                    Link->X = Link->X-32;
                    movelinkswitchright = 1;
                }
                if(comboatswitch == 0){
                    x = Link->X;
                    y = Link->Y;
                    orig = Screen->ComboT[ComboAt(x, y)];
                    Screen->ComboT[ComboAt(x, y)] = 0;
                    comboatswitch = 1;
                }
                if(Screen->ComboF[ComboAt(Link->X+16, Link->Y)] == 61){Screen->DrawTile(2, Link->X+32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 1, true, 128);}
                if(Link->InputRight && rightswitch == 1 && Screen->ComboF[ComboAt(Link->X+32, Link->Y)] != 67 && Screen->ComboF[ComboAt(Link->X+16, Link->Y)] == 61 && Link->X <= 240){
                    comboatswitch = 2;
                    for(timer = 0; timer < 4; timer++){
                        Link->InputLeft = false;
                        Link->InputDown = false;
                        Link->InputUp = false;
                        Screen->DrawTile(2, Link->X+32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 1, true, 128);
                        Waitframe();
                    }
                    for(timer = 0; timer < 32; timer++){
                        if(framedelay == 1){Link->X = Link->X + 1; framedelay = 0;}
                        else{framedelay++;}
                        Link->InputLeft = false;
                        Link->InputRight = false;
                        Link->InputDown = false;
                        Link->InputUp = false;    
                        Screen->DrawTile(2, Link->X+32, Link->Y, tile+1, 1, 1, 6, 1, 0, 0, 0, 1, true, 128);
                        Waitframe();
                    }
                    for(timer = 0; timer <15; timer++){
                        Link->InputRight = false;
                        Link->InputDown = false;
                        Link->InputUp = false;
                        Link->InputLeft = false;
                        Screen->DrawTile(2, Link->X+32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 1, true, 128);
                        Waitframe();
                    }
                    Link->InputLeft = false;
                    Link->InputRight = false;
                    Link->InputDown = false;
                    Link->InputUp = false;    
                    Screen->DrawTile(2, Link->X+32, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 1, true, 128);
                }
                if(comboatswitch == 2){Screen->ComboT[ComboAt(x, y)] = orig; comboatswitch = 0;}
                if(Link->InputL != true || Screen->ComboF[ComboAt(Link->X+16, Link->Y)] == 66){
                    Link->Item[invis] = false;
                    Link->Item[I_CLOCK] = false;
                    rightswitch = 0;
                    noroll = 0;
                    if(movelinkswitchright == 1){
                        Link->X = Link->X+32;
                        movelinkswitchright = 0;
                        Link->Dir = DIR_LEFT;
                    }
                    if(comboatswitch > 0){Screen->ComboT[ComboAt(x, y)] = orig; comboatswitch = 0;}    
                }
            }

        Waitframe();
        }
    }
}


I'm afraid it's rather monstrous though.
I wrote it when I hadn't been scripting too long, and it's probably not really perfect at all.
At the moment, it only works for pulling left and right, I had trouble duplicating the functions for up and down.
And also, it only works for flag '61' pushblocks at present.

You can't really use it in current state though I'm afraid.
It works sort of, but it's far too buggy.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users