Jump to content

Photo

FFC Sideview Ladder


  • Please log in to reply
2 replies to this topic

#1 Sephiroth

Sephiroth

    The Legendary Sephiroth

  • Members
  • Location:Somewhere... Lemme know if you find me :)

Posted 26 May 2009 - 10:17 AM

Ok, well, I'd like a sideview ladder script that doesn't have this problem. I want it to be an FFC script, as the majority of my quest is top-down, except for passageways in dungeons where I have sideview gravity enabled. Here is the script I am currently using, is there a possibility of getting a script that would cause Link to face up whenever on a ladder, as well as animate as if Link is climbing the ladder?

CODE
const int ladderflag = 100;

ffc script ladder{
    void run(int speed, int combotype , int dummy){
        int framedelay;
        int lc;
        if(combotype == 0){combotype = 11;}
        if(speed == 0){speed = 1;}
        while(true){
        lc = ComboAt(Link->X+8, Link->Y+15);
            if(Screen->ComboF[lc] == ladderflag || Screen->ComboI[lc] == ladderflag){
                if(Link->Jump < 0) Link->Jump = 0;
                if(Link->InputDown && !isSolid(Link->X, Link->Y+16)) Link->Y += 1;
                if(Link->InputUp && !isSolid(Link->X, Link->Y - 1)) Link->Y -= 1;
                                    //[[Sets up the antigravity effect]]
                if(!Link->Item[130]){ Link->Item[130] = true;}
                if(Link->InputLeft && Link->Dir == 2){
                    if(framedelay == 3){Link->X = Link->X+1; framedelay = 0;}
                    else{framedelay++;}
                }
                if(Link->InputRight && Link->Dir == 3){
                if(framedelay == speed){Link->X = Link->X-1; framedelay = 0;}
                    else{framedelay++;}
                }
                if(Link->InputUp && Link->Dir == 0){
                    if(framedelay == speed){Link->Y = Link->Y+1; framedelay = 0;}
                    else{framedelay++;}
                }
                if(Link->InputDown && Link->Dir == 1){
                    if(framedelay == speed){Link->Y = Link->Y-1; framedelay = 0;}
                    else{framedelay++;}
                }
                Link->InputA = false;
                Link->InputB = false;
                Link->InputL = false;
                Link->InputR = false;
            }else{if(Link->Item[130]){ Link->Item[130] = false;}
            }
        Waitframe();
        }
    }
}

bool isSolid(int x, int y) {
    if(x<0 || x>255 || y<0 || y>175) return false;
    int mask=1111b;
    if(x%16<8)
        mask&=0011b;
    else
        mask&=1100b;
    if(y%16<8)
        mask&=0101b;
    else
        mask&=1010b;
    return (!(Screen->ComboS[ComboAt(x, y)]&mask)==0);
}


I would really appreciate this. ^_^' (Oh, and a bonus request, how about a simple vine-climbing/ladder-climbing script (Again, FFC) for the overworld? (Just making Link face north and using a climbing animation, as well as disabling the A and B buttons))

Thanks for hearing me out.

#2 lucas92

lucas92

    Defender

  • Members

Posted 26 May 2009 - 06:18 PM

Add this :

CODE

Waitdraw();
Link->Action = LA_WALKING;
Link->Dir = DIR_UP;


That will make Link walks up... But if you want to use other tiles :

- Use Link Tile modifiers or;

- Make Link invisible by having an action that has no graphics, then draw a combo at Link's position.

Edited by lucas92, 26 May 2009 - 06:19 PM.


#3 Sephiroth

Sephiroth

    The Legendary Sephiroth

  • Members
  • Location:Somewhere... Lemme know if you find me :)

Posted 26 May 2009 - 11:35 PM

QUOTE(lucas92 @ May 26 2009, 06:18 PM) View Post

Add this :

CODE

Waitdraw();
Link->Action = LA_WALKING;
Link->Dir = DIR_UP;


That will make Link walks up... But if you want to use other tiles :

- Use Link Tile modifiers or;

- Make Link invisible by having an action that has no graphics, then draw a combo at Link's position.


Unfortunately this is a FFC script, and Waitdraw(); only executes in a global script.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users