reset scene not working
Dooki
Member Posts: 247
Hi all,
Been testing my game on my iphone4.
Need HELP!?!?!
- Main actor must collect all the items in a scene before time runs out. Once collected he must dump them in a barrel. This triggers the change scene.
- If time runs out a "try again" button is spawned and it resets the scene.
-
- The problem I am having is that everything works like a champ with GS. However, when I test it on my iphone it doesn't. When you tap "try again" and the scene restarts, the change scene trigger doesn't work. I have to quit the game, double tap my home button (to show the GS is still running), hold down on GS to get the "-" sign and then REALLY close the GS viewer. Once done and restarted I can play through, unless of course I run out of time again.
Can anyone shed some light on this? Much thanks!
Been testing my game on my iphone4.
Need HELP!?!?!
- Main actor must collect all the items in a scene before time runs out. Once collected he must dump them in a barrel. This triggers the change scene.
- If time runs out a "try again" button is spawned and it resets the scene.
-
- The problem I am having is that everything works like a champ with GS. However, when I test it on my iphone it doesn't. When you tap "try again" and the scene restarts, the change scene trigger doesn't work. I have to quit the game, double tap my home button (to show the GS is still running), hold down on GS to get the "-" sign and then REALLY close the GS viewer. Once done and restarted I can play through, unless of course I run out of time again.
Can anyone shed some light on this? Much thanks!
Comments
Again, when the scene restarts it somehow nullifies my change scene trigger. I'm sure I'm missing something that your gurus can help me with. ;-)
-Dooki
'Reset' behaviours do not reset any variables you've put in yourself.
I imagine that you have a variable used to count the amount of items you've collected.
Let's say you have to collect 10 items before taking them to the bucket.
If you don't reset the 'number of items collected' variable, and collect 8 items before the time runs out, you will *still* have eight items when you start.
Now let' say you manage to get all 10 on your second go. You will now have 18 items. When you go to the bucket, the change scene will not work because it's expecting just 10 items.
Essentially, when you 'reset' the scene, put in a 'change attribute' behaviour that changes 'number of items collected' to 0.
I think that'll help.
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Side question for you, do unused created game attributes and size/weight to the game size? I'm still learning GS and so I have several of these.
Thanks again!
They take up RAM - FMG and others have been very vocal in ways to keep RAM from increasing as you play - I think most of it centers on the *amount* of actors you use.
So yeah, get rid of images/actors that aren't being used.
Glad I could help!
QS
P.S. - some good practice advice, in lieu of debug tools, is to make an actor that displays an attribute's status.
Just put it in the corner of the screen where you can see it, but it won't get in the way of your game!
In your case above, such an actor would have shown you you had '18' items collected and helped you troubleshoot your issue easier!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
So you mean have a counting actor showing me the count status on the margins of the work doc but NOT in game display field. Got it!
Thanks again.
When it's working correctly, either delete the actor from the scene, or move it off-scene so you don't see it.
When the game's done, remove these actors from your project and submit to the app store. But keep a version of the release *with* the actors in it so that you can test on any updates to your game.
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io