Error with Dialogue System and Equipped Items

nitrox32

Member
I'm working on integrating UCC with DS. When my player starts a conversation and I have a weapon equipped I'm getting this error. I'm getting it when "Allow Equipped Item Slot 0 and Slot 1" are unticked in the Converse ability. I posted this on Dialogue System discord and Tony seems to think this might be a UCC issue.

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1,T2] (System.Object obj, System.String eventName, T1 arg1, T2 arg2) (at <27da9e1afec54f2fb2a11d46a234f9df>:0)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.TryStopAbility (Opsive.UltimateCharacterController.Character.Abilities.Ability ability, System.Boolean force) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1459)
Opsive.UltimateCharacterController.Character.Abilities.Ability.StopAbility (System.Boolean force, System.Boolean fromController) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:695)
Opsive.UltimateCharacterController.Character.Abilities.Ability.StopAbility () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:672)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.TryStopEquipUnequipAbility () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:1154)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.ItemEquipComplete (System.Int32 slotID, System.Boolean canUpdate) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:1137)
Opsive.Shared.Game.SchedulerBase.AddEventInternal[T,U] (System.Single delay, Opsive.Shared.Game.ScheduledEventBase+InvokeLocation invokeLocation, System.Action`2[T1,T2] action, T value1, U value2) (at <6b6b48297d4f49e9ba244a49e70e6e92>:0)
Opsive.Shared.Game.SchedulerBase.ScheduleFixed[T,U] (System.Single delay, System.Action`2[T1,T2] action, T value1, U value2) (at <6b6b48297d4f49e9ba244a49e70e6e92>:0)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.ItemEquip (System.Int32 slotID, System.Boolean canUpdate) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:1063)
Opsive.Shared.Game.SchedulerBase.AddEventInternal[T,U] (System.Single delay, Opsive.Shared.Game.ScheduledEventBase+InvokeLocation invokeLocation, System.Action`2[T1,T2] action, T value1, U value2) (at <6b6b48297d4f49e9ba244a49e70e6e92>:0)
Opsive.Shared.Game.SchedulerBase.ScheduleFixed[T,U] (System.Single delay, System.Action`2[T1,T2] action, T value1, U value2) (at <6b6b48297d4f49e9ba244a49e70e6e92>:0)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.ItemUnequipComplete (System.Int32 slotID, System.Boolean canUpdate) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:942)
Opsive.Shared.Game.SchedulerBase.AddEventInternal[T,U] (System.Single delay, Opsive.Shared.Game.ScheduledEventBase+InvokeLocation invokeLocation, System.Action`2[T1,T2] action, T value1, U value2) (at <6b6b48297d4f49e9ba244a49e70e6e92>:0)
Opsive.Shared.Game.SchedulerBase.ScheduleFixed[T,U] (System.Single delay, System.Action`2[T1,T2] action, T value1, U value2) (at <6b6b48297d4f49e9ba244a49e70e6e92>:0)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.ItemUnequip (System.Int32 slotID, System.Boolean canUpdate) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:850)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:675)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:809)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:740)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.Move (System.Single horizontalMovement, System.Single forwardMovement, System.Single deltaYawRotation) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:487)
Opsive.UltimateCharacterController.Game.KinematicObjectManager+KinematicCharacter.Move (System.Boolean manualMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:237)
Opsive.UltimateCharacterController.Game.KinematicObjectManager.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:880)
 

Justin

Administrator
Staff member
Thanks, I was able to reproduce it. To fix it:

- Ensure you are running version 2.4.5 which was just released.
- Download the shared source from the character controller download page.
- Remove the shared folder from your project
- Import the shared source
- Change line 420 of EventHandler.cs from:
Code:
                for (int i = actions.Count - 1; i >= 0; --i) {
to:
Code:
                for (int i = 0; i < actions.Count; ++i) {
This will also be in the next update but it'll be awhile before that is released.
 
Top