Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Unable to load add-on script from path

A topic by RelicSoulz created Jul 01, 2024 Views: 306 Replies: 13
A moderator has unlisted this topic. It is not visible on the topic listing but you can still reply and make edits.
Viewing posts 1 to 3
(1 edit)

hi I am using Godot v4.2.2 with mono on Windows and have .NET 6.0.421 installed. I encountered an error after the "build" step while trying to enable the Addon. The error message reads: 'Unable to load add-on script from path: 'res://addons/assetplacer/AssetPlacerPlugin.cs'. This may be due to a code error in that script.' It also mentions 'Disabling the add-on in 'res://addons/assetplacer/plugin.cfg' to avoid further errors.' I have already tried removing the folder and placing a new copy again, but the error persists.  

im not sure if it the file itself i deleted and redownloaded many time 

visual studio says 32 problem with file..

Developer

Hello Relic, can you try if it gives you the same error if you add the plugin to a new project? Also, can you send me the contents of your .csproj file inside your project, to see if you have any unusual configuration there?

Please also make sure you precisely followed each of the installation steps here:

https://cookiebadger.github.io/assetplacer-docs/installation.html

Yes it give me the same error on new project as well. I tried using older version to see if that might help but I keep receiving the same error. How would I send you the .CSpro file?

Developer

unfortunately, I cannot tell how to fix your issue from this information. Since it happens in a new project, I suspect there might either be a problem with your .NET installation (maybe try upgrading it to a newer version), or with the version of Godot you downloaded (make sure it is the mono version). If the problem persists, you may contact me here so we can try to do some deeper troubleshooting.

I redownloaded Godot and that seem to have fixed adding the plugin however when trying to place it I get this error now. I also tried messaging on discord but it just take me to my server

Developer

I am happy to hear that you were able to solve your issue. The warning you get now should not be a problem, and only appear when you open the project. If it annoys you, you can change all instances of "EditorPlugin.GetEditorInterface()" with "EditorInterface". The reason for the obsolete code is backward compatibility with Godot 4.0.

I am also having this same exact problem. 4.4.1 - mono using 1.4.1.

Build works fine, spits out no errors. just warnings which show that the plugin is building.

Clicking “On” in the plugin settings causes it to produces “Unable to load addon script from path: ‘res://addons/assetplacer/AssetPlacerPlugin.cs’. This might be due to a code error in that script. Disabling the addon at ‘res://addons/assetplacer/plugin.cfg’ to prevent further errors.”

Another thing, when viewing the plugin.cfg it says the language is “GDScript” but changing it to “C#” doesnt fix anything. May be a bug with Godot because changing the language of any plugin changes the language of them all.

One more thing, this is on an existing project that was not a .net project before I tried to install assetplacer. It also has func_godot as a plugin.

Developer

Hello sol-vin. 

To my knowledge, the language field in the .cfg does not do much. Please make sure that the plugin is set in the correct folder (inside "res://addons/"), as described here: https://cookiebadger.github.io/assetplacer-docs/installation.html
The installation location should match the location specified in the .cfg file. If you are on Linux, note that uppercase and lowercase are treated differently, so if your addons folder is called "Addons", e.g. it might not work.

Let me know if you need further help. 

(6 edits)

Yeah, all of that is correct. My addons folder is lower cased. It is “finding” assetplacer during the build step but turning it on in the project settings still causes the error.

image.png

In the screen shot I have included the addons file directory in the browser.

Also clicking build produces all these warnings, but they do essentially let me know that assetplacer is building.

image.png

No output in the godot dev console either

Here is a gist of msbuild’s output.

https://gist.github.com/sol-vin/74c4608471fa784cf1d3056733baaa79

I can get the plugin working with a fresh project…, not sure why this won’t work. Maybe it’s because my project started as a GDScript project and then I switched to try and use this plugin.

Developer

Thanks for the screenshot. Your setup does indeed look correct. 

Sometimes, such issues can occur when certain C# files are not properly (re-)built, and the engine thinks they are at a different location.

Can you try both going to MSBuild and pressing 'Clean Build', and if that still does not work, manually deleting the folder: C:/Users/Ian/Documents/GitHub/liminalita/.godot/mono

This 'mono' folder is where the compiled C# files are put when they are built, so if stuff goes wrong, deleting that often helps.

 If the problem persists, would you please also send me the contents of the .csproj and .sln files inside your project folder? 

Thanks for the patience, by the way, I hope together we're getting to the root of the problem.

No problem, tried both, no effect.

Here are the csproj and sln files. thanks for helping :)

https://gist.github.com/sol-vin/31977a8e7468e38736a1ebbdbe141601

Developer

Alright, since you have nothing uncommon there, it should be safe to delete both .sln and .csproj files, and see if that fixes the issue.

If it doesn't, then I guess there must be an issue with either your .NET installation (or Mono, but better not to use Mono anymore), the NuGet configuration, or some stuff within your userdata folders. 

As a start, you should try and make sure that NuGet works. From the docs:

A simple way to fix the NuGet configuration file is to regenerate it. In a file explorer window, go to %AppData%\NuGet. Rename or delete the NuGet.Config file. When you build your Godot project again, the file will be automatically created with default values.

I can recall this fixing the issue on one of my machines once. I really hope we won't have to reinstall stuff, I wouldn't want you to go through that trouble.

I just decided to make a new project and reimport my main scene. Luckily I organized things well enough that copy-pasting everything just worked.

Developer

Okay, I'm sorry that you had this extra effort just to get the plugin working. Do let me know if you ever have the problem again, and if regenerating the NuGet Config helps in that case.

Best regards, and happy developing!

Developer unlisted this topic