User Tag List

Results 1 to 4 of 4

Thread: Press and Release keys

  1. #1
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.41%

    Press and Release keys

    I know it can already be faked, but ZScript needs "Press(Input*)" And "Release(Input*)"

    Pretty much they're just functions that return a bool when the input is true then not true and vice-versa.

    You would need this if you wanted to make a playable ocarina, or even most custom items.
    Avatar: Just who the SPAAAACE do you think I am?

  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: Press and Release keys

    I'm not sure I see how this would be different from what we already have. Do you mean to write event-driven scripts?

    By the way, use [/color] instead of [color=Black]. It's white for some of us, remember.

  3. #3
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.41%

    Re: Press and Release keys

    Quote Originally Posted by Saffith View Post
    By the way, use [/color] instead of [color=Black]. It's white for some of us, remember.
    Sorry, I use the WYSIWYG text editor.

    Well, normally, the keypress events return true every frame, this way, they only return true once. (when the button just gets pushed or released)
    Avatar: Just who the SPAAAACE do you think I am?

  4. #4
    Octorok
    Join Date
    Oct 2003
    Location
    Monsteropolis
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,147
    Level
    11
    vBActivity - Bars
    Lv. Percent
    62.09%

    Re: Press and Release keys

    While Press* and Release* would indeed be helpful, it can be somewhat faked right now. Take a look at this part of my Fixed Direction script:

    http://www.armageddongames.net/showthread.php?t=94457
    Code:
        if (!Link->InputL && !Link->InputR) {
         turned = false;
        }
        if (Link->InputL) {
         Link->InputL = false;
         if (!turned) turn(false);
        }
        if (Link->InputR) {
         Link->InputR = false;
         if (!turned) turn(true);
        }
    In case it isn't obvious from the snippet, that turn() function is setting turned to true. See how I just prevented the code from firing again as long as the button is still held down? You could hook a function to either side of the logic to emulate the two functions. Of course, you'd need a separate loop and boolean for each key/combination you want to check for...
    Crash Man is the coolest Robot Master ever! Well, aside from Skull Man, Elec Man, Quick Man, Gemini Man, Shadow Man... ahh, forget it!

    Megaman: "Who cares if it's peacetime? You're an inventor, damnit - MAKE SOMETHING!"
    Dr Light: " 'Necessity is the mother of invention.' "
    Megaman: "Good, I'm hungry. Go invent me a sandwich."

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