Conversation
|
Currently fails to export on windows YarnSpinner-Godot failed with 2 error(s) (5.7s) → .godot\mono\temp\bin\ExportRelease\win-x64\YarnSpinner-Godot.dll |
…t into AOT # Conflicts: # addons/YarnSpinner-Godot/Runtime/Commands/Actions.cs
…t into AOT # Conflicts: # YarnSpinner-Godot.csproj
…t into AOT # Conflicts: # YarnSpinner-Godot.csproj
|
|
||
| return await Task.WhenAll(uniTasks); | ||
| } | ||
| // public static async partial YarnTask<T[]> WhenAll<T>(params YarnTask<T>[] tasks) |
There was a problem hiding this comment.
Uncommenting these lines causes a compilation failure under AOT, maybe due to using the generic types?
| var paramIndex = i; | ||
| // var paramsArray = new List<object?>(); | ||
| var paramsArray = Array.CreateInstance(parameterArrayElementType!, argumentCount - i); | ||
| var paramsArray = new List<object?>(); |
There was a problem hiding this comment.
Not sure about these changes. Made them based on AOT warnings
|
I actually got my more complex game project mostly working when I retested, after adding some settings to the .props and csproj file related to assembly trimming. However, I still got some errors I don't understand that seems to be AOT related : Additionally it seems like my changes to get the project compiling under AOT to command dispatching breaks commands with integer type arguments. This may be because I tried to make the arguments array a list of objects since before it was using reflection based APIs that are incompatible with AOT from what I read, and an integer is a primitive & not an object to my understanding. I don't know how to change the code right now so that it works under AOT and also supports all the required data types for command arguments |
|
YS-Godot SQLite Variable Storage sample error: |
| { | ||
| paramsArray.SetValue(converter.Invoke(arg, i), i - paramIndex); | ||
| // todo test | ||
| paramsArray[i - paramIndex] = converter.Invoke(arg, i); |
There was a problem hiding this comment.
I believe this is the reason you see ArgumentOutOfRangeException, it is empty the first time it runs
| paramsArray[i - paramIndex] = converter.Invoke(arg, i); | |
| paramsArray.Add(converter.Invoke(arg, i)) |
| i += 1; | ||
| } | ||
|
|
||
| finalArgs[paramIndex] = paramsArray; |
There was a problem hiding this comment.
since paramsArray is a list I think this needs to be
| finalArgs[paramIndex] = paramsArray.ToArray(); |
may be also makes sense to rename paramsArray into paramsList or something like this
Related blog post https://godotengine.org/article/platform-state-in-csharp-for-godot-4-2/