Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated add_sibling() call to call on sibling and and with correct argument #6

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

odecay
Copy link
Contributor

@odecay odecay commented Jan 23, 2023

I believe this closes #3

Based on referencing this function in the godot 3 version of qodot and the Godot 4 docs for add_sibling, I believe calling this on "below" with the node to add below as the argument should produce the same behavior as in qodot 3.

When I tested it appeared to clear up the error in #3 but also introduced a new one pointing to a c# binding when building the map in the worldspawn example. It seems to point to

bool buildVisuals = layer.Get("build_visuals").AsBool();
but I may be misinterpreting as I am not familiar with godot c# bindings. Here is the error (paths slightly redacted).

modules/mono/glue/runtime_interop.cpp:1223 - System.NullReferenceException: Object reference not set to an instance of an object.
     at Qodot.Qodot.SetWorldspawnLayers(Array worldspawnLayers) in /home/****/****/addons/qodot/src/core/Qodot.cs:line 70
     at Qodot.Qodot.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /home/****/****/Godot.SourceGenerators/Godot.SourceGenerators.ScriptMethodsGenerator/Qodot.Qodot_ScriptMethods.generated.cs:line 74
     at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 24

@odecay odecay changed the title Updated to call on sibling and correct argument Updated add_sibling() call to call on sibling and and with correct argument Jan 23, 2023
@EMBYRDEV
Copy link
Collaborator

This partially fixes #3. The C# error already exists in #3 so this doesn't introduce any issues and does improve functionality. I'll take a look at fixing up the C# when I get some time.

Thank you.

@EMBYRDEV EMBYRDEV merged commit c378a5a into QodotPlugin:main Jan 23, 2023
@odecay odecay deleted the add_sibling branch January 25, 2023 07:17
knil79 pushed a commit to knil79/Qodot that referenced this pull request Feb 16, 2023
Updated add_sibling() call to call on sibling and and with correct argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Error while importing worldspawn-layers example map
2 participants