0
Not a Bug

2.0.0a8 InvalidOperationException: The value of 'output' cannot be fetched dynamically, it must be assigned.

Ex-Crow 8 months ago updated 7 months ago 3

Graph: https://imgur.com/mbC5j2Y

InvalidOperationException: The value of 'output' cannot be fetched dynamically, it must be assigned.
Ludiq.Bolt.Flow.GetSourceValueAndType (Ludiq.Bolt.ValueOutput output, System.Object& sourceValue, Ludiq.Bolt.HybridType& sourceType) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:621)
Ludiq.Bolt.Flow.GetSourceValueAndType (Ludiq.Bolt.ValueInput input, System.Object& sourceValue, Ludiq.Bolt.HybridType& sourceType) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:587)
Ludiq.Bolt.Flow.GetValue (Ludiq.Bolt.ValueInput input, Ludiq.Bolt.HybridType type) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:651)
Ludiq.Bolt.Flow.GetValue (Ludiq.Bolt.ValueInput input) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:663)
Ludiq.Bolt.UnitValuePortProxy.Result (Ludiq.Bolt.Flow flow) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Proxies/UnitValuePortProxy.cs:37)
Ludiq.Bolt.UnitDefinitionUtility+<>c__DisplayClass15_0`1[T].b__0 (Ludiq.Bolt.Flow recursion) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/UnitDefinitionUtility.cs:127)
Ludiq.Bolt.Flow.GetValueDelegate (Ludiq.Bolt.ValueOutput output) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:725)
Rethrow as GraphPingException:
Ludiq.Bolt.Flow.InvokeDelegate (Ludiq.Bolt.ControlInput input) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:517)
Ludiq.Bolt.Flow.Invoke (Ludiq.Bolt.ControlOutput output) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:408)
Ludiq.Bolt.Flow.Invoke (Ludiq.Bolt.ControlOutput output) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:412)
Ludiq.Bolt.EventHandlerUnit`1[TArgs].Invoke (Ludiq.Bolt.GraphReference reference, TArgs args) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Events/EventHandlerUnit.cs:114)
Ludiq.Bolt.EventHandlerUnit`1+<>c__DisplayClass17_0[TArgs].b__0 (TArgs args) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Events/EventHandlerUnit.cs:73)
Ludiq.Bolt.EventBus.Invoke[TArgs] (Ludiq.Bolt.EventHook hook, TArgs args) (at Assets/Ludiq/Bolt.Core/Runtime/Events/EventBus.cs:153)
UnityEngine.Debug:LogException(Exception, Object)
Ludiq.Bolt.EventBus:Invoke(EventHook, EmptyEventArgs) (at Assets/Ludiq/Bolt.Core/Runtime/Events/EventBus.cs:157)
Ludiq.Bolt.ClassHost:InvokeEvent(EventHookID) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassHost.cs:823)
Ludiq.Bolt.UnityClassHost:Start() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/UnityClassHost.cs:29)
Ludiq.Bolt.ClassComponent:Start() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassComponent.cs:85)

KeyNotFoundException: Could not find a local mapped to 'ValueOutput#output'.
Ludiq.Bolt.AliasedHandlePool`2[TAlias,THandle].Get (TAlias alias) (at Assets/Ludiq/Bolt.Core/Editor/Generation/AliasedHandlePool.cs:71)
Ludiq.Bolt.AliasedHandlePool`2[TAlias,THandle].get_Item (TAlias alias) (at Assets/Ludiq/Bolt.Core/Editor/Generation/AliasedHandlePool.cs:74)
Ludiq.Bolt.MethodBaseGeneration`1[TMethod].Local (System.Object alias) (at Assets/Ludiq/Bolt.Core/Editor/Generation/Generations/MethodBaseGeneration.cs:113)
Ludiq.Bolt.SetClassVariableGenerator.GenerateOutputExpression (Ludiq.Bolt.MethodGeneration method) (at Assets/Ludiq/Bolt.Flow/Editor/Units/Architecture/SetClassVariableGenerator.cs:47)
Ludiq.Bolt.UnitGenerator`1[TUnit].GenerateValueOutputExpression (Ludiq.Bolt.MethodGeneration method, Ludiq.Bolt.ValueOutput valueOutput) (at Assets/Ludiq/Bolt.Flow/Editor/Units/UnitGenerator.cs:160)
Rethrow as CodeGenerationException: Failed to generate value output expression.
Rethrow as GraphPingException:
UnityEngine.Debug:LogException(Exception)
Ludiq.Bolt.CodeGenerationConsole:PingAndLogException(CodeGenerationException) (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodeGenerationConsole.cs:176)
Ludiq.Bolt.CodeGenerationConsole:DrawEntry(Entry, Boolean) (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodeGenerationConsole.cs:116)
Ludiq.Bolt.CodeGenerationConsole:OnGUI() (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodeGenerationConsole.cs:30)
Ludiq.Bolt.CodePreviewWindow:_OnGUI() (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodePreviewWindow.cs:294)
Ludiq.LudiqEditorWindow:OnGUI() (at Assets/Ludiq/Ludiq.Core/Editor/Windows/LudiqEditorWindow.cs:136)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

After trying to assign the value the graph looks like this: https://imgur.com/41OcmJh

InvalidOperationException: The local 'PreviousItem' has not been assigned.
Ludiq.Bolt.Flow.GetLocal (System.Object identifier) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:292)
Ludiq.Bolt.Assign.Fetch (Ludiq.Bolt.Flow flow) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Flow/Assign.cs:102)
Ludiq.Bolt.Flow.GetValueDelegate (Ludiq.Bolt.ValueOutput output) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:725)
Rethrow as GraphPingException:
Ludiq.Bolt.Flow.InvokeDelegate (Ludiq.Bolt.ControlInput input) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:517)
Ludiq.Bolt.Flow.Invoke (Ludiq.Bolt.ControlOutput output) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:408)
Ludiq.Bolt.Flow.Invoke (Ludiq.Bolt.ControlOutput output) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:412)
Ludiq.Bolt.EventHandlerUnit`1[TArgs].Invoke (Ludiq.Bolt.GraphReference reference, TArgs args) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Events/EventHandlerUnit.cs:114)
Ludiq.Bolt.EventHandlerUnit`1+<>c__DisplayClass17_0[TArgs].b__0 (TArgs args) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Events/EventHandlerUnit.cs:73)
Ludiq.Bolt.EventBus.Invoke[TArgs] (Ludiq.Bolt.EventHook hook, TArgs args) (at Assets/Ludiq/Bolt.Core/Runtime/Events/EventBus.cs:153)
UnityEngine.Debug:LogException(Exception, Object)
Ludiq.Bolt.EventBus:Invoke(EventHook, EmptyEventArgs) (at Assets/Ludiq/Bolt.Core/Runtime/Events/EventBus.cs:157)
Ludiq.Bolt.ClassHost:InvokeEvent(EventHookID) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassHost.cs:823)
Ludiq.Bolt.UnityClassHost:Start() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/UnityClassHost.cs:29)
Ludiq.Bolt.ClassComponent:Start() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassComponent.cs:85)


KeyNotFoundException: Could not find a local mapped to 'PreviousItem'.
Ludiq.Bolt.AliasedHandlePool`2[TAlias,THandle].Get (TAlias alias) (at Assets/Ludiq/Bolt.Core/Editor/Generation/AliasedHandlePool.cs:71)
Ludiq.Bolt.AliasedHandlePool`2[TAlias,THandle].get_Item (TAlias alias) (at Assets/Ludiq/Bolt.Core/Editor/Generation/AliasedHandlePool.cs:74)
Ludiq.Bolt.MethodBaseGeneration`1[TMethod].Local (System.Object alias) (at Assets/Ludiq/Bolt.Core/Editor/Generation/Generations/MethodBaseGeneration.cs:113)
Ludiq.Bolt.AssignGenerator.GenerateOutputExpression (Ludiq.Bolt.MethodGeneration method) (at Assets/Ludiq/Bolt.Flow/Editor/Units/Flow/AssignGenerator.cs:68)
Ludiq.Bolt.UnitGenerator`1[TUnit].GenerateValueOutputExpression (Ludiq.Bolt.MethodGeneration method, Ludiq.Bolt.ValueOutput valueOutput) (at Assets/Ludiq/Bolt.Flow/Editor/Units/UnitGenerator.cs:160)
Rethrow as CodeGenerationException: Failed to generate value output expression.
Rethrow as GraphPingException:
UnityEngine.Debug:LogException(Exception)
Ludiq.Bolt.CodeGenerationConsole:PingAndLogException(CodeGenerationException) (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodeGenerationConsole.cs:176)
Ludiq.Bolt.CodeGenerationConsole:DrawEntry(Entry, Boolean) (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodeGenerationConsole.cs:116)
Ludiq.Bolt.CodeGenerationConsole:OnGUI() (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodeGenerationConsole.cs:30)
Ludiq.Bolt.CodePreviewWindow:_OnGUI() (at Assets/Ludiq/Bolt.Core/Editor/Generation/CodePreviewWindow.cs:294)
Ludiq.LudiqEditorWindow:OnGUI() (at Assets/Ludiq/Ludiq.Core/Editor/Windows/LudiqEditorWindow.cs:136)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
Bolt Version:
2.0.0a8
Unity Version:
2019.2.19
Platform(s):
PC
Scripting Backend:
Mono
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2

Ended up using the Get Previous Item unit instead of wiring directly and it got rid of the errors.

Not a Bug

Thanks for the report, but yes that is by design. Using the Get is the proper fix.

If your graph took the False branch, then Set Previous Item is never called, and therefore its return value is not available in the current flow as a local.

Ah, makes sense. Gotta be careful with that in the future.