Keeping Spawned actors

I have a game that when an actor is spawned, the user can move the spawned actor around. When the user goes to a different scene and comes back, the spawned actors are gone. I want the spawned actors to stay spawned.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    There are at least two ways to do this:

    1. Use a single scene and change the camera position to "go to other scenes." That way your spawned actors remain on the single scene.

    2. Create a complex system that stores each actor's position in a table and then loads that position when the scene starts. If you're new to GameSalad, this is a somewhat steep learning curve but you can start by learning about how tables work.

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

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    I have 4 scenes. I have an actor when touched in each scene goes to different scenes. I am not sure what you mean when you say change the camera position. all my scenes fit in the screen area of the iPad.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    It's fine to use multiple scenes. It just means you have to use the second option I mentioned above. I've attached a demo.

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

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    Do I still need a table with the demo you sent

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    Key: "Actor1X" and "Actor1Y" are they in table or have you typed them into this space.

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    Where are you storing your key name "Actor1X"

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    What if I have several actor of the same on the screen the user can move around. I want the user to be able to reload the scene with all the actors where he left them.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Right, so my demo is just a starting point. It's not a full solution. And no, it doesn't use tables. Tables would be required depending on the number of actors you have. Once you get past a few actors you won't want to deal with Save/Load Attribute behaviors. It's much more efficient to then use a table instead since table data is automatically loaded at run time and a single Save Table behavior will save all of the data at once.

    The keys, "Actor1X" and "Actor1Y" are just made up names. You could call them anything as long as you are consistent with the save and load attribute keys being exactly the same.

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

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    The user can spawn the actors that I want saved at the positions they put the spawned actors. It could be as much as ten for each actor that spawns. I set up the way you said and could not get to work even with only one spawned as to not confuse program with multiples.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    My advice would be to watch some YouTube tutorials such as @jamie_c's (http://forums.gamesalad.com/discussion/69271/tutorials-and-free-stuff-from-jamie-c) and @Braydon_SFX‌'s (http://forums.gamesalad.com/discussion/63093/community-tutorials-by-braydon-sfx/p1) to familiarize yourself with GameSalad a bit more. After you're more comfortable with the basics, you might take a look through the Spare Code thread (http://forums.gamesalad.com/discussion/52494/spare-code-dump-it-here/p1) for some more advanced demos. I'll be honest... I didn't understand how to do this sort of thing until I'd used GameSalad for about a year. I'm not saying it will take that long for you but it may require some additional knowledge that you're lacking.

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

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    I used your sticker book v2 template you made for someone. That works great. I was able to adjust your template so when I come back to the scene the player can move around the already spawned actors. All the spawned actors are the same. But now I have to be able to delete a spawned actor in the table when it collides with another actor. And also when the player moves them around it saves to a new location without deleting old location.

Sign In or Register to comment.