|
Post by illustrator on Dec 1, 2019 14:41:23 GMT
I made a simple global wave with two levels and one wave for each level. I spawned few objects and after they were all destroyed (despawned) Level Settings shows Game Status: Game Over but Hookup: Win does not send event so I suppose I did not actually "Win" the game or is this a bug?
Levels & Waves has "Last level completed" option set to Win.
"Win: The default - fire the Win event (Game Over is set to true when you Win or Lose)."
How is the Lose condition determined?
|
|
|
Post by DarkTonic Dev on Dec 1, 2019 17:34:53 GMT
Lose happens when "Game Over" is triggered through a World Variable reaching its Game Over value, if any is set. Like lives = 0.
Otherwise you win if you run out of waves and have it set as you describe.
I would have you add a Debug.Log statement to the Win() method in LevelSettings.cs and see if it is reached or not. Code looks like when I first wrote it and should work.
|
|
|
Post by illustrator on Dec 1, 2019 17:54:31 GMT
Okay. I can add the statement if you give instructions. I don't know much about programming. I have Visual Studio installed and I found LevelSettings.cs in Assets\Plugins\DarkTonic\CoreGameKit\Scripts\Level folder. I suppose that is the correct file.
|
|
|
Post by DarkTonic Dev on Dec 1, 2019 18:07:26 GMT
Actually, just turn on "Log Messages" on the LevelWaveSettings game object in edit mode, because there's already a log statement there. Now in the Console window, if "win" is triggered, it will log "Player has WON!" to the Console window. See if that happens.
|
|
|
Post by illustrator on Dec 1, 2019 18:21:11 GMT
Yes, logging shows that win is triggered:
Player has WON! UnityEngine.Debug:Log(Object) DarkTonic.CoreGameKit.LevelSettings:Win() (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Level/LevelSettings.cs:1176) DarkTonic.CoreGameKit.<CoUpdate>d__116:MoveNext() (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Level/LevelSettings.cs:837) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
|
|
|
Post by illustrator on Dec 1, 2019 18:38:14 GMT
Must be something on the Playmaker FSM then. I'll do some testing.
|
|
|
Post by DarkTonic Dev on Dec 2, 2019 0:20:58 GMT
I've added some missing events on the Playmaker listener but it's not released yet. Win wasn't missing but you may as well use the newest just in case. Here it is. Playmaker_CustomActions.unitypackage (18.46 KB)
|
|
|
Post by illustrator on Dec 2, 2019 15:09:51 GMT
Nice, thanks!
|
|
|
Post by DarkTonic Dev on Dec 2, 2019 16:37:52 GMT
Yep.
|
|
|
Post by gearedgeek on Oct 15, 2020 2:07:00 GMT
I'm having an issue where in the console it's saying the Player has WON! but with the FSM Hookup it's triggering the Lose instead of the Win. I have the the Last Level Completed setting is set to Win. I also have the Game Over Behavior set to Behave as Normal.
Any ideas?
|
|
|
Post by DarkTonic Dev on Oct 15, 2020 2:12:42 GMT
Which Playmaker Custom Action is that? I'll need to look at the code.
|
|
|
Post by gearedgeek on Oct 15, 2020 2:22:00 GMT
The Level Settings Playmaker Listener is the component I'm using. I have the Hookup: Win and Lose checked.
|
|
|
Post by gearedgeek on Oct 15, 2020 2:23:35 GMT
I'm using the latest version of Core GameKit and the include Playmaker integration. Unity 2019.3.9f1.
I have also tried using the World Variable: Score. I have a playmaker FSM set up to add 1 to the variable with the G.O. set to 10. It reaches 10 and Player Lost.
|
|
|
Post by DarkTonic Dev on Oct 15, 2020 20:34:04 GMT
Ok, so I need you to add a Debug line into each of these 3 methods in LevelSettingsPlaymakerListener.cs shown below, then tell me which of these gets logged when you win. I want to make sure you're not having something happen from GameOver and getting confused. Also, let's see a screen shot of your FSM and the action settings, plus the Inspector settings for the listener.
public override void Win() { Debug.Log("Win"); CGKPlaymakerUtility.SendEventIfValid(winEventSetting, EventsByFsmName); } public override void Lose() { Debug.Log("Lose"); CGKPlaymakerUtility.SendEventIfValid(loseEventSetting, EventsByFsmName); } public override void GameOver(bool hasWon) { Debug.Log("Game Over"); CGKPlaymakerUtility.SendEventIfValid(gameOverSetting, EventsByFsmName); }
|
|
|
Post by gearedgeek on Oct 17, 2020 6:28:55 GMT
I will do that a report back.
|
|