Newbie help request: interpolation timers and "waiting"
Hi all-
See attached file from my Dropbox - I'm using a simple quiz (from this YouTube tutorial) to teach myself GameSalad. I'm trying to use a simple interpolation timer to count down after an answer has been selected - and highlight the answer for 5 seconds as either green (correct) or red (incorrect) before moving on to next question.
For purposes of this test, only 1 response has been enabled (usually it would be pick from three or four possible answers). The timer attribute is a game-wide attribute called "Game timer" which is initially set at 1. When the answer is selected it counts down from 1 to 0 correctly, and the section of code where the timer is reset to 1 appears to run as a debug statement I have in there is generated, but the "Game timer" attribute stays at 0.
I'm sure this is a simple question and I'm doing something very obviously wrong, but I can't figure it out. Any help appreciated.
Comments
Is the game timer attribute an integer attribute ?
"Game timer" attribute set to real - although I have tried setting to integer, and interestingly interpolate still seems to treat it as a real number (as shown in a display text field displaying the attribute).
I'm not really sure why that's happening but I was able to get it to reset properly by adding a timer to the bottom of the rule in the Question 1 actor:
Just a suggestion for making your project file easier to edit: set all actors' self.Color.Alpha (Opacity) to 1 (100%). Then, for any actors you want to hide, add a behavior outside of any rules at the top of the actors' rule list that does Change Attribute self.Color.Alpha to 0.
That way, you can see all actors on the scene when editing.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hi @tatiang - thanks for the input - definitely points me in the right direction. Still doesn't solve the whole problem though - as what happens now is the game skips ahead a question during the "Game timer" reset timer. Even when I put all the remaining actions for moving to next question inside the timer. Watch and you will see the image switch briefly, and the "Question number" skips from 0 to 2. Do you get same behaviour?
Thanks for the editing tip as well - saves a lot of clicking around trying to figure out where my actors are!
Yeah, I saw that problem but I didn't address it because frankly, I don't understand the purpose of that Interpolation. Can you explain that a bit more?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for further reply! End goal is to simply have the correct answer highlight red or green for some period of time (currently 5 seconds), before moving on to the next question. I was doing as an Interpolation as a) I read that they were preferred to Timer behaviors, and b) I couldn't get it to work by wrapping the whole thing in a timer anyway!
It's very likely my whole approach is wrong - if you can think of a better and easier way to do this I would really appreciate the input.