Issue with CharacterItem UseEvent ending, and the Slot0ItemSubStateIndex transitioning.

FuzzySmurf

New member
So I might have a unique issue, and I want to see your recommendations for potentially getting around this.

I realized after posting this, you dont need to see the whole video. maybe seconds 13-20 and thats it.


In the video, (after the first ability cast), you can see the NPC starts moving. and the Ability hasn't disappeared yet. However, his Movement Animation hasn't triggered yet.
This is because the Slot0ItemSubStateIndex is still 3, not 0.
I believe the Slot0ItemSubStateIndex changes when the UseEventComplete is invoked.
unfortunately, this will also end the SpawnedObject early, when I need the SpawnedObject to finish its animation. (it has its own ending animation too.)

Do you have any suggestions to switch the Slot0ItemSubStateIndex back to 0, before the UseCompleteEvent is finished?
 
I believe the Slot0ItemSubStateIndex changes when the UseEventComplete is invoked.
unfortunately, this will also end the SpawnedObject early, when I need the SpawnedObject to finish its animation. (it has its own ending animation too.)
That is correct with your understanding. What do you mean that it will end the SpawnedObject early? SpawnedObject is an instant operation and doesn't change the character animation parameters. Or are you referring to the spreading out animation on the object itself?
 
I just realized the video has twitch playing in the background LOL.

So on the CharacterItem, I am using a MagicAction. The goal is to Spawn this VFX that does this crystal ground effect.
The problem is that the crystal ground effect needs about 3 seconds to play the full start and end effect. (it will appear. then disappear.)
However, the Slot0ItemSubStateIndex wont change until the UseCompleteEvent is finished.

The problem is, I dont want the golem to wait the full 3 seconds before they can move again. I want them to cast, and start moving after they finish there 'ground smash' animation. (separate from the VFX particle effect)
  1. NOTE: you can see this around 20-25 seconds in the video. where The VFX is spawned, but immediately disappears before the animation finishes playing. I believe this is due to the UseCompleteEvent being set to 2 seconds instead to try and change the Slot0ItemSubStateIndex earlier.

If I change the UseCompleteEvent from 2.0 to 3.5, it plays the full animation, but now the NPC will start to move before its Slot0ItemSubStateIndex is ready. so he's in this weird transitional phase where its moving, but the NPC animation is Not playing.

I hope that makes a bit more sense?
I'm hoping to get any suggestions on how to separate the two.
 
I'm assuming that you are spawning the effects within the Cast Effects Module Group? The SpawnObject module removes the effect when StopCast is called which will be when the UseComplete event is triggered. I could add option to have it not destroy it here and you can instead attach the ParticlePooler component to the particle which will then remove it when the effect is over. Would that work?
 
I spent most of the day adjusting the animation to instead "Hold it" for the duration of the VFX. it looks fine. I think I'm going to go with this instead.
I just increased his 'hold' on the ground from 1 frame to 2 seconds. so now it looks a lot more fluent.
Thank you for clarifying my suspicions. I may try to mod it and separate it, how you suggested above, in a later version depending how necessary it becomes.
 
It should actually be an easy separation. Within SpawnObject add the following:

Code:
[Tooltip("Should the object be destroyed when the module is stopped?")]
[SerializeField] protected bool m_DestroyOnStop = true;

Then within StopCast change:
Code:
            if (m_SpawnedObject != null) {
                ObjectPoolBase.Destroy(m_SpawnedObject);
                m_SpawnedObject = null;
            }
to:
Code:
            if (m_SpawnedObject != null && m_DestroyOnStop) {
                ObjectPoolBase.Destroy(m_SpawnedObject);
            }
            m_SpawnedObject = null;

Now you'll need to destroy the object in some other way such as the ParticlePooler. I'll include this in the next update as well. I can see other people using it.
 
Back
Top