Converse Ability Disable Input Not Working in Build

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Converse Ability Disable Input Not Working in Build

Post by pegassy »

Hello,

I have tried a build with my game, and noticed that even though the disable input feature of the converse ability is working in the editor, when I build the game, it does not work for the same conversations. Do you have any idea where I may look to try to fix this?
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Converse Ability Disable Input Not Working in Build

Post by Tony Li »

Hi,

Low-hanging fruit first: Are you building the correct scene? I've accidentally had old scenes in projects' build settings before and wondered why it seemed like my newer changes were missing.

If you make a build of the Dialogue System's Opsive UCC Dialogue Example scene, does it play correctly?

If so, check these in your scene:
  • The player's Ultimate Character Locomotion > Converse ability is high enough in the list that another ability above it won't automatically take precedence.
  • If you're using the Unity Input component, the Conversing state is in the States list. Try putting it at the top of the list.
  • If you're using Rewired Input, use the corresponding Conversing state for Rewired instead. If it's missing, you can create it yourself. Just add a "Disable Cursor" property and untick the checkbox. That's all the Conversing state does.
  • Compare the Dialogue Manager's Input Device Manager settings with the example scene. It's okay for some settings to be different, but be aware of what the differences might result in.
Try setting the Dialogue Manager's Debug Level to Info. This will log a lot to your build's output_log.txt file. If you don't mind sifting through it, check for any warnings.

If none of that fixes the issue, please feel free to send reproduction steps or a reproduction project to tony (at) pixelcrushers.com.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Converse Ability Disable Input Not Working in Build

Post by pegassy »

Thank you for all the suggestions. I will check them in that order and see what I come up with. Very helpful ideas.

I did make sure that I do not have any other scene in my build. I did that mistake so many times, I learned to pay attention to that dearly :)
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Converse Ability Disable Input Not Working in Build

Post by pegassy »

I did a development build and below is the error during that frame which stops unity input in editor play but not in the build:

IndexOutOfRangeException: Index was outside the bounds of the array.
at Opsive.UltimateCharacterController.Game.KinematicObjectManager.SetCharacterMovementInputInternal (System.Int32 characterIndex, System.Single horizontalMovement, System.Single forwardMovement) [0x00001] in C:\SOA_Development\Assets\Opsive\UltimateCharacterController\Scripts\Game\KinematicObjectManager.cs:521
at Opsive.UltimateCharacterController.Game.KinematicObjectManager.SetCharacterMovementInput (System.Int32 characterIndex, System.Single horizontalMovement, System.Single forwardMovement) [0x00001] in C:\SOA_Development\Assets\Opsive\UltimateCharacterController\Scripts\Game\KinematicObjectManager.cs:510
at Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.Update () [0x0002f] in C:\SOA_Development\Assets\Opsive\UltimateCharacterController\Scripts\Character\UltimateCharacterLocomotionHandler.cs:71

(Filename: C:/SOA_Development/Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs Line: 521)

It seems to be giving an error on a UCC script, and not DSU.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Converse Ability Disable Input Not Working in Build

Post by Tony Li »

That error means the character has been unregistered from UCC's KinematicObjectManager.

The KinematicObjectManager is a component on the UCC "Game" GameObject. Make sure this component doesn't get removed somehow in a build.

The character's UltimateCharacterLocomotion component OnEnable method registers the character with the KinematicObjectManager. The OnDisable method unregisters the character. Are you perhaps disabling the UltimateCharacterLocomotion component during conversations? If so, don't do that. Instead, allow the Converse ability to set it in a conversing state. This doesn't explain the difference between editor playmode and builds, though.

Have you set the character to persist across scene changes? (i.e., Don't Destroy On Load) It's better if you don't do this. Let each scene be independent, with its own "Game" GameObject and its own instance of the character. Otherwise the KinematicObjectManager will get out of sync with the character.

If you're testing individual scenes in editor playmode, the KinematicObjectManager will be in sync. But if, in a build, you're keeping the same character across scenes, this would explain the error since the KinematicObjectManager would no longer have a reference to the character.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Converse Ability Disable Input Not Working in Build

Post by pegassy »

Thank you for the awesome explanations Tony, even though the issue seems to take place more on the UCC side. This will take some further investigation on my side, but you have given me some really good leads. I was looking at the Ultimate Character Locomotion script, but I missed that kinematic object manager script on the game object.

I had tried to do the dontdestroyonload() with the player, but I already had removed that script, since UCC does not allow that anyways. Currently I have a player character on each scene, and they are all connected to the same prefab. I also did prefab my Game object (from UCC), Event System, and Main Camera for certain convenience factors. However, the issue had occured long before I had done that.

The issue does not seem to appear with the first dialogue in my scene, which starts with a trigger enter as soon as the scene begins, but that does not use the Dialogue System Trigger Interactable, but its original version. The next interactable target does cause the issue. However, the converse ability is not supposed to care how I started the dialogue, is that right? Does it simply check if a dialogue has been started, or does it matter which component starts it?
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Converse Ability Disable Input Not Working in Build

Post by Tony Li »

pegassy wrote: Thu Jun 27, 2019 4:40 pmHowever, the converse ability is not supposed to care how I started the dialogue, is that right? Does it simply check if a dialogue has been started, or does it matter which component starts it?
That's correct. It just responds to OnConversationStart and OnConversationEnd messages, regardless of how they're sent.
Post Reply