Hi. I have a level setup that spawns items like keys and coins, but for some reason it doesn't always spawn the coins when the action (or function) is called. Custom actions work for spawning the keys everytime but not the coins... is it because there are too many of them (450+) so it fails to execute?
When I spawn the coins using "on start of layout" they spawn every time without fail, but I would like to have confidence that I can rely on actions and functions to work correctly so I want to know if I'm doing something wrong. Thanks.
* scene_controller action 'Spawn Score'
----+ System: Pick all Score_Spawner
-----> Score_Spawner: Spawn obj_coin on layer "a_objects" (image point 0, create hierarchy: False)
Edit: It seems to happen because I start the 'Spawn Score' action at the end of another action (in a chain of actions). Calling the custom action from 'on start of layout' seems to work fine too.
Here's the full group for reference -
[Item Spawning]
----* scene_controller action 'Spawn Gold Key'
--------+ System: Pick a random Object_Spawner instance
--------+ Object_Spawner: [X] Is Key_Spawned
---------> Object_Spawner: Spawn Key_Gold on layer "a_objects" (image point 0, create hierarchy: False)
---------> Object_Spawner: Set Key_Spawned to True
---------> System: Wait for previous actions to complete
---------> scene_controller: Spawn Silver Key
----* scene_controller action 'Spawn Silver Key'
--------+ System: Pick a random Object_Spawner instance
--------+ Object_Spawner: [X] Is Key_Spawned
---------> Object_Spawner: Spawn Key_Silver on layer "a_objects" (image point 0, create hierarchy: False)
---------> Object_Spawner: Set Key_Spawned to True
---------> System: Wait for previous actions to complete
---------> scene_controller: Spawn Bronze Key
----* scene_controller action 'Spawn Bronze Key'
--------+ System: Pick a random Object_Spawner instance
--------+ Object_Spawner: [X] Is Key_Spawned
---------> Object_Spawner: Spawn Key_Bronze on layer "a_objects" (image point 0, create hierarchy: False)
---------> Object_Spawner: Set Key_Spawned to True
---------> System: Wait for previous actions to complete
---------> scene_controller: Spawn Coins
----* scene_controller action 'Spawn Coins'
--------+ System: Pick all Object_Spawner
--------+ Object_Spawner: [X] Is Key_Spawned
---------> Object_Spawner: Spawn obj_coin on layer "a_objects" (image point 0, create hierarchy: False)
---------> System: Wait for previous actions to complete
---------> scene_controller: Spawn Score
----* scene_controller action 'Spawn Score'
--------+ System: Pick all Score_Spawner
---------> Score_Spawner: Spawn obj_coin on layer "a_objects" (image point 0, create hierarchy: False)