Touch Released Issue and Possible Work Around?

KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
edited November 2013 in Working with GS (Mac)
I am going to explain this the best I can. I have a button actor that when pressed is released it brings in the drop down menu. So rules for main button are:

When touch is released
AND
game.DropDown is false

Change game.DropDown to true

When game.DropDown is true it brings in the drop down menu and a button for the menu and when game/DropDown is false it removes the drop down. The rules in that button are:

When touch is released
AND
When game.DropDown is true

Change game.DropDown to false

The issue I am having is after I press and release the main button to trigger the drop down menu, it's always going to keep registering that is is being released and keep changing game.DropDown to true right as it changes to false. The only way to stop in is by clicking on the main button then dragging your finger off the actor then releasing. It then won't continuing to register is as being released. Hopefully my description makes sense and someone can help out!

I decided to throw a small video together to show the issue I'm having as it was a little to confusing to type out. Below is a link to check out the video.

http://s1070.photobucket.com/user/killerpenguins/media/TouchReleasedIssue_zps0a416ac4.mp4.html

Thank you in ADVANCE!

Comments

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    edited November 2013
    Hey,

    I found your bug: in the green button prototype, you have a Rule with two conditions (touch is released AND dropdown == false). You need to delete the dropdown condition because the release state is ongoing and if you try to change the dropdown to false with the second button it immediately refreshes to true.

    Hope this helps!

    Edit: Did it work @KillerPenguinStudios?
    Hey @sadida172,
    I understand what you are saying and I know by removing the "when game.DropDown = false" condition it won't immediately change it back to true once changed to false and will technically work properly. I attached another project and this one has another button that when touch is released, it plays a sound clip. I want the sound to play when touch is released but don't want the sound clip to play when the drop down menu is active. Hope that makes sense why I had the, "when game.DropDown = false."
  • allc1865allc1865 Member, PRO Posts: 777
    Is this what you wanted the sound to be like?
    https://www.dropbox.com/s/vik1ixuav8znqjv/drop_down_test.zip
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Is this what you wanted the sound to be like?
    https://www.dropbox.com/s/vik1ixuav8znqjv/drop_down_test.zip
    I don't really see anything you did in the project. All looks like what I already had. Please let me know what I am missing here.

  • allc1865allc1865 Member, PRO Posts: 777
    @KillerPenguinStudios, Are you trying to get your sound to play when you click the Press me button that opens the menu?
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @KillerPenguinStudios, Are you trying to get your sound to play when you click the Press me button that opens the menu?
    @allc1865,
    No as I already know how to do that. What I am trying to get working is when button, "Press me to play sound!" touch is released, play sound. But when drop down is true, I don't want you to be able to press that button to play sound. Hopefully that makes more sense!

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Hey @allc1865,
    That is what I had originally. It works in the sense that if the drop down menu is not active it will play when, "Press me to play sound!" actor's touch is released and when menu is active, it wont play if touch is released. The issue is when the menu is active and you touch then release the "Press me to play sound!" actor then press the, "Press me again" button to remover the drop down menu, since you have touched then released the, "Press me to play sound!" actor it will play the sound right as the drop down menu goes away. Then every time after that when you activate the deactivate the drop down menu, the sound will always play unless you touch the, "Press me to play sound!" actor then while touching it you drag off the actor the release in the scene off the actor, it won't play the sound when the menu is deactivated. Hopefully what I wrote makes sense.
  • KeithQKeithQ Member Posts: 25
    Add a second condition to each actor . Such as when touch is released and actor_name is self.name. Then Play sound for one actor and change menu for the other actor. The issue is that the game does not distinguish between the releases. Adding the second condition should fix your issue.
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Add a second condition to each actor . Such as when touch is released and actor_name is self.name. Then Play sound for one actor and change menu for the other actor. The issue is that the game does not distinguish between the releases. Adding the second condition should fix your issue.
    Hey @KeithQ,
    Thank you for your response. It is a tad bit confusing how you worded your response. Would you mind taking my attached file and doing that small tweak in it and leave a note in it so I can visually see what you are referring to.

    Thank you in advance!!!
  • KeithQKeithQ Member Posts: 25
    edited November 2013
    Here is the link to the file. The issue was not what I had thought. The problem was that you had two actions that you wanted to trigger independently of each other, but they were being triggered by the same conditions. You needed a third condition to prevent the playsound actor from being triggered when the menu button was pressed. I gave you a switch. I placed notes on the Play Sound actor

    https://www.dropbox.com/s/z1nllmtradodhou/drop_down_test-fix.gameproj.zip
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Why do you feel the need to use touch is released? Just use touch is pressed and an integer to control when the menu drops down.

    Touch is pressed

    Change attribute Game.menu to (game.menu+1)%2

    In menu

    When game.menu = 1

    Drop down

    When game.menu = 0

    Go up

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Why do you feel the need to use touch is released? Just use touch is pressed and an integer to control when the menu drops down.

    Touch is pressed

    Change attribute Game.menu to (game.menu+1)%2

    In menu

    When game.menu = 1

    Drop down

    When game.menu = 0

    Go up

    Hey @FryingBaconStudios,
    Thanks for the comment! I'm not actually wanting touch released in the actor that drops the menu down. The touch released is in the Play Sound button because I want it to where if the "Player" decided that after pressing the button, they didn't want the sound to play, they could drag off the Play sound button and it wont play the sound.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited November 2013
    Okay so just make the sound in a touch is released rule then not the menu on off.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited November 2013
    Make a boolean attribute called: self.ready?

    in the Play Sound prototype:

    Display Text: Press Me

    Rule When Touch is pressed
    -- Change Attribute: self.ready? To: true
    otherwise
    -- Change Attribute: self.ready? To: false

    Rule When Touch is released
    and Game.DropDown is false
    and self.ready? is true
    -- Play Sound: ActionEfforts2
  • allc1865allc1865 Member, PRO Posts: 777
    @KillerPenguinStudios, do you want the sound to play when they touch the "Press me" button? Because right now you have it so when touch is released play sound, and the pop up menu shows up, then if you press the "Press me" button the you originally pressed to open the menu again, it'll still play the sound. Is that it?
  • allc1865allc1865 Member, PRO Posts: 777
    ooooh....Do you want the sound to play and then the menu to show up? @KillerPenguinStudios
Sign In or Register to comment.