C
C#2mo ago
MagicJinn

ILSpy decompiles namespaces incorrectly

I'm having an issue where ILSpy is decompiling scripts like this:
namespace Sunless.Game.AI;

public class HuntingPlus : AIBehaviour{ code here }
namespace Sunless.Game.AI;

public class HuntingPlus : AIBehaviour{ code here }
Instead of
namespace Sunless.Game.AI
{
public class HuntingPlus : AIBehaviour{ code here }
}
namespace Sunless.Game.AI
{
public class HuntingPlus : AIBehaviour{ code here }
}
Which is a big issue for the around 1000+ scripts it generates. I cannot fix it all manually. Did I configure something wrong?
15 Replies
canton7
canton72mo ago
So it literally contains the text "namespace namespace"?
ero
ero2mo ago
they're confused about file-scoped vs block scoped.
canton7
canton72mo ago
I'd agree, if the first line wasn't namespace namespace Sunless.Game.AI;, with "namespace" repeated twice If ILSpy is really outputting that, that's obviously a problem If it's actually namespace Sunless.Game.AI; then sure, it's just OP's confusion
MagicJinn
MagicJinnOP2mo ago
Nope, that was my mistake, sorry The problem is that Unity does not accept these files.
MagicJinn
MagicJinnOP2mo ago
999+ errors
No description
ero
ero2mo ago
but also what are you doing?
No description
ero
ero2mo ago
why are you decompiling these files and putting them into a unity project?
MagicJinn
MagicJinnOP2mo ago
Ah, was looking for that, thanks! Recreating a Unity project from an existing game.
ero
ero2mo ago
for what purpose?
MagicJinn
MagicJinnOP2mo ago
Remastering Well, fan remaster, I didn't make the game.
Jimmacle
Jimmacle2mo ago
you'll need to make sure you actually have permission to
MagicJinn
MagicJinnOP2mo ago
I plan to go the route of games like OpenRCT, Daggerfall Unity and OpenMW. Make the basegame a hard requirement.
Evyr
Evyr2mo ago
in that case why are you not using a mod loader and patching the game on startup?
MagicJinn
MagicJinnOP2mo ago
There are certain fundamental things that cannot be easily changed.
Want results from more Discord servers?
Add your server