User Tag List

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

Thread: Climbing 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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Climbing script

    Please look further down this thread before reading this post, as I've revised the script a good few times and it's much better now



    Ever wanted vines that you climb rather than just walk slowly on?

    EDIT: Make sure you check down two posts before just using this script, the one on that post is a lot better though out, and easier to use.

    Code:
    ffc script climbing{
        void run(int btrtx, int btrty, int dummy){
            while(true){
                if( (Link->X >= this->X) && (Link->Y >= this->Y) && (Link->X <= btrtx) && (Link->Y <= btrty) ){
                    if(!Link->Item[dummy]){ Link->Item[dummy] = true;}
                    Link->InputA = false;
                    Link->InputB = false;
                    //Link->InputL = false;   //delete the two backslashes infont of the command here if you want to 
                                              //disable the L button whilst Link is on the ladder, incase 
                                              //you're using that for a function via a script or whatever
                }else{
                    if(Link->Item[dummy]){ Link->Item[dummy] = false;}
                }
            Waitframe();
            }
        }
    }
    Well here they are
    C-Dawg made this for me a while back, and I've revised it, and I thought it would be more obvious to people to find it here.

    It does, however, require some setup. Firstly, you need to set up an item with a Link Tile Modifier that will move Link's tiles along to a place where all of his movement tiles (ie, when walking in all directions) are facing upwards; the rest of his tiles won't matter because A and B buttons are disabled from use. Obviously you need to set up the Link tiles to this configuration also.

    Then in the screen you want your ladder/vines etc. set the FFC to take the script's coordinates to the top left hand corner of the ladder. Then set the the first two arguments of the script to the X and then Y coordinates of the bottom right hand corner of the ladder, then set the third argument to the reference number of the item (you'll find this in the item editor).

    And hey presto, Link now climbs properly!

    However, if you want more than one ladder/vine per screen, you will have to make an exactly identical custom item, with the same Link Tile Modifier but a different reference number for each ladder/vine, and set the argument to the other item's number.

  2. #2
    Gibdo Shoelace's Avatar
    Join Date
    Feb 2005
    Age
    38
    Posts
    777
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,633
    Level
    16
    vBActivity - Bars
    Lv. Percent
    75.65%

    Re: Climbing script

    You are freakin' awesome. I will use this for sure. I was hoping this script would be made. <3's Joe

  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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: Climbing script

    And with the Slow Walk script, I have rejiggered the Climbing Script to be more simple.

    Now, what it does is check whether Link is on a certain combotype (which you can set to be anything you like via D2, but if you don't set it it will revert to Left Statue), and apply the same effects - but it will also slow down Link's walking speed. So this means that you can set it to any combotype you like, and won't be restricted to using up all the screen's slow walk combos.

    Code:
    ffc script climbing2{
    	void run(int speed, int combotype , int dummy){
    		int framedelay;
    		if(combotype == 0){combotype = 11;}
    		if(speed == 0){speed = 1;}
    		while(true){
    			if(Screen->ComboT[ComboAt(Link->X+8, Link->Y+9)] == combotype){
    				if(!Link->Item[dummy]){ Link->Item[dummy] = true;}
    				if(Link->InputLeft && Link->Dir == DIR_LEFT){
    					if(framedelay == speed){Link->X = Link->X+1; framedelay = 0;}
    					else{framedelay++;}
    				}
    				if(Link->InputRight && Link->Dir == DIR_RIGHT){
    				if(framedelay == speed){Link->X = Link->X-1; framedelay = 0;}
    					else{framedelay++;}
    				}
    				if(Link->InputUp && Link->Dir == DIR_UP){
    					if(framedelay == speed){Link->Y = Link->Y+1; framedelay = 0;}
    					else{framedelay++;}
    				}
    				if(Link->InputDown && Link->Dir == DIR_DOWN){
    					if(framedelay == speed){Link->Y = Link->Y-1; framedelay = 0;}
    					else{framedelay++;}
    				}
    				Link->InputA = false;
    				Link->InputB = false;
    				Link->InputL = false;
    			}else{if(Link->Item[dummy]){ Link->Item[dummy] = false;}
    			}
    		Waitframe();
    		}
    	}
    }
    D0: The amount with which you want Link's walking speed to be reduced by. 1 is the slowest, and any number higher than one will steadily reduce his speed less. If you set it to 0, it reverts to 1 (0 will stop Link from being able to walk)
    D1: The combotype that you want to be 'Climbing' whilst on said screen. If you leave it as 0, it will revert to 11 (Left Statue)
    D2: The item ID number of the dummy item that you're using.

    See above for setup of item. However, you no longer need to use two dummy items for two lots of ladders on one screen :)

  4. #4
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,935
    Level
    28
    vBActivity - Bars
    Lv. Percent
    42.97%

    Re: Climbing script

    Joe, I think there is a problem with the first script. Sometimes it doesn't take away the dummy item, so Link continues climb as if he is on a ladder, even when he steps off of it.
    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?


  5. #5
    &&
    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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: Climbing script

    Oh. Well that's interesting. I can't say I've experienced that personally, do you know when it happens?

  6. #6
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,935
    Level
    28
    vBActivity - Bars
    Lv. Percent
    42.97%

    Re: Climbing script

    Mainly when walking off it going up, especially when you walk up the ladder to another screen. Like shown here.

    When you get to the next screen and off the ladder, he keeps walking like he was on the ladder.
    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?


  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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: Climbing script

    Oh, I know that will happen. I thought it wasn't worth making it not do that, because if you're going to have a ladder from the top of a screen you'll have it on the bottom of the next screen. If you set up the next screen, put the script and the top of those vines it'll work fine.

    EDIT: OOOOH the first script!
    The second one is a lot easier to use, trust me, and a lot less buggy. However, if you do the same thing that I just said with the first one it should also work properly.

    EDIT2: no actually that won't work. The way you'll have to do that is set up a script with the same custom item as the ladder in the first screen on the new screen, and don't give it any (x,y) coords for the ffc or for the arguments. Then you'd have to make another custom item and make it into the ladder. This is why the second script is so much better.

    EDIT2: well actually it might work. I did have this working but I can't remmeber how, when I wrote the new script I just scrapped the old one from my quest. You can get it to work, but it'll require some fiddling around. It's not really a bug in the script, it's doing what I've told it to, I just hadn't covered that situation very well.

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

    Re: Climbing script

    Okay, I'll get the new one. Now to go back through and redo all the ladders. Again.

    Edit: Didn't see your edit. How would I do this (sorry, I suck at scripting)?
    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?


  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,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: Climbing script

    Right well, I did lots of edits in the end.
    I do apologise about this, but I really would just use the second script. As of the moment, the Link detection on it isn't good (in that it'll pick Link up the moment his first pixel touches the combo), but I'm pending on a way of making it better, C-Dawg says I can, I'm just waiting for him to tell me how to really, which will end in being a simple addition to the script, so if you base your ladders around the second script, and I'll update it and it'll be completely compatible, just work slightly better.

  10. #10
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,935
    Level
    28
    vBActivity - Bars
    Lv. Percent
    42.97%

    Re: Climbing script

    O.K. Thanks for the great scripts.

    Edit: How do I get the number for the combo type. I tried figuring out how left statue is 11, but I just don't get it.
    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?


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