Any tricks to de-activate actor instead of destroying? For custom reset scene.

kapserkapser Member Posts: 458
edited November -1 in Working with GS (Mac)
Hey, I'm trying to make a custom scene reset because I'm scared of loading times and I don't want my music to reset.

I think I should be able to handle the actor rotations and starting coordinates, and hopefully all this won't drain too much juice on the memory. But when it comes to objects that gets destroyed, it sound pretty hard to save theyr coordinates on a controller object, and then check if they're destroyed and if so create a new one, etc.

So I was wondering do you guys know any tricks of de-activating object? Maybe de-activating collision and making them invisible or something? Have you guys experienced this problem?

In my game there is a LOT of scene reset and I'm scared that the loadings will be a problem.

Comments

  • RedlerTechRedlerTech Member Posts: 1,583
    Ya, create a boolean attribute called "ActorName Alive" Make it true.

    Put in all your rules for the actor when ActorName Alive is true do your rules.

    When its false, it wont do any of those things.

    Then when ActorName Alive is false, change opacity to 0 (self.color.alpha)

    Enjoy :D
    Matt
  • kapserkapser Member Posts: 458
    Sounds good, thanks. :)

    Only problem might be the other objects colliding with this one, but I guess I'll figure out a way.
  • olster1olster1 Member Posts: 396
    You could have an overall boolean attribute called reset. Then in every single one of rules that could potentially mess up the rest process add when reset = false. So when you want to rest change rest to true, nothing will go wrong and then once you want to start again change reset to false.

    I may have not understood you correctly though.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    kapser said:
    Sounds good, thanks. :)

    Only problem might be the other objects colliding with this one, but I guess I'll figure out a way.

    You put your collide behaviors in the boolean rule too. Then it will not collide with anything when it is deactivated.
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    When the actor is "destroyed", instead of actually destroying it, move it off-screen (where it can't interact or collide with anything on-screen) by changing its self.Position.X and self.Position.Y. Then, when you want to reset the scene, reverse the process and "spawn" them back into place by restoring the starting X/Y values to self.Position.X and self.Position.Y.

    If the rules in the actor can affect other actors on-screen then you should follow what NextGenEntertainment/olster1 said and put those rules within another rule that's toggled on/off depending on if the actor is "spawned" or "destroyed".

    - Jeff
Sign In or Register to comment.