User Tag List

Results 1 to 4 of 4

Thread: Disable 'A' and 'B' when facing...

  1. #1
    Cor Blimey! CJC's Avatar
    Join Date
    Dec 2002
    Location
    Fading into the darkness
    Age
    35
    Posts
    1,398
    Mentioned
    150 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,621
    Level
    25
    vBActivity - Bars
    Lv. Percent
    1.45%

    Disable 'A' and 'B' when facing...

    I know this is probably going to turn out to be very simple, but I don't know anything about programming or scripting, so please bear with me.



    I'm making a quest that's entirely side-scroller, and I want to disable items when facing up and down. Partially because the player will be on a ladder when pointed that way, but mostly because I don't want to animate attacks for those directions. So, basically I need a way to log Link's facing and disable the two main item controls when he's facing up and/or down.
    I'm an author. If you're interested in checking out my works, you can find them on Amazon.com:


  2. #2
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,433
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.08%

    Re: Disable 'A' and 'B' when facing...

    No problem.
    NoUpOrDownActions.z

  3. #3
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,579
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.36%
    Achievements It's over 9000!

    Re: Disable 'A' and 'B' when facing...

    Hm. Intriguing. Nice script, Saffith, as always. May I ask a stupid question though?

    Code:
    while(true)
          {
             if(Link->Dir==DIR_UP || Link->Dir==DIR_DOWN)
             {
                Link->InputA=false;
                Link->InputB=false;
             }
    
             Waitframe();
          }

    This is a "while" operation. The pseudocode is easy enough to comprehend, but seeing as it's a while operation, it states that -while- Link is facing up or down, A and B are set to False. Why doesn't it have to reactivate them? Is a state of "true" already assumed if it's not in the while loop? How or why is it assumed? O.o It's like it set it to false but doesn't set it to true anywhere.

    It's fairly obvious how it can be true outside of the while loop, as it's the default, but why does it automatically assume the default of being true when the while loop deactivates?

  4. #4
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,433
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.08%

    Re: Disable 'A' and 'B' when facing...

    Ah, see, the InputXes don't enable or disable the buttons; rather, at the beginning of each frame, they're set to true if the corresponding button is being pressed and false if it's not. The script doesn't actually disable the buttons, it just tells the game they're not being pressed every frame.

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