|
Post by hairgrow on Jan 8, 2021 5:33:25 GMT
So I'm using PlayMaker with a Listener subclass of the Level Settings. The subclass is a buffer that allows PlayMaker to listen to the Level Settings events. So far I have WaveStarted, WaveEnded, and LevelEnded working. But I'm noticing 2 timing issues for when these events are called. - When the last wave of the level is reached, WaveStarted is called, but then immediately afterwards, Level Ended is called.
- With the last wave of the level set to Pause Global Waves, when this wave is completed, LevelEnded is called, but then WaveStarted is immediately called when Global Waves have paused.
I'm using PlayMaker to create an animated sequence for each wave based on the when the Wave/Level has started and ended. But now that I have it working, I can see that WaveStarted and LevelEnded are being called out of place in 2 areas. I would assume WaveStarted would only get called when the wave has actually started. Not right before it has been paused. Or LevelEnded should only be called once, at the very end of the last Wave. Not immediately when the last Wave has started. Or am I doing something wrong?
|
|
|
Post by DarkTonic Dev on Jan 8, 2021 6:07:20 GMT
I believe #1 is the "dummy last wave" which isn't a real one but needed for internal code to work. If so, would you like to make it so that one doesn't notify the Listener? Not sure I understand #2, but you are saying LevelEnded, and then WaveStarted both get called when the wave is paused?
|
|
|
Post by hairgrow on Jan 8, 2021 7:16:25 GMT
I think I'm good now. the dummy last wave makes sense now. It's weird, but I was getting an error with the spawner not being able to spawn, so I fixed that by increasing the spawn amount in Pool Boss and checking Recycle Oldest. Once I did that, it appears to have fixed my timing issues. So now when I check the debug log, I can see the unnamed wave, right before Level Ended is called. Which is fine, I can check for unnamed when WaveStarted is called. Thanks for sheding some light on the dummy last wave.
|
|
|
Post by DarkTonic Dev on Jan 8, 2021 9:25:58 GMT
Ok cool.
|
|
|
Post by hairgrow on Jan 8, 2021 17:43:35 GMT
I do have another question though which maybe related to the dummy last wave. But let's say I have 1 Level with 3 waves. When using the LevelWaveSettings Listener and checking the Debug console, if the 1st Wave is set to Pause Global Waves, when the 1st Wave is completed, I can see WaveStarted is being called on Wave 2, before the pause actually happens. Is this intentional?
WaveStarted shouldn't be called on the next wave, if the previous wave is set to Pause Global Waves. This is what I was referring to on line item #2 in the original post. If Wave 1 is set to Pause, WaveStarted shouldn't be called on Wave 2, until the actual Wave has started.
|
|
|
Post by DarkTonic Dev on Jan 8, 2021 18:44:30 GMT
Yes, that is how the code works. It can't delay the switch to the new wave, but it can immediately pause when it starts.
|
|
|
Post by hairgrow on Jan 8, 2021 18:58:12 GMT
Gotcha. Thanks for clarifying. I'm really enjoying CGK, so I'm asking a lot newbie questions I'm sure.
|
|
|
Post by DarkTonic Dev on Jan 8, 2021 21:18:13 GMT
It's pretty complex, so that's not out of the ordinary.
|
|