User Tag List

Results 1 to 6 of 6

Thread: Sideview Ladder

  1. #1
    Banned
    Join Date
    Apr 2003
    Age
    37
    Posts
    1,268
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,070
    Level
    17
    vBActivity - Bars
    Lv. Percent
    92.39%

    Sideview Ladder

    Well, I know of the global script for sideview ladders, however I want an FFC version of it. Is there any chance on getting an FFC version of it, seeing as I don't plan on having too many sideview sections in my quest, and I don't want to be using up a global script slot (Seeing as we only have two).

    Edit: Oh shoot, I posted this in the wrong place. Can I get someone to move it to requests?

    Edit2: I tried the ladder FFC script CJC wrote, however for some reason in 864 link flickers, and acts as if he's falling when he's moving around on a ladder.

  2. #2
    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,850
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.65%

    Re: Sideview Ladder

    The reason he flickers is because of how sideview gravity is coded. I might make a slight change in that regard. Otherwise, use this:

    Code:
    const float GRAVITY = 0.16;
    
    // Use Slow Walk combos for the ladder.
    ffc script SideviewLadder {
      void run {
        if (Screen->ComboT[ComboAt(Link->X, Link->Y+15)]==CT_WALKSLOW)
        {
          Link->Jump = GRAVITY; // Negate gravity
          if (Link->InputUp && WalkableAt(Link->X+16, Link->Y+8) && WalkableAt(Link->X, Link->Y+8))
            Link->Y-=1;
          else if (Link->InputDown && WalkableAt(Link->X, Link->Y+16) && WalkableAt(Link->X+16, Link->Y+16))
            Link->Y+=1;
          if (WalkableAt(Link->X, Link->Y+16)) {
            Link->InputA = false;
            Link->InputB = false;
            // Change tiles
          }
        }
      }
    }
    You'll also need the WalkableAt method (or similar) defined somewhere.
    Code:
    // Determines whether a coordinate is walkable. 
    bool WalkableAt(int x, int y)
    {
      int x2 = Link->X % 16;
      int y2 = Link->Y % 16;
      int mask;
    
      if (x2 >= 8)
        mask = 1;
      else 
        mask = 2;
      if (y2 >= 8)
        mask << 2;
      return ((Screen->ComboS[ComboAt(x,y)] & mask)==0);
    }
    I might add WalkableAt to std.zh soon.

  3. #3
    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,850
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.65%

    Re: Sideview Ladder

    Quote Originally Posted by Sephiroth View Post
    and I don't want to be using up a global script slot (Seeing as we only have two).
    Don't think of global scripts in the same way that you think of FFC scripts. If you want a whole lot of mini-scripts to run every frame, you make them into methods within the global script, then have the run() method call them every frame. Like so:
    Code:
    global script Global {
     void FireSword() { 
     // imagine that there's code here
     }
     void RevivingEnemies() {
     // imagine that there's code here
     }
     void SpecialPowerTimer() {
     // imagine that there's code here
     }
     void run() {
      FireSword();
      RevivingEnemies();
      SpecialPowerTimer();
      Waitframe();
     }
    }

  4. #4
    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,850
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.65%

    Re: Sideview Ladder

    The reason he flickers is because of how sideview gravity is coded. I might make a slight change in that regard. Otherwise, use this:

    Code:
    const float GRAVITY = 0.16;
    
    // Use Slow Walk combos for the ladder.
    ffc script SideviewLadder {
      void run {
        if (Screen->ComboT[ComboAt(Link->X, Link->Y+15)]==CT_WALKSLOW)
        {
          Link->Jump = GRAVITY; // Negate gravity
          if (Link->InputUp && WalkableAt(Link->X+16, Link->Y+8) && WalkableAt(Link->X, Link->Y+8))
            Link->Y-=1;
          else if (Link->InputDown && WalkableAt(Link->X, Link->Y+16) && WalkableAt(Link->X+16, Link->Y+16))
            Link->Y+=1;
          if (WalkableAt(Link->X, Link->Y+16)) {
            Link->InputA = false;
            Link->InputB = false;
            // Change tiles
          }
        }
      }
    }
    You'll also need the WalkableAt method (or similar) defined somewhere.
    Code:
    // Determines whether a coordinate is walkable. 
    bool WalkableAt(int x, int y)
    {
      int x2 = Link->X % 16;
      int y2 = Link->Y % 16;
      int mask;
    
      if (x2 >= 8)
        mask = 1;
      else 
        mask = 2;
      if (y2 >= 8)
        mask << 2;
      return ((Screen->ComboS[ComboAt(x,y)] & mask)==0);
    }
    I might add WalkableAt to std.zh soon.

  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.68%

    Re: Sideview Ladder

    Quote Originally Posted by _L_ View Post
    I might add WalkableAt to std.zh soon.
    If you do, would you mind calling it isSolid rather than WalkableAt?

  6. #6
    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,850
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.65%

    Re: Sideview Ladder

    Well, if you insist.

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