User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Sideview "ladderscript" bug

  1. #1
    Keese
    Join Date
    Apr 2008
    Age
    31
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    799
    Level
    9
    vBActivity - Bars
    Lv. Percent
    91.28%

    Question Sideview "ladderscript" bug

    So, I got a ladderscript for my quest which makes an functional ladder in sideview gravity. Now this works very fine, but Link's animation is screwed up when he goes over the ladder.

    Here is the script:
    Code:
    import "std.zh"
    
    //Courtesy of Saffith, beefster09, and pkmnfrk
    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;
      
      int ret = Screen->ComboS[ComboAt(x, y)] & mask;
      return (ret!=0);
    
    }
    
    ffc script ladder {
      void run(int f) {
        if(f == 0) f = 98;
        
        while(true) {
          if(Screen->ComboF[ComboAt(Link->X+8, Link->Y)] == f) {
            if(Link->Jump < 0) Link->Jump = 0;
            
            if(Link->InputDown) {
              if(!isSolid(Link->X, Link->Y + 1)) Link->Y += 1;
            }
            if(Link->InputUp) {
              if(!isSolid(Link->X, Link->Y - 1)) Link->Y -= 1;
            }
          }
          Waitframe();
        }
      }
    }
    Here is a simple test demo, to confirm the bug:
    Quest File(Ignore the enemies, as they will be for another bug I'll post here too)

    Bug is found in Build 846.

    Edit: Someone also checked for me if the script doesn't change animation, it doesn't so that's why this belongs here.

  2. #2
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,827
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,975
    Level
    33
    vBActivity - Bars
    Lv. Percent
    27.94%

    Re: Sideview "ladderscript" bug

    These would be the only lines that would change links behavior.

    It's not changing the animation, only changing his coordinates.



    Code:
    if(Screen->ComboF[ComboAt(Link->X+8, Link->Y)] == f) {
            if(Link->Jump < 0) Link->Jump = 0;
            
            if(Link->InputDown) {
              if(!isSolid(Link->X, Link->Y + 1)) Link->Y += 1;
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  3. #3
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,158
    Level
    18
    vBActivity - Bars
    Lv. Percent
    14.3%

    Re: Sideview "ladderscript" bug

    1. This is my script, but
    2. I don't know how to fix the animation problem.

    I know what's causing it (Game says "Link's not standing on a solid combo, he should fall!", and I'm saying "Link isn't falling, he's just standing there")

    What we need is a built in ladder combo. Or, failing that, a way to change gravity via scripting.
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  4. #4
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,827
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,975
    Level
    33
    vBActivity - Bars
    Lv. Percent
    27.94%

    Re: Sideview "ladderscript" bug

    What about:
    1; using a waitdraw(); or,
    2; "locking in" Links x,y every frame with said waitdraw()
    as a workaround? ..making sure that the screen doesn't re-render him a pixel off from where you want him to be.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  5. #5
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,319
    Level
    26
    vBActivity - Bars
    Lv. Percent
    11.03%

    Re: Sideview "ladderscript" bug

    Just to clarify to TwilightKnight, this is how the script works, it's not a bug with ZC itself.

  6. #6
    Octorok Beta Link's Avatar
    Join Date
    Jan 2007
    Age
    31
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,140
    Level
    11
    vBActivity - Bars
    Lv. Percent
    59.09%

    Re: Sideview "ladderscript" bug

    You know, to fix this 'bug', I just use Joe123s 'climbing' script along with it. I find it works very well.

  7. #7
    Developer
    ZC Developer

    Join Date
    Aug 2006
    Location
    Australia
    Age
    37
    Posts
    2,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,866
    Level
    25
    vBActivity - Bars
    Lv. Percent
    40.13%

    Re: Sideview "ladderscript" bug

    Here is what the problem is!
    Code:
            if(Link->Jump < 0) Link->Jump = 0;
    You might think this is sufficient to stabilise Link in midair. Not quite! In fact, every frame that Link spends off the ground, the Gravity constant in Init Data is subtracted from his Jump. This is how gravity works!

    So, to negate this effect during every frame, you must do this!

    Code:
    const int GRAVITY = 0.16; // Must equal your Gravity constant in Init Data.
    ...
            if(Link->Jump <= 0) Link->Jump = GRAVITY;
    That being said, I could conceivably add a fix that stops Link's gravity during the single frame after a script sets Link->Jump, if you fellows think it makes the most sense. But this might throw off a few people who have already written scripts that use the current behaviour.

  8. #8
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,158
    Level
    18
    vBActivity - Bars
    Lv. Percent
    14.3%

    Re: Sideview "ladderscript" bug

    Or, like, let us change gravity, which would have more use overall.
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  9. #9
    Developer
    ZC Developer

    Join Date
    Aug 2006
    Location
    Australia
    Age
    37
    Posts
    2,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,866
    Level
    25
    vBActivity - Bars
    Lv. Percent
    40.13%

    Re: Sideview "ladderscript" bug

    How would changing Gravity be useful? If you set it to 0, then the enemies, items and weapons wouldn't fall down either.

  10. #10
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,158
    Level
    18
    vBActivity - Bars
    Lv. Percent
    14.3%

    Re: Sideview "ladderscript" bug

    Well, it's entirely possible that I didn't think of that.

    Be that as it may, changing gravity would be useful in circumstances other than this. Like, LINK IN SPACE! Or something.
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

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