Cheo
Active member
Alright, this one is going to sound very weird, but please bear with me ! So I was trying to replicate MGS's crawl by having the crouch ability started with a simple press of the Crouch button, and the crawl ability started by a long press. But when starting the crawl ability with my own character holding a weapon, I got an error from Item Equip Verifier - Editor Console Pro's dev finally sent me a fixed dll which allows for pasting the stack and source without color tags, so here it is :
Btw what's null is activeAbility.
Here's where it gets weird : I didn't get this error when experimenting with the character from the Agility demo scene and giving him the same ability start types, but there was one tiny difference : the Agility Atlas' Height Change ability had Allow Speed Change set to false while mine had it set to true, and when I set it to false the error no longer appeared ! But that's not all, it turns out my character also had another Speed Change ability that was disabled by default and enabled when the Crouch or Crawl states were active, and it seems that it is the activation by the Crouch state that was at the root of the issue.
Here's how you can recreate the error, it'll be clearer :
-Make a duplicate of the Agility Demo scene.
-Take the Atlas character, set its Crawl ability's Start Type to Long Press, Input Name to Crouch and its Max Trigger Count to 0. With that it should be able to start with a long press normally.
-Add a new Speed Change ability underneath the existing one. Set Enabled to false, set its Start Type to Automatic and Stop Type to Manual, create a preset setting Enabled to true, and make it activated by the Crouch state.
-Select the Height Change ability and set Allow Speed Change to true.
-Then just press play and try a long press to start the Crawl ability, and you should get the error if you followed each of these steps.
Thanks for following through all that ! You should understand that despite all of the necessary steps this is no niche case as it prevents combining an automatic speed change with the Crawl ability. I don't really understand the error at the moment but I hope this was already helpful and can be fixed. Thanks in advance.
Code:
[Exception] NullReferenceException: Object reference not set to an instance of an object
ItemEquipVerifier.ShouldStopActiveAbility() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/ItemEquipVerifier.cs:266
264: }
--> 266: return m_StartingAbility.ShouldStopActiveAbility(activeAbility) || m_StartingAbility.Index < activeAbility.Index;
267: }
UltimateCharacterLocomotion.TryStartAbility() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:877
875: // The ability can start. Stop any currently active abilities that should not be started because the current ability has started.
876: for (int i = m_ActiveAbilityCount - 1; i >= 0; --i) {
--> 877: if (ability.ShouldStopActiveAbility(m_ActiveAbilities[i])) {
878: TryStopAbility(m_ActiveAbilities[i], true);
879: }
Ability.StartAbility() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:458
456: public bool StartAbility()
457: {
--> 458: return m_CharacterLocomotion.TryStartAbility(this);
459: }
ItemEquipVerifier.TryToggleItem() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/ItemEquipVerifier.cs:193
191: StartEquipUnequip(false);
192: } else {
--> 193: StartAbility();
194: }
195: } else if (startPossible && activate && IsActive && m_StartingAbility != null && m_StartingAbility != ability) {
UltimateCharacterLocomotion.TryStartAbility() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:907
905: // If TryToggleItem returns true then the ItemEquipVerifier ability has started and it will start the original ability after
906: // the character has finished unequipping the equipped items.
--> 907: if (m_ItemEquipVerifierAbility.TryToggleItem(ability, true) && !ability.ImmediateStartItemVerifier) {
908: moveEquipStarted = true;
909: }
UltimateCharacterLocomotionHandler.TryStartAbility() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:226
224: protected virtual bool TryStartAbility(Ability ability)
225: {
--> 226: return m_CharacterLocomotion.TryStartAbility(ability);
227: }
UltimateCharacterLocomotionHandler.UpdateAbilityInput() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:133
131: // they are still running (such as toggling an equipped item while waiting for the animation to do the equip).
132: if (abilities[i].CanInputStartAbility(m_PlayerInput)) {
--> 133: TryStartAbility(abilities[i]);
134: }
135: }
UltimateCharacterLocomotionHandler.UpdateAbilityInput() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:100
99: // Update the input for both the regular abilities and item abilities.
--> 100: UpdateAbilityInput(m_CharacterLocomotion.Abilities);
101: UpdateAbilityInput(m_CharacterLocomotion.ItemAbilities);
102: }
UltimateCharacterLocomotionHandler.Update() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:75
73: private void Update()
74: {
--> 75: UpdateAbilityInput();
76: }
Btw what's null is activeAbility.
Here's where it gets weird : I didn't get this error when experimenting with the character from the Agility demo scene and giving him the same ability start types, but there was one tiny difference : the Agility Atlas' Height Change ability had Allow Speed Change set to false while mine had it set to true, and when I set it to false the error no longer appeared ! But that's not all, it turns out my character also had another Speed Change ability that was disabled by default and enabled when the Crouch or Crawl states were active, and it seems that it is the activation by the Crouch state that was at the root of the issue.
Here's how you can recreate the error, it'll be clearer :
-Make a duplicate of the Agility Demo scene.
-Take the Atlas character, set its Crawl ability's Start Type to Long Press, Input Name to Crouch and its Max Trigger Count to 0. With that it should be able to start with a long press normally.
-Add a new Speed Change ability underneath the existing one. Set Enabled to false, set its Start Type to Automatic and Stop Type to Manual, create a preset setting Enabled to true, and make it activated by the Crouch state.
-Select the Height Change ability and set Allow Speed Change to true.
-Then just press play and try a long press to start the Crawl ability, and you should get the error if you followed each of these steps.
Thanks for following through all that ! You should understand that despite all of the necessary steps this is no niche case as it prevents combining an automatic speed change with the Crawl ability. I don't really understand the error at the moment but I hope this was already helpful and can be fixed. Thanks in advance.