GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

reset scene not working

DookiDooki Posts: 247Member
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!

Comments

  • DookiDooki Posts: 247Member
    OK, I just tested this on safari. Same problem.

    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
  • victorkin11victorkin11 Posts: 251Member
    search the forums
  • quantumsheepquantumsheep Posts: 8,188Member
    It's probably that you're using 'reset scene' as a behaviour.

    '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 :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • DookiDooki Posts: 247Member
    WOW! Thank you thank you thank you! You were spot on with your assumption and solution. Works like a champ.

    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!
  • quantumsheepquantumsheep Posts: 8,188Member
    If they're unused, get rid of them ;)

    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 :D

    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 :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • DookiDooki Posts: 247Member
    Oooo, good tip. Thanks.

    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.
  • quantumsheepquantumsheep Posts: 8,188Member
    You can put it in the game so you can see it when testing.

    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 :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

This discussion has been closed.