-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix mono glue generation #165
Conversation
Well, it didn't error out, but...
Occurs, when building the project. |
I am unsure about this to be honest. I am not a c# user myself. You could try deleteing cache, IE the .godot folder. And or checking the project file to see if it specifies a version that can be updated. |
I see. Well, I just looked, and the specified Godot Sdk that the engine specifies (4.1.2 rc) doesn't exist as a nuget package. The editor updated the sdk to the "new" sdk, instead of using the old one. But, the project file won't load because the package specified for the sdk doesn't exist on the nuget repository. When I enabled pre-release packages, the only one to show up was the Godot-SDK 4.2-dev-06. So... hmmn. question. Your build of the editor should have a spot where it targets an sdk... can you look there to see? Or, maybe make a nuget package, and place that into the release? I'll do some digging. |
Okay, so it looks like changing it to rc.1 works. <Project Sdk="Godot.NET.Sdk/4.1.2-rc.1">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project> Works with this. (things at least compile.) Though, any new project, people will need to go in and manually change that. |
I spoke too soon. Things sorta work... I got all of this when I ran the project. Godot log in the app_userdata for the project:
I'm not sure where exactly the full logs are? I think the above covers what shows up in the debugger, if not and you know where they are stored, let me know, and I'll paste them in here. It looks like it's not making the Native Binds for the C# code.
^ one of many. |
@michieal I am unable to reproduce this issue, something may of gone wrong while building it on my end. But i downloaded latest mono build from actions and was able to run a hello world c# project. Could you please try again with https://github.com/WeaselGames/godot_luaAPI/suites/16855092579/artifacts/962905802 and let me know if you are still having issues? |
Also when createing a new project with this build the contents of this file are <Project Sdk="Godot.NET.Sdk/4.1.0">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project> |
Okay, I do not think it actually built. I think whats happening for me is since its using a nuget package its getting the official godot nuget package. Not sure how we could for it to use the local version. |
Okay @michieal, I have gotten mono to work properly now. There is some extra steps for you after downloading. I have added a mono_instructions.txt to the zip with the needed steps. If you can confirm this also works for you we will get it merged and update releases https://github.com/WeaselGames/godot_luaAPI/suites/16882169777/artifacts/964541199 using Godot;
using System;
public partial class Node2D : Godot.Node2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
GD.Print("Hello from C#");
LuaApi lua = new LuaApi();
lua.DoString("print(\"Hello from Lua\")");
}
} |
Okay, I'd say that this is ready to be merged.
It worked in both the recreated sample project, and in the project that I have been working on. The above is from the project that I have been working on... so, the For the already existing project, I had to do a And, the best part is that there are no errors! 😃 One last thing, the export templates - might want to have a small file saying how to install them, for people not exactly used to the Godot system yet. Thank you for fixing this, and epic work! |
This would probably be a good idea. I would need to decide how to tell people to do it. The zip we provide can be used a .tpz for importing default templates. Sadly godot does not add the build name or extra suffix to the version, so templates would conflict with the base editor in this case. The other option is to link the specific template in the export profile. Which is probably the better option. Documentation always needs improvement haha |
Well, considering that I will need to know... As I am still very new to the Godot ecosystem. I guess, though, I can try digging around and see what I can come up with. Also, will the templates need to be updated? (Not sure how they work in comparison to the editor itself.)
lol, I feel that. |
I can give you a quick summery as I won't get to documentation for a little bit still. So the templates them selfs is just the godot engine compiled for a specific platform without the editor compiled with it. On exporting your game godot gives several options like packing the game assets into the template or creating a .pck file with your assets. These assets include anything from scripts to textures. The template is what ultimately become the executable for your game. Now on how to use them, under releases we have 2 export template options. export-templates if for the normal engine builds without mono. These support all platforms. Then export-templates-mono is of course for mono. Since godot c# has low platform support right now. These only support Linux, windows and macos. Inside the zip files you will see executables for each platform and architecture that is supported. There will be 2 for each supported combination, release and debug. Debug templates are to allow you to debug the exported project using godot debugging tools still. Release has that all stripped out to optimize the final release build. When creating the export profile in the editor, it has you select the platform and architecture. To make use of our templates you then most set the file path for both the debug and release templates. Edit: |
I figured, and that works. I'll make a document (or update the ReadMe) for the Mono steps. I think that this should be in there too. (I'm used to making documentation for the programs that I write, so it shouldn't be hard.) Also, is there a screenshots dir so that I can put images into the documentation?
So, I need to grab those templates then. I only see the non-mono templates in the list here. (Web, iOS, Android.) Will there be a template pack or zip?
Right. "In da future..." lol.
Cool. That makes it easier.
Okay. Can do.
I see, then I need to get the updated ones for this PR's release. |
No, but one could be added under the .github folder.
Im a bit confused by what you mean here, none of these platforms currently support c#. Also the templates are in a zip archive.
And actually the current export templates should work for you. This PR will likely not be a new release as all that changed is how we generate the glue. The editor and template binaries them selfsame should he unmodified. https://github.com/WeaselGames/godot_luaAPI/releases/download/v2.1-beta6/export-templates-mono.zip |
Okay, cool. When you merge this, I will fork it and make some documentation.
I was looking at the files that have the tests going, in this PR.
I just downloaded these. I did notice that there aren't any debug templates that are .x86_64, is this intentional? I mean, there's release templates for it, just the debug one is .x86_32. |
That sounds like a mistake, I will look into that tomorrow. |
Understood. thank you. |
A quick fix for mono glue generation mistake discovered in #164, we generated it but never built it.