Touch is pressed not working?
SA_FNAFCoder
Member, PRO Posts: 47
in Tech Support
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
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
Here you go
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
I'll try that later today, kinda lazy right now
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?
Your update question was answered here: http://forums.gamesalad.com/discussion/comment/588756/#Comment_588756
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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
Use touch is released
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I had to click it two times, the changing attributes went through but Change Scene did not work.
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
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
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.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
That didn't work. I think this is a bug, I'll report it on the bugs site
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.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
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 ) 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
The save attributes are running perfectly, but the Change Scene itself is not firing.
I am talking about the "Finish button" actor
Sorry didn't provide these
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.
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.
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 ?
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!