User Tag List

Results 1 to 4 of 4

Thread: Holding one button and pressing another

  1. #1
    No Products Registered

    Join Date
    Sep 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Holding one button and pressing another

    Im trying to make a game that works with a guitar controller, (Using the joystick 2 extension btw) kind of guitar hero like. I want a note to only play if I hold down the note button and then strum. I've got it set up so it pretty much works but its a little glitchy...

    Basically I have 2 values, NOTE and STRUM, both default at 0. if you hold the note button it will set the "note" value to 1. If you strum it will set the "strum" value to 1. To play the note, NOTE must be 1 and STRUM must be 0.

    It seems to work mostly but it looks like I made a paradox or something. Because the act of hitting the strum bar would change STRUM to 1, not 0 like required by my action. So please help me before I destroy the universe with my coding.

  2. #2
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Holding one button and pressing another

    Well your events are clearly contradicting themselves. You say if you strum, it sets strum value to one. But then you say "the act of hitting the strum bar would change STRUM to 1, not 0 like required by my action." Seems what your writing in the events isn't what your trying to get. I would try this:

    X(negate!)Repeat while Note button is being pressed-sub 1 from note

    and then

    Repeat while Note button is being pressed - add 1 to note. (make sure to set counter max to 1, or just use Set counter instead of add)

    Make sure to add those same events to the "strum" counter as well. That should work, unless I am misinterpreting what you are trying to do.

    For the event that actually plays a sample, I would set it to "one action when event loops" just so that note does'nt ring out.



  3. #3
    No Products Registered

    Join Date
    Sep 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Holding one button and pressing another

    Actually, that is exactly how I have it. Sorry, I didnt explain it very well. It basically works, but is pretty easy to break - if I hold down strum and then press a button right on the note it will play, and after that if I keep the buttons down it will play every note that comes.

    So I have

    *X Repeat while Note button is being pressed - set note to 0

    *Repeat while Note button is being pressed - set note to 1

    *X point of view (strum) button is backward - set strum to 0

    *strum is 0
    *note is 1
    *point of view is backward
    *obj 1 is overlapping obj 2 - set strum to 1, play note

  4. #4
    No Products Registered

    Join Date
    Sep 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Holding one button and pressing another

    Still pretty stuck on this, any help would be awesome...

Similar Threads

  1. Rotation issue: Click button, rotate object X degrees, stop (without holding key)
    By Babalucci in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 8th April 2016, 03:10 AM
  2. Pressing a button twice
    By Bench in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th April 2010, 04:15 AM
  3. Animation not playing when holding a mouse button
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 10th March 2009, 05:56 PM
  4. Animation stuck while holding a fire button.
    By Kris in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 14th June 2008, 09:47 AM
  5. user holding down mouse button on object
    By TwistidChimp in forum The Games Factory 2 - Technical Support
    Replies: 14
    Last Post: 7th May 2007, 11:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •