Omnipresent actor?
kkoenig
Member Posts: 10
Is there a way to always have an actor instantiated, instead of having to drag it in for each scene?
Thanks!
Comments
Yes, you can Spawn Actors (but you need at least one other Actor to do the Spawning).
You do this by using the Spawn Actor Behavior.
Although, before the Rule activates, the Actor-to-be-spawned is technically still non-existent. So I don't think it's correct to call it omnipresent.
edit: It seems to me like you're creating a game with multiple Scenes having similar layouts/gameplay? Like one Scene per level? If so, then you can check out this video tutorial:
You can copy scenes. Set up a scene the way you want it with one or more actors and then duplicate it (option+drag on a Mac so I would guess alt+drag on a PC).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
thanks to you both!
I have a good method for this now. Working on my third game and finally getting a structure together that allows for expandability. I am planning on putting together a boilerplate with a tutorial in the next month or so.
The basic gist is that you have a game controller for global game management. Things like running game over sequences, resets etc... But the issue with GS is that you can only spawn an actor on the SAME layer as the spawning actor. Thus you need a spawner for any layer that will received spawned actors.
Then depending on your game you have a spawner for each major "Layer" in your scenes. So an example in my current game which has around 80 levels I have (in order from top to bottom):
HUD Layer
Level Layer
Background Layer
Control Layer
With this structure I just have to drop all the actors into their respective layers in each scene. Then if I need more logic across all scenes, I just edit one of the 4 actors. its possible to do it with less or more depending on the complexity of your game but the general idea is to have an actor prototype that exists in all scenes. Then if you have specific layer spawning requirements, create additional controllers for each layer.
My Latest GS Game - Tiny Spirit
My First GS Game - Dashing Ralph
I think this is exactly what I needed, thank you!
would you by any chance have a sample I could look at?