Reset Scene - Change Scene

Hi,

Looks like Reset Scene is not working properly, it's not reseting the whole scene, it reset's only few attributes, as I understood it doesn't reset global attributes (game.right, game.jump, game.mytimer, game.screenshake, etc...)

And I don't think that there is any alternative to fix this situation except duplicate the same scene Ex: (Level 1 and Level 1 Copy) then change the reset scene rule to be a change scene to Level 1 Copy to give same result as reset scene, but still when I change scene Level 1 to scene Level 1 Copy it still doesn't work, it starts where the previous scene ends.

And that looks like Change scene is not working properly as well...

Any ideas ???

Thanks

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Those behaviors work properly but you need to understand that game attributes do not get reset when you Reset Scene or Change Scene. You need to do that manually, for example:

    When [condition to reset or change scene]
         Change Attribute game.Score to 0
         Change Attribute game.Lives to 3
         Change Attribute game.LevelPassed to false
         Reset/Change Scene

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

  • BibyBiby Member Posts: 28
    I will try that, Thanks

    Also When I change any attribute in Scene 1, it changes same automatically in Scene 2.
    Any idea ?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    When I change any attribute in Scene 1, it changes same automatically in Scene 2.
    Any idea ?
    Can you give an example of this? For example, "When I edit the scene and change scene.Lives from 5 to 15 and then go to Scene 2 from the Scene menu and edit that scene, its scene.Lives attribute is also set to 15 even though it had been set to 0."

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

  • BibyBiby Member Posts: 28
    Yea same,
    When I change any value or add rule or change attribute in Scene 1, I go check Scene 2 I find same edits took place in Scene 2.


  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yea same,
    When I change any value or add rule or change attribute in Scene 1, I go check Scene 2 I find same edits took place in Scene 2.
    Are you talking about scene attributes, actor (self) attributes or game attributes?

    If you're making changes to rules and you're editing a prototype actor, that is the expected behavior. If you're changing rules in an unlocked instance of an actor, then that should not be happening.

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

  • BibyBiby Member Posts: 28
    Yes I'm editing game and actor (self) attributes.
    In level one motion linear velocity = 500, in level 2 (scene 2) motion linear velocity = 300.
    Game.Timers 20 secs. in scene 1 and 30 secs in scene 2 and etc...

    If that is the expected behavior so how i would work on 30 levels (scenes) with different attributes if what i'm changing in one scene is automatically changing in all the other scenes ?!!!
    Is that common or i'm doing something wrong ? and how would i fix it ?
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    One way to deal with it would be to put a 'game control' actor on each scene and change the scene specific attributes with it. The game control actor would be invisible and/or off screen so you don't see it. Put Change Attribute Behaviors in it to update your Velocity, Timers, etc...

    Another option would be to build a table with the Attributes that need to be loaded/adjusted for each scene and load/update them from there at the start of each scene.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    Yes I'm editing game and actor (self) attributes. Is that common or i'm doing something wrong ? and how would i fix it ?
    Actor (self) attribute reset from scene to scene. So if you have an actor moving at self.motion.linear velocity.X = 300 and you change or reset the scene, that same actor will have self.motion.linear velocity.X of 0 (the default value for that actor) when the scene starts.

    Game attributes do not reset from scene to scene. So if you have a custom timer and its value is 12 when the scene changes or resets, it will be 12 when the scene starts.

    @jamie_c's suggestion of a table is the way to go if you have many such attributes to manage. Table cell values do not reset on their own and can therefore be used from scene to scene or even after the app has been exited provided you use a Save Table behavior.

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

Sign In or Register to comment.