I have a fragment playing. I want to apply a new Tag to the fragment (action) running. I don't know how I'm supposed to pass a modified TagState into SetFragment.
I assume that global tags are updated on the fragment when the `AUTO_REINSTALL_BEST_MATCH` (via Auto-Update in the editor) is set on the fragment, in addition to on creation (I see a union with globalTags).
I think that global tags can be edited by accessing the AnimationContext's CTagState and doing a Set() for the new tag.
How do I apply it to only a specific fragment? There is only a `pass in the fragment tags you want` statement in the documentation, and I can't find a sample that doesn't use TAG_STATE_EMPTY.
Since there is only (one?) instance of CTagState (in the animation context) and creating a TagState depends on the CTagDefinition (Since CTagState just passes it along) I have no idea what I should do.
Do something like this? (pseudo code-ish)
Code: Select all
CTagState cState(ctagDefinition) ;
cState.Set(TagID, true)
SetFragment (.... cState.GetMask() ... )
Plus, if I were to directly re-queue the fragment via the below, in order to (for example) clear the already-set tag or add another one:
Code: Select all
pAct->SetFragment(fragID, tagState.GetMask(), OPTION_IDX_RANDOM, 0, false);
I'm calling this outside of an Action so ti's independent of the Update() and Pre-Update(). What kind of checks do I need to make this work? (Or would this work just fine for action updates?)