[Bug] MagicItem wont stop when using continous use type.

filod

Member
I'm trying to make beam/laser like weapon to my ai agent, but when use continuous use type, the magic item never stop use. (animator event setup correctly)

maybe a more appropriate question is, how to make a laser like weapon?
 
Last edited:
You are getting an error which will cause execution problems. The Particle Stream uses a continuous use type so you could base yours off of that item. Using the magic item for a laser makes sense.
 
You are getting an error which will cause execution problems. The Particle Stream uses a continuous use type so you could base yours off of that item. Using the magic item for a laser makes sense.
No, the error you see is another UCC bug that related to the editor (only happens when keeping MagicItem inspector to inspect prefab in project also in playmode.

Also i want to point out that in this post i posted, Bug 2 still exists, these may related.

these has nothing to do with MagicItem execution problem above, and i definitely use Particle Stream as my reference.
 
Okay, i may found where the issue is, i manage to 1. use AnimatorUseComplete event rather than UseComplete delay to control the timing, 2. because a continuous magicitem can not auto stop like a melee weapon does, i have to manualy stop use ability by ButtonUp StopType.

btw, i was trapped in Use too many times, and the code behind it is so complicated, an in depth document about design of Use/UsableItem may do the help.
 
Last edited:
Also i want to point out that in Behavior Designer integration's StartStopUse task, i change StartStopUse.cs:116 to
1649079495864.png
to actually stop magicitem (and also TryStopAbility would return false), don't know why, but this change works.
 
ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <7b935204f5ff4bcab44b3b0ebca330bf>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <7b935204f5ff4bcab44b3b0ebca330bf>:0)
Opsive.Shared.Game.GameObjectExtensions.GetCachedParentComponent[T] (UnityEngine.GameObject gameObject) (at <6b6b48297d4f49e9ba244a49e70e6e92>:0)
Opsive.Shared.StateSystem.StateManager.InitializeInternal (UnityEngine.GameObject stateGameObject, Opsive.Shared.StateSystem.IStateOwner owner, Opsive.Shared.StateSystem.State[] states) (at Assets/Opsive/Shared/StateSystem/StateManager.cs:89)
Opsive.Shared.StateSystem.StateManager.Initialize (UnityEngine.GameObject gameObject, Opsive.Shared.StateSystem.IStateOwner owner, Opsive.Shared.StateSystem.State[] states) (at Assets/Opsive/Shared/StateSystem/StateManager.cs:65)
Opsive.Shared.StateSystem.StateObject.Initialize (UnityEngine.GameObject gameObject) (at Assets/Opsive/Shared/StateSystem/StateObject.cs:29)
Opsive.UltimateCharacterController.Items.Actions.Magic.CastActions.CastAction.Initialize (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Items.Actions.MagicItem magicItem, System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/Magic/CastActions/CastAction.cs:40)
Opsive.UltimateCharacterController.Items.Actions.Magic.CastActions.SpawnParticle.Initialize (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Items.Actions.MagicItem magicItem, System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/Magic/CastActions/SpawnParticle.cs:107)
Opsive.UltimateCharacterController.Items.Actions.MagicItem.DeserializeCastActions (System.Boolean forceDeserialization) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/MagicItem.cs:329)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.MagicItemInspector.OnEnable () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Items/Actions/MagicItemInspector.cs:61)


hope it helps
 
Hmm, can you send me a repro scene with that error? I'm not sure how you are getting it in that state.
 
Hmm, can you send me a repro scene with that error? I'm not sure how you are getting it in that state.
that's very easy to repro, just drag your demo scene ParticleStream to a prefab, then hit play!(make sure you are inspecting the prefab)
 
Top