+1
Cannot Reproduce

Bolt 2 A10 Setting graph variable in function breaks C# generation

Reality.Stop() 1 month ago updated 6 days ago 8 1 duplicate

Create a Flow function and add a graph variable.

Set the graph variable.

Check C# generation.

Getting the variable works fine, and uses the variable value as normal:

Bolt Version:
Bolt 2a10
Unity Version:
2019.3.2f1
Platform(s):
Windows
Scripting Backend:
Mono
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2 GFI

Duplicates 1

Graph: https://imgur.com/ALTPOxT

Can confirm, also happens on my end:

The following errors occured while generating scripts:

UnityEngine.Debug:LogError(Object)
Ludiq.Bolt.<>c__DisplayClass2_0:b__1(Task) (at Assets/Ludiq/Bolt.Core/Editor/Generation/GenerationWorkflow.cs:90)
Ludiq.Task:Run() (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Task.cs:62)
Ludiq.WindowTaskRunner:RunSynchronous(Task) (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Runners/WindowTaskRunner.cs:62)
Ludiq.<>c__DisplayClass10_0:b__0() (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Runners/WindowTaskRunner.cs:34)
System.Threading.ThreadHelper:ThreadStart()

Ludiq.Bolt.CodeGenerationException: Failed to generate control input body. ---> System.Collections.Generic.KeyNotFoundException: Found no member aliased to 'Previous Item' on 'Ludiq.Bolt.ClassGeneration'.
Available aliases:
EquipmentPanel
Bind
ActivateImplementation
DeactivateImplementation
Get
Set
Invoke
IsActive
SetActive
NameEquipmentSlots
Name Equipment Slots#983711d1#-132823040
RemoveItem
Remove Item#ccb5e8d5#1205762048
AddItem
Add Item#0ee7aae0#624934912
startHook
[ BoltClass#-5118 > Setup#a4e54ba7#670653184 ].Start#67a44....hook
startHandler
[ BoltClass#-5118 > Setup#a4e54ba7#670653184 ].Start#67a44....handler
Start
[ BoltClass#-5118 > Setup#a4e54ba7#670653184 ].Start#67a44....invoke
equipmentSlotsParent
Equipment Slots Parent
equipmentSlots
Equipment Slots
at Ludiq.Bolt.CompositeGeneration`1[TDeclaration].Member (System.Object alias) [0x00017] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Core\Editor\Generation\Generations\CompositeGeneration.cs:119
at Ludiq.Bolt.CompositeGeneration`1[TDeclaration].Field (System.Object alias) [0x00001] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Core\Editor\Generation\Generations\CompositeGeneration.cs:127
at Ludiq.Bolt.SetFlowGraphVariableGenerator+d__2.MoveNext () [0x0003a] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Flow\Editor\Units\Architecture\SetFlowGraphVariableGenerator.cs:23
at System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) [0x0005e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) [0x00033] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at Ludiq.LinqUtility.ForceEvaluation[T] (System.Collections.Generic.IEnumerable`1[T] source) [0x00016] in C:\GameDev\Bolt2a10\Assets\Ludiq\Ludiq.Core\Runtime\Utilities\LinqUtility.cs:19
at Ludiq.Bolt.UnitGenerator`1[TUnit].GenerateControlInputBody (Ludiq.Bolt.MethodGeneration method, Ludiq.Bolt.ControlInput controlInput) [0x00033] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Flow\Editor\Units\UnitGenerator.cs:104
--- End of inner exception stack trace ---


UnityEngine.Debug:LogError(Object)
Ludiq.Bolt.<>c__DisplayClass2_0:b__1(Task) (at Assets/Ludiq/Bolt.Core/Editor/Generation/GenerationWorkflow.cs:94)
Ludiq.Task:Run() (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Task.cs:62)
Ludiq.WindowTaskRunner:RunSynchronous(Task) (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Runners/WindowTaskRunner.cs:62)
Ludiq.<>c__DisplayClass10_0:b__0() (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Runners/WindowTaskRunner.cs:34)
System.Threading.ThreadHelper:ThreadStart()

Ludiq.Bolt.CodeGenerationException: Failed to generate control input body. ---> System.Collections.Generic.KeyNotFoundException: Found no member aliased to 'Previous Item' on 'Ludiq.Bolt.ClassGeneration'.
Available aliases:
EquipmentPanel
Bind
ActivateImplementation
DeactivateImplementation
Get
Set
Invoke
IsActive
SetActive
NameEquipmentSlots
Name Equipment Slots#983711d1#-132823040
RemoveItem
Remove Item#ccb5e8d5#1205762048
AddItem
Add Item#0ee7aae0#624934912
startHook
[ BoltClass#-5118 > Setup#a4e54ba7#670653184 ].Start#67a44....hook
startHandler
[ BoltClass#-5118 > Setup#a4e54ba7#670653184 ].Start#67a44....handler
Start
[ BoltClass#-5118 > Setup#a4e54ba7#670653184 ].Start#67a44....invoke
equipmentSlotsParent
Equipment Slots Parent
equipmentSlots
Equipment Slots
at Ludiq.Bolt.CompositeGeneration`1[TDeclaration].Member (System.Object alias) [0x00017] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Core\Editor\Generation\Generations\CompositeGeneration.cs:119
at Ludiq.Bolt.CompositeGeneration`1[TDeclaration].Field (System.Object alias) [0x00001] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Core\Editor\Generation\Generations\CompositeGeneration.cs:127
at Ludiq.Bolt.SetFlowGraphVariableGenerator+d__2.MoveNext () [0x0003a] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Flow\Editor\Units\Architecture\SetFlowGraphVariableGenerator.cs:23
at System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) [0x0005e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) [0x00033] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at Ludiq.LinqUtility.ForceEvaluation[T] (System.Collections.Generic.IEnumerable`1[T] source) [0x00016] in C:\GameDev\Bolt2a10\Assets\Ludiq\Ludiq.Core\Runtime\Utilities\LinqUtility.cs:19
at Ludiq.Bolt.UnitGenerator`1[TUnit].GenerateControlInputBody (Ludiq.Bolt.MethodGeneration method, Ludiq.Bolt.ControlInput controlInput) [0x00033] in C:\GameDev\Bolt2a10\Assets\Ludiq\Bolt.Flow\Editor\Units\UnitGenerator.cs:104
--- End of inner exception stack trace ---


UnityEngine.Debug:LogError(Object)
Ludiq.Bolt.<>c__DisplayClass2_0:b__1(Task) (at Assets/Ludiq/Bolt.Core/Editor/Generation/GenerationWorkflow.cs:94)
Ludiq.Task:Run() (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Task.cs:62)
Ludiq.WindowTaskRunner:RunSynchronous(Task) (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Runners/WindowTaskRunner.cs:62)
Ludiq.<>c__DisplayClass10_0:b__0() (at Assets/Ludiq/Ludiq.Core/Editor/Tasks/Runners/WindowTaskRunner.cs:34)
System.Threading.ThreadHelper:ThreadStart()

As a side note - deleting the graph variable doesn't mark the set graph variable units still present in the graph as red/missing.

Pending Review

Hi Matthias,

Sorry for the late reply and thanks for the report.

I'll look into this, there has been many similar reports over the last few days.

Pending Review

Hi everyone,

Thanks for the report, I'll have to look into what may be causing this, but it seems like I forgot to alias the graph variable in the local function body generator.

Cannot Reproduce

Hi everyone,

I can't get this to reproduce on my end. It works fine here.

I had assumed I might have fixed it already in another commit, but even reverting to Alpha 10, I can't get it to occur.

Is there any more specific information needed? Any particular type of variable, or anything particular about the flow function?

I can't reproduce it either anymore. 

I'll see what I can get tonight.  I haven't been able to create a graph variable successfully yet, so I should be able to create a repro.

Easy for me to induce!


test.asset

Nothing funky, bare class with the function you see here.