Set Value As Enum on AI Controller's blackboard crashes

Note:- I am no longer able to reproduce this crash in my project but I thought of posting the original repro steps here anyway in case someone it rings a bell for someone and also because the crash proved extremely time consuming and stalled my progress for several hours until I found a workaround (see below).

Potential Repro:-

  1. Create a blueprint Enum variable BP_Enum, add a few enumerations say “Text 1”, “Text 2”, “Text 3”
  2. Create a behavior tree and in its blackboard add a blackboard key of the new Enum type, say BB_BP_Enum.
  3. In your AI controller get the blackboard (using the ‘get blackboard’ node) and use the ‘Set Value As Enum’ node with key as “BB_BP_Enum” and value as “Text 3” (for example). For the value make sure you use a Literal node of type “Literal Enum BP_Enum” from the context menu as this is what seems to trigger the crash.
  4. Save your changes, close the editor and restart. The editor should now crash with an error about usage of an unknown literal value. (Unfortunately I don’t have the exact logs from when I was able to reproduce the crash)

Note that the crash only occurred for “Set Value As Enum” which is used in the AI Controller scope and not the other set node “Set Blackboard Value As Enum” (which is accessible only from a behavior tree service or task AFAIK).

Workaround: Don’t use literal enum type nodes but instead use number based indices, for eg: Enum Value: 2 to set a value of “Text 3” in this example. Obviously this sacrifices readability but it fixed the crash issue. I have since made many other changes to my project and am no longer able to reproduce this crash even with use of literal enum nodes.

Hi ,

Sorry for the delay in response, but I am glad to see that it is no longer occurring for you. While investigating the crash in 4.6.1 I got to the final step, but when I reopen the editor the Set Value As Enum node resets to 0 instead of crashing. If it does begin occurring for you again, please let us know so that we can gather more details, as this may not be entirely related to the blackboard by itself.

Cheers!