Splitscreen Issues
Posted: Mon Sep 18, 2023 9:58 pm
Hello there!
I have most things almost working and it's feeling great! I can have two independent conversations with different NPCs, and depending on who you are in the game you get a different conversation. I am getting hung up on one snag now. Which is that I can have two independent conversations, but when I try to have two conversations at the same time, the second conversation that is started really messes with the previous conversation that started.
I am using Rewired, and have custom input logic for the Continue and Response buttons so each player is handled independently. I am using Opsive for Inventory Management, and using some logic from them to handle two event systems with an event system manager.
I do have Allow Simultaneous Conversations enabled, and Custom Panels set for the subtitle and menu panels. I have tried hard to debug where things go wrong, and I added a debug statement to the UIPanel script that runs everytime the panel runs OnHidden. When the second conversation starts, everything loads up fine, but when you continue through to the next line of Dialogue this is where things break.
Here is a video of it in action: https://streamable.com/1s84s1
The second time I talk to the NPCs you can see that when P1 presses continue it starts trying to close panels and messes with P2.
So if P1 presses continue, then this statement prints for the P2 panel:
Is there any bools or something I might be overlooking that can prevent the 2nd player panel from getting that message. Or if the message comes in could I verify that it came from the correct sender before hiding the panel?
I think as a next step i might have to make my own classes that inherit and override the StandardUISubtitlePanel and the StandardUIMenu panel, so I can hook it up to to my event system manager correctly. And maybe in that custom script I can provide any additional logic that might keep these menus open. Sorry for the novel and I appreciate anything that might point me in the right direction!
I have most things almost working and it's feeling great! I can have two independent conversations with different NPCs, and depending on who you are in the game you get a different conversation. I am getting hung up on one snag now. Which is that I can have two independent conversations, but when I try to have two conversations at the same time, the second conversation that is started really messes with the previous conversation that started.
I am using Rewired, and have custom input logic for the Continue and Response buttons so each player is handled independently. I am using Opsive for Inventory Management, and using some logic from them to handle two event systems with an event system manager.
I do have Allow Simultaneous Conversations enabled, and Custom Panels set for the subtitle and menu panels. I have tried hard to debug where things go wrong, and I added a debug statement to the UIPanel script that runs everytime the panel runs OnHidden. When the second conversation starts, everything loads up fine, but when you continue through to the next line of Dialogue this is where things break.
Here is a video of it in action: https://streamable.com/1s84s1
The second time I talk to the NPCs you can see that when P1 presses continue it starts trying to close panels and messes with P2.
So if P1 presses continue, then this statement prints for the P2 panel:
Code: Select all
Hide requested!
UnityEngine.Debug:Log (object,UnityEngine.Object)
PixelCrushers.UIPanel:OnHidden () (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIPanel.cs:266)
PixelCrushers.UIAnimatorMonitor/<WaitForAnimation>d__13:MoveNext () (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIAnimatorMonitor.cs:105)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
I think as a next step i might have to make my own classes that inherit and override the StandardUISubtitlePanel and the StandardUIMenu panel, so I can hook it up to to my event system manager correctly. And maybe in that custom script I can provide any additional logic that might keep these menus open. Sorry for the novel and I appreciate anything that might point me in the right direction!