What is b64ScarecrowDesign ?Solved

Fist off, really great mod & code quality.

I'm relatively new to umod and im wondering what the use of b64ScarecrowDesign is.
from what i can tell this is a an object that contains some config:

{"shouldPool": true}

ProtoBuff.AIDesign:

public bool ShouldPool = true;

Im a bit confused on you have a base64 string for "ShouldPool" since the default is true. I haven't found a scenario where it would be false.
-availableStates
-stateContainers
-defailtStateContainer
-description
-scope
-initialViewStateID
are all handled by the deserializer.

The under the hood deserializer itself doesn't actually even handle shouldPool.

Sorry i was parsing the string incorrectly. 

Hi, thank you.

This string is the binary protobuf of the scarecrow's AIDesign.

I've built it with another private plugin of mine, that can show and edit in game AIDesigns (default ones as well as custom ones).

Here is the actual transcription in a more human readable format (of mine too):

AIDesign Better scarecrow: default = 0, initial = 0
stateContainer [0]: state = 1(Idle), inputMemorySlot = 0
  -> event : id=0, type=PlayerDetected(1), triggerstatecontainerid=1, outmemslo=0, inmemslo=0, inverted=False
    -> event data : range = 10
  -> event : id=1, type=Attacked(3), triggerstatecontainerid=1, outmemslo=0, inmemslo=4, inverted=False
  -> event : id=2, type=Timer(0), triggerstatecontainerid=3, outmemslo=0, inmemslo=0, inverted=False
    -> event data : duration = 3, durationMax = 5
stateContainer [1]: state = 3(Chase), inputMemorySlot = 0
  -> event : id=0, type=InAttackRange(5), triggerstatecontainerid=2, outmemslo=0, inmemslo=0, inverted=False
  -> event : id=1, type=TargetLost(20), triggerstatecontainerid=0, outmemslo=0, inmemslo=0, inverted=False
stateContainer [2]: state = 15(Attack), inputMemorySlot = 0
  -> event : id=0, type=TargetLost(20), triggerstatecontainerid=0, outmemslo=0, inmemslo=0, inverted=False
  -> event : id=1, type=InAttackRange(5), triggerstatecontainerid=1, outmemslo=0, inmemslo=0, inverted=True
  -> event : id=2, type=Timer(0), triggerstatecontainerid=-1, outmemslo=0, inmemslo=0, inverted=False
    -> event data : duration = 8, durationMax = 16
  -> event : id=3, type=And(18), triggerstatecontainerid=-1, outmemslo=0, inmemslo=0, inverted=False
  -> event : id=4, type=Chance(19), triggerstatecontainerid=4, outmemslo=0, inmemslo=0, inverted=False
    -> event data : value = 0.1
stateContainer [3]: state = 26(RoamState), inputMemorySlot = 0
  -> event : id=1, type=StateError(2), triggerstatecontainerid=0, outmemslo=0, inmemslo=0, inverted=False
  -> event : id=2, type=StateFinished(4), triggerstatecontainerid=0, outmemslo=0, inmemslo=0, inverted=False
  -> event : id=3, type=PlayerDetected(1), triggerstatecontainerid=1, outmemslo=0, inmemslo=0, inverted=False
    -> event data : range = 10
  -> event : id=4, type=Attacked(3), triggerstatecontainerid=1, outmemslo=0, inmemslo=4, inverted=False
stateContainer [4]: state = 27(ThrowGrenade), inputMemorySlot = 0
  -> event : id=1, type=StateError(2), triggerstatecontainerid=0, outmemslo=0, inmemslo=0, inverted=False
  -> event : id=2, type=StateFinished(4), triggerstatecontainerid=0, outmemslo=0, inmemslo=0, inverted=False

Thank you so much! I feel like i am making some progress. What i ended up with matches with what you gave so thank you for that re-assurance.

default StateContainer = 0

StateContainer 0 (AIState.Idle 1)
	AIEventType.PlayerDetected (1)
		trigger AIState.Chase (3)
	AIEventType.Attacked (3)
		trigger AICustomState.FleeInhuman
	AIEventType.Timer (0)
		trigger AIState.Mounted (6)

StateContainer 1 (AIState.chase 3)
	AIEventType.InAttackRange 5
        trigger AIState.Attack
	AIEventType.TargetLost 20
		trigger AIState.Idle (1)
	AIEventType.Attacked (3)
		trigger AICustomState.FleeInhuman


StateContainer 2 (AIState.Attack 15)
    AIEventType.TargetLost 20
        trigger AIState.Idle
    AIEventType.InAttackRange 5
        trigger AIState.Chase (3)
    AIEventType.Chance 19
        trigger AICustomState.ThrowGrenadeState

StateContainer 3 (AICustomState.RoamState 26)
    AIEventType.StateError 2
        trigger AIState.Idle (1)
    AIEventType.StateFinished 4
        trigger AIState.Idle (1)
    AIEventType.PlayerDetected (1)
        trigger AIState.Chase (3)
    AIEventType.Attacked (3)
        trigger AICustomState.FleeInHuman
    

StateContainer 4 (AICustomState.ThrowGrenadeState 27)
    AIEventType.StateError 2
        trigger AIState.Idle (1)
    AIEventType.StateFinished (4)
        trigger AIState.Chase (3)

StateContainer 5 (AICustomState.FleeInhuman 28)
	AIEventType.StateError (2)
		trigger AIState.Chase (3)
	AIEventType.StateFinished (4)
		trigger AIState.Idle (1)

StateContainer 6 (AICustomState.FleeInhuman 29)
	AIEventType.StateError (2)
		trigger AIState.Idle 1
	AIEventType.StateFinished (4)
		trigger AICustomState.RoamState (26)


Some entertainment for the vets..
I jumped into this with ZERO knowledge of umod plugins / functionality behind AIDesign / ProtoBuff. I ended up going down the rabit hole of manually deserializing b64ScarecrowDesign which is just a ProtoBuf.AIDesign.

ProtoBuff.AIDesign.Deserialize SEPERATORS
(int32)-1 = EOF
(int32)8  - 0x08 - List<AIState> availableStates = 1,3,15,26,27,28,29
(int32)18 - 0x12 - List<AIStateContainer> stateContainers
(int32)24 - 0x24 - int32 defaultStateContainer (index) = 0
(int32)34 - 0x22 - string description = "Better Scarecrow"
(int32)40 - 0x28 - AIDesignScope scope = 1
(int32)48 - 0x30 - int32 initialViewStateID (value should be StateContainerID) = 0


Locked automatically