|
Post by khoa1994 on Aug 4, 2014 6:09:12 GMT
I want my spawner to start spawning when a global PlayMaker event happens. How could I do that? Right now, I'm using Syncro spawner. When the global PlayMaker event hasn't happen, the spawner is deactivated. When the global PlayMaker event happens, I activate the spawner. However, when I activate the spawner, nothing is spawned.
|
|
|
Post by DarkTonic Dev on Aug 4, 2014 6:26:14 GMT
Syncro spawners aren't able to respond to anything as they are controlled by Level Wave Settings only (based on time + elimination settings per wave).
You should use Triggered spawners, and set up and use the "Code Triggered Event 1" or 2, which can be started by Playmaker.
|
|
|
Post by khoa1994 on Aug 4, 2014 14:38:33 GMT
I created an empty object and attached the "Trigger Spawner" script to it. I selected "Code-Triggered 1". How can I hook up the global PlayMaker event so that when the event happens, the triggered spawner starts spawning?
I use "Repeat Wave" in "Code-Triggered 1". Using PlayMaker, how can I detect the event that each repeated wave ends and perform an action? I want to display an on-screen message after each repeated wave ends.
|
|
|
Post by DarkTonic Dev on Aug 4, 2014 16:14:12 GMT
Use the built in Playmaker method "call method" and call the method in TriggeredSpawner called ActivateCodeTriggeredEvent1. It doesn't need any parameters passed.
For wave repeat, use the TriggeredSpawnerListener and subclass it, then override the method WaveRepeat. Check the Event Type using the first parameter to make sure it's the code triggered event if you have more than one event.
|
|
|
Post by khoa1994 on Aug 4, 2014 16:46:06 GMT
" ![]() Use the built in Playmaker method "call method" and call the method in TriggeredSpawner called ActivateCodeTriggeredEvent1. It doesn't need any parameters passed." I did this and when I enter Play mode, nothing is spawned. Please look at this image: drive.google.com/file/d/0B88PdDsyVgCqcnNBTFVsaWZqLVk/edit?usp=sharing "For wave repeat, use the TriggeredSpawnerListener and subclass it, then override the method WaveRepeat. Check the Event Type using the first parameter to make sure it's the code triggered event if you have more than one event." What do you mean by "subclass it, then override the method WaveRepeat." I use PlayMaker to write my whole game and don't know how to code in Unity.
|
|
|
Post by DarkTonic Dev on Aug 4, 2014 22:28:13 GMT
You said when you enter Play mode nothing is spawned. Your image shows an FSM on the triggered spawner itself. And there is only one state in your FSM, so it would trigger the code-triggered event 1 instantly.
If you wanted to trigger it instantly on Scene start like that is set up to do, you wouldn't need an FSM to trigger it. You could just use the "Start" event of the Triggered Spawner. Go ahead and try that and make sure it works. Now if you want to trigger the code-triggered event 1 at a certain different time, you would have an FSM on a different game object probably, that after a certain event, triggers the code-triggered event.
If you don't write any code, use the provided Triggered Spawner Playmaker Listener instead of what I said about subclassing. That lets you select the FSM and event to run when the repeat wave happens.
|
|
|
Post by khoa1994 on Aug 5, 2014 3:21:20 GMT
I trigger the code-triggered event instantly to see whether triggered spawner works. Once my "Call Method" PlayMaker action works in this case, I'll put it in another FSM. I have tried putting the "Call Method" PlayMaker action in another FSM and call "Call Method" when a global event happens. Nothing is spawned in Play mode. I try the "Enabled Event" trigger in the following picture (https://drive.google.com/file/d/0B88PdDsyVgCqZGstclFmbzFxZGc/edit?usp=sharing). I leave the "TriggerSpawner" game object active when I enter Play mode. Nothing is spawned in Play mode.
I think triggered spawner doesn't work.
|
|
|
Post by DarkTonic Dev on Aug 5, 2014 4:38:30 GMT
A bunch of people have asked me this same question before and gotten it to work, with code-triggered event.
If you have now already tried without FSM to activate it, then your problem is nothing to do with your Playmaker setup and we'll need to look at other things.
We use Triggered Spawners all the time in our games, they definitely work.
If you would like to send me a stripped down project that reproduces the problem, I'll take a look. We've never heard of Triggered Spawner just plain not working.
Also, please check out example scene 2 which is nothing but Triggered Spawners and see if "enemy 2" shoots at you. It should.
|
|
|
Post by khoa1994 on Aug 5, 2014 17:50:35 GMT
I created a new scene and Triggered Spawner works on this new scene for both "Code-Triggered 1" and "OnEnabled". Thus, the problem is somewhere else, not Triggered Spawners.
|
|
|
Post by DarkTonic Dev on Aug 5, 2014 23:15:57 GMT
Ok, well if you figure out what the problem is, let me know and I'll be here to help.
|
|