User Tag List

Results 1 to 5 of 5

Thread: Jumping between screens (Global Variables)

  1. #1
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,612
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.97%

    Jumping between screens (Global Variables)

    I've been tinkering with a combination of _L_'s sideview gravity flag and a script of my own to allow the player to jump using the L button, and to allow for variable jumping heights. This is working pretty well so far, but I've encountered one snag.

    When Link jumps up off the top of a screen, he switches to a screen running a new FFC script. (I have FFCs running my jump script). Then, the gravity script takes over and yanks him down. So, in effect, he can't jump to a higher screen.

    I imagine the solution here is to use a global variable to keep track of Link's jumping status. But when I tried declaring such a global variable (outside of FFC scripts in the buffer) I just got an error message. What gives?

  2. #2
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.55%

    Re: Jumping between screens (Global Variables)

    Global variables will work that way eventually, but for now, variables in script scope are global:
    Code:
    ffc script foo {
       int aglobal;
    }
    which can then be accessed as foo.aglobal.

  3. #3
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,612
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.97%

    Re: Jumping between screens (Global Variables)

    Ah. So if I have the same FFC Script running on two screens, when I switch screens, the value in aglobal will transfer to the second FFC Script? Does the fact that the script will try to instantiate aglobal again cause a problem.

  4. #4
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,612
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.97%

    Re: Jumping between screens (Global Variables)

    I'm also having problems with Link moving smoothly left and right after falling from a Jump. The gravity script switches Link's combo and pulls him straight down, giving the player little or no control over left and right movement.

    I'd do away with the gravity flag entirely, except that I really like not having to worry about coding the enemies dropping due to gravity. _L_, do you have a ZScript version of your gravity code that can be applied though an FFC?

  5. #5
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.55%

    Re: Jumping between screens (Global Variables)

    Quote Originally Posted by C-Dawg View Post
    Ah. So if I have the same FFC Script running on two screens, when I switch screens, the value in aglobal will transfer to the second FFC Script?
    Yes.
    Does the fact that the script will try to instantiate aglobal again cause a problem.
    No. Global variables are instatiated in the automatically-generated ~Init script, which runs when you first start a quest, and never again.

    As for your gravity questions, I haven't gotten a chance to play around with the new gravity yet; you'll have to wait for _L_.

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