Access additional STATE's within AttributeMonitor for scene save

clintond

New member
Hi Justin

My coding partner and I are stumped at this one.

I have some STATE's as shown in the attached image. They exist always. The active state is toggled during gameplay. During game-save, some are active, some not.

No matter what I try, I cannot access these STATE's through code. The attempt to do so has grown monolithic and still doesn't work.

For clarity, accessing regular 'top level' STATE's, like 'MoveTowards' works with little effort. It's this nested form of STATE that I cannot gain access to.

I should add. The DEFAULT STATE is returned, even for these nested STATE's, yet never the non-default STATE(s).

In case it's helpful, I've attached the behemoth of code that is trying to make this work.

Appreciate the guidance, clinton.
 

Attachments

  • StateSaver.cs
    StateSaver.cs
    16.7 KB · Views: 1
  • states.JPG
    states.JPG
    169.6 KB · Views: 3
Both the AttributeManager and the UltimateCharacterLocomotion component inherit the StateBehavior class which has a States property you can access. There's no need to use reflection.
 
Hi Justin. I've previously tried without reflection and was unable to access the components mentioned - only the DEFAULT STATE on those Attributes.

I'll step right back to the beginning and try again if it should be possible.

Thanks.
 
For anyone trying to do this in the future.

It involved iterating over objects of type AttributeManager, looking for their respective Attributes type and the subsequent States property(s).

The attached shows an example.
 

Attachments

Back
Top