User Tag List

Results 1 to 3 of 3
  1. #1
    Lynel Sephiroth's Avatar

    Join Date
    Apr 2003
    Age
    26
    Posts
    1,265
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Sideview Ladder - FFC Script

    Ok all, what I am requesting is a sideview ladder script that can be attached to a FFC (I don't want to use a global script, for I'll only be using sideview gravity on a teeeeny tiny amount of screens (like maybe 8 or 9 through the entire quest) and I would like to keep an FFC script for it.

    The current FFC script I have is:
    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);
    }
    Forgot where I got it, maybe that one ZScript site that I can't even seem to locate again, but blah.

    What I'm wanting to fix is depicted in this video. See how link "flickers"? How can I prevent this and have a smooth animation while on the ladders? (Preferrably keeping Link faced to the north)

  2. #2
    Is this the end? ZC Developer Saffith's Avatar

    Join Date
    Jan 2001
    Age
    30
    Posts
    2,785
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)
    Not certain it'll work, but try changing line 11 to this:
    Code:
    				if(Link->Jump < 0.16) Link->Jump = 0.16;
    Assuming you have gravity set to 0.16.
    [téknolŕiz]

    Recent script updates:
    2013-05-11: ghost.zh updated to 2.6.2
    2013-05-01: ffcscript.zh updated to 1.1.0
    Spoiler: show
    ffcscript.zh 1.1.0 - Updated 2013-05-01
    ghost.zh 2.6.2 - Updated 2013-05-11

    Armos Knights - Updated 2013-02-18
    Armos (LttP) - Updated 2013-02-19
    Big Tektite - Updated 2013-03-01
    Buzz Blob - Updated 2012-12-11
    Chaser - Updated 2012-12-11
    Goriya (LttP) - Updated 2012-12-11
    Homing fireball shooter - Updated 2012-12-11
    Popo - Updated 2012-12-11
    Spume - Updated 2012-12-11
    Twin Amoeba - Updated 2012-12-11
    Wall bouncer - Updated 2012-12-11

  3. #3
    Lynel Sephiroth's Avatar

    Join Date
    Apr 2003
    Age
    26
    Posts
    1,265
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That works very well, now if only I could get Link to always face up on a ladder and to have some animation while on the ladder as well.

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
  •