Touch is pressed not working?

SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

So what happened is I had an actor have a behavior where when touch is pressed it would take me to another scene and change some attributes. But today I have just finished coding everything and tested it, and it did nothing, stayed on the same scene, didn't save the attributes, did nothing, anyone have a solution?
I have already looked back at my code and the layering, everything seemed to be OK. So how can I fix this?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @SA_FNAFCoder said:
    I have already looked back at my code and the layering, everything seemed to be OK. So how can I fix this?

    You made a mistake somewhere. But I have no idea where because you haven't provided any details. Show your rules and we can get this fixed.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

    @tatiang said:

    @SA_FNAFCoder said:
    I have already looked back at my code and the layering, everything seemed to be OK. So how can I fix this?

    You made a mistake somewhere. But I have no idea where because you haven't provided any details. Show your rules and we can get this fixed.

    Here you go

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    edited October 2016

    I'd suggest making the "touch is pressed" trigger an attribute that then triggers a rule to do all the saves and change scene. Because as soon as touch is released your rule becomes invalid.

    Also, anything after a change scene in the rule is not likely to trigger. Probably best to put a timer with run to completion on those behaviours intended to trigger after and then move them above the change scene.

    Follow us: Twitter - Website

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

    @AlchimiaStudios said:
    I'd suggest making the "touch is pressed" trigger an attribute that then triggers a rule to do all the saves and change scene. Because as soon as touch is released your rule becomes invalid.

    Also, anything after a change scene in the rule is not likely to trigger. Probably best to put a timer with run to completion on those behaviours intended to trigger after and then move them above the change scene.

    I'll try that later today, kinda lazy right now

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

    @AlchimiaStudios said:
    I'd suggest making the "touch is pressed" trigger an attribute that then triggers a rule to do all the saves and change scene. Because as soon as touch is released your rule becomes invalid.

    Also, anything after a change scene in the rule is not likely to trigger. Probably best to put a timer with run to completion on those behaviours intended to trigger after and then move them above the change scene.

    Nope didn't work man.
    Does have to do with updating because I'm not updated to the latest GameSalad.
    And whenever I try to update it just says update failed so do you know if that is why? And how I could get it to update maybe?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    If the Change Scene isn't working, use Log Debugging Statements within that rule to see if the rule is firing.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

    @tatiang said:
    If the Change Scene isn't working, use Log Debugging Statements within that rule to see if the rule is firing.

    I had to click it two times, the changing attributes went through but Change Scene did not work.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Hmm, I'm not sure. You might consider posting your project file after removing anything you don't want to share.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47
    edited October 2016

    Go to this link.
    The file is too big to go on GameSalad.
    Just download and go inside the zip folder, the game folder, and open the gsproj

    http://goo.gl/zB2Qa3

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited October 2016

    As has been said a touch is pressed is a limited event. You can use them to for this application. But in gamesalad things are linear. Behaviors fire in the order you place them. If you walk through the logic you posted the change scene will fire before the last two change attributes get to fire. To execute this properly use a timer sequence.

    Rule when touch is pressed

    Timer (run to completion checked)

    For .03

    The two change attributes go here.

    Timer (run to completion checked)

    For .06

    The save behaviors go here.

    Timer (run to completion checked)

    After 1

    Change scene

    I would recommend going to my youtube site and watching my gslogic series.

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

    @The_Gamesalad_Guru said:
    As has been said a touch is pressed is a limited event. You can use them to for this application. But in gamesalad things are linear. Behaviors fire in the order you place them. If you walk through the logic you posted the change scene will fire before the last two change attributes get to fire. To execute this properly use a timer sequence.

    Rule when touch is pressed

    Timer (run to completion checked)

    For .03

    The two change attributes go here.

    Timer (run to completion checked)

    For .06

    The save behaviors go here.

    Timer (run to completion checked)

    After 1

    Change scene

    I would recommend going to my youtube site and watching my gslogic series.

    That didn't work. I think this is a bug, I'll report it on the bugs site

  • ArmellineArmelline Member, PRO Posts: 5,331

    To be clear - you are wanting the logic in your "Finish button" actor to change the scene after running the various change attributes? And that finish button is on the "Enable Achievements" scene?

    If so, the reason this isn't working is your finish button actor on the scene is unlocked. None of the logic you've been adding to the prototype or posting in the screen shots is being run.

    If that's not the problem, then we'll need you to explain exactly which actor on which scene you're talking about, and how to reach it in the game.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2016

    @Armelline said:
    If that's not the problem, then we'll need you to explain exactly which actor on which scene you're talking about, and how to reach it in the game.

    I downloaded the project too, sifted through loads of scenes randomly clicking on actors looking for one that does nothing when pressed (of course you'll never know if you've found the right actor as it doesn't do anything when pressed :D ) and then just gave up after a few minutes . . .

    I bet the OP knows the name of the actor, where it is, what it looks like, and in which scene it is, why wouldn't someone think to share that kind of basic info !? This reminds me of when people say "I want it to look like the reloading effect in this game" and then they link to a 40 minute Youtube clip, leaving it up to you to search through in the hope of finding the part they mean :p

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47
    edited October 2016

    @Armelline said:
    To be clear - you are wanting the logic in your "Finish button" actor to change the scene after running the various change attributes? And that finish button is on the "Enable Achievements" scene?

    If so, the reason this isn't working is your finish button actor on the scene is unlocked. None of the logic you've been adding to the prototype or posting in the screen shots is being run.

    If that's not the problem, then we'll need you to explain exactly which actor on which scene you're talking about, and how to reach it in the game.

    The save attributes are running perfectly, but the Change Scene itself is not firing.
    I am talking about the "Finish button" actor

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

    Sorry didn't provide these

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2016

    @SA_FNAFCoder said:
    I am talking about the "Finish button" actor

    Ah ! Found the actor in question, there is no change scene behaviour in that actor, like @Armelline mentioned the actor is unlocked.

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47
    edited October 2016

    @Socks said:

    @SA_FNAFCoder said:
    I am talking about the "Finish button" actor

    Ah ! Found the actor in question, there is no change scene behaviour in that actor, like @Armelline mentioned the actor is unlocked.

    I put a Change Scene block there, nothing changed.
    Also, all the code is in the "windowapi" actor, go to the top I put a screenshot of it.
    So in the Finish button actor, when you press it, it should change an attribute to activate the "windowapi" actor.

  • SocksSocks London, UK.Member Posts: 12,822

    @SA_FNAFCoder said:
    Also, all the code is in the "windowapi" actor, go to the top I put a screenshot of it.

    In the 'Enter Name' actor you have a behaviour that changes the scene to 'Max Accounts' (in a group called '3 accounts'), this is triggered as soon as you enter the scene, switch it off and the finish button works fine.

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47

    @Socks said:

    @SA_FNAFCoder said:
    Also, all the code is in the "windowapi" actor, go to the top I put a screenshot of it.

    In the 'Enter Name' actor you have a behaviour that changes the scene to 'Max Accounts' (in a group called '3 accounts'), this is triggered as soon as you enter the scene, switch it off and the finish button works fine.

    This didn't do anything.
    That is for when the user has 3 accounts, 3 accounts is the max.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2016

    @SA_FNAFCoder said:
    This didn't do anything.

    Worked fine for me ? Are you editing the actor in the scene or the actor in Actors panel ?

    Do you agree that there is a change scene behaviour that is triggered - regardless of any other factor - on entering the scene ?

    @SA_FNAFCoder said:
    That is for when the user has 3 accounts, 3 accounts is the max.

    That's not what the rules say, this behaviour has no conditions (it's not wrapped in a rule), it triggers automatically regardless of how many accounts the user has, the way it is set up it is not checking whether there are 3 accounts (in fact it's not checking anything, it simply triggers as soon as the scene is loaded).

  • SA_FNAFCoderSA_FNAFCoder Member, PRO Posts: 47
    edited October 2016

    @Socks said:

    @SA_FNAFCoder said:
    This didn't do anything.

    Worked fine for me ? Are you editing the actor in the scene or the actor in Actors panel ?

    Do you agree that there is a change scene behaviour that is triggered - regardless of any other factor - on entering the scene ?

    @SA_FNAFCoder said:
    That is for when the user has 3 accounts, 3 accounts is the max.

    That's not what the rules say, this behaviour has no conditions (it's not wrapped in a rule), it triggers automatically regardless of how many accounts the user has, the way it is set up it is not checking whether there are 3 accounts (in fact it's not checking anything, it simply triggers as soon as the scene is loaded).

    Found it! Fixed! Thanks guys!

Sign In or Register to comment.