I need help respawning actors after they are destroyed.

gama3gama3 Member Posts: 29

I have a game in which 7 white actors spawn randomly in the scene that has a timer of 30 seconds. In addition to the seven actors, there are 3 red actors that spawn. The objective is to destroy these 7 white actors without destroying the red ones.

My Goal is that after the 7 white actors are destroyed, the scene is cleared and all new actors are spawned without resetting the timer.

I have successfully been able to create a spawner that adds the actors to the scene, but I am unable to figure out a way to make them spawn again!

Can anyone offer some advice on the situation?

Comments

  • MendezMendez Member Posts: 21

    @gama3 you could create an integer attribute and set up a rule where whenever an actor is touched, change the attribute to +1. Then another rule where when attribute equals 7 respawn the actors. Please tell me if this worked or not.

  • gama3gama3 Member Posts: 29

    @Mendez said:
    gama3 you could create an integer attribute and set up a rule where whenever an actor is touched, change the attribute to +1. Then another rule where when attribute equals 7 respawn the actors. Please tell me if this worked or not.

    I'll give it a try now! Thanks!

  • gama3gama3 Member Posts: 29

    @Mendez It worked! You are a genius! My only problem now is that I am unsure of how to make the actors reappear :confused:

  • MendezMendez Member Posts: 21
    edited August 2014

    @gama3 you make the rule: when the attribute equals 7 then spawn actor (use the same spawn rule that you used to originally spawn the actor)

  • gama3gama3 Member Posts: 29
    edited August 2014

    That method isn't quite working out atm. One question I have though is that, if an actor is destroyed, does it automatically subtract 1 from the attribute counter, or do I need to prompt it to subtract 1 when it is destroyed? @Mendez

  • MendezMendez Member Posts: 21

    @gama3 what exalty isn't working? Is it just not respawning? Try: When attribute is > 6 then... Also you would have to create another rule to subtract 1 from the attribute counter. So like when attribute reaches 7 change attribute back to 0. Maybe

  • gama3gama3 Member Posts: 29

    @Mendez‌ I am able to make the remaining three actors be destroyed and have a clear scene, but then nothing respawns even after I set the actors to respawn when attribute Destroyed >= 7

  • MendezMendez Member Posts: 21

    ill upload a demo

  • gama3gama3 Member Posts: 29

    sounds good @Mendez‌

  • MendezMendez Member Posts: 21
    edited August 2014

    https://www.dropbox.com/s/b56q3l5lvgw0t4k/demo .zip

    Here it is let me know if this is what you needed or not

  • gama3gama3 Member Posts: 29

    @Mendez said:
    https://www.dropbox.com/s/b56q3l5lvgw0t4k/demo .zip

    Here it is let me know if this is what you needed or not

    Sorry If I'm being an amateur right now, but I've never shared a file before so I'm not sure how to open this in GS after I've downloaded it :neutral_face:

  • MendezMendez Member Posts: 21

    @gama3‌ just move the file from downloads to your documents. Then in Gamesalad click on "open" and then click on the file.

  • gama3gama3 Member Posts: 29

    @Mendez‌ Everything is saved as a JSON file though and it does not show up as a Gamesalad file.

  • allc1865allc1865 Member, PRO Posts: 777
    edited August 2014

    @gama3, are you on a PC or Mac?

  • MendezMendez Member Posts: 21
    edited August 2014

    It should work the only other export file I can do is Macintosh creator .zip but it doesn't work since I dont have a Mac

  • gama3gama3 Member Posts: 29

    @allc1865‌ I'm on PC. And I'll give this a try @Mendez‌

  • gama3gama3 Member Posts: 29

    @Mendez Now when I open the file in GS it just displays a white screen.

  • MendezMendez Member Posts: 21
    edited August 2014

    https://www.dropbox.com/s/dgoun1o3yp61sbo/demo.zip?dl=0
    This should work, make sure you drag the demo.gameproj that's inside the zip file to documents then open it in gamesalad @gama3

  • gama3gama3 Member Posts: 29

    maybe there is a problem with winrar or something, because everything is just a JSON file. Sorry for all the trouble @Mendez‌

  • MendezMendez Member Posts: 21
    edited August 2014

    @gama3 If you want I can tell you all that I did, Do you have an email or something so I can send it to you since it will be kind of long to explain?

  • gama3gama3 Member Posts: 29

    @Mendez Yeah, go ahead and send me your explanation to talbot.blake99@gmail.com

Sign In or Register to comment.