NuclearPowered / Reactor

Modding api for Among Us
https://reactor.gg
GNU Lesser General Public License v3.0
225 stars 43 forks source link

Building issue #32

Closed EarnestGibbs closed 3 years ago

EarnestGibbs commented 3 years ago

I am trying to test, to get an understanding of how modding works, and when I build it always ends in an error. After changing some of the .csproj properties I got different errors but still I am unable to build the mod out. I am using the "dotnet build" command and this is what my current .csproj looks like.

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netstandard2.1</TargetFramework>
        <Version>1.0.0</Version>
        <Mappings>NuclearPowered/Mappings:0.4.0</Mappings>

        <Description>Testing out building a new mod</Description>
        <Authors>Earnest Gibbs</Authors>
    </PropertyGroup>

    <PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
        <GameVersion>2021.4.14s</GameVersion>
        <DefineConstants>$(DefineConstants);STEAM</DefineConstants>
    </PropertyGroup>

    <PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
        <GameVersion>2021.4.14s</GameVersion>
        <DefineConstants>$(DefineConstants);ITCH</DefineConstants>
    </PropertyGroup>

    <ItemGroup>
        <Deobfuscate Include="$(AmongUs)\BepInEx\plugins\Reactor-$(GameVersion).dll" />

        <PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="0.3.0" />
    </ItemGroup>

    <Target Name="Copy" AfterTargets="Reobfuscate">
        <Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" Condition="'$(Configuration)' == 'Debug'" />
    </Target>
</Project>

This is the error I am getting.

C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018: The "GenerateReferences" task failed unexpectedly. [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018: System.NullReferenceException: Field <>9__93_0 (name: __9__93_0) was not found in EOSManager/<>c! [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018:    at Reactor.OxygenFilter.ObfuscationMapper.<>c__DisplayClass8_0.<Map>g__MapType|1(MappedType type) [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018:    at Reactor.OxygenFilter.ObfuscationMapper.Map() [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018:    at Reactor.OxygenFilter.OxygenFilter.Start(String mappings, FileInfo dumpedDll, FileInfo outputDll) [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018:    at Reactor.OxygenFilter.MSBuild.GenerateReferences.Execute() in /home/js6pak/Development/AmongUs/Reactor.OxygenFilter/Reactor.OxygenFilter.MSBuild/GenerateReferences.cs:line 68 [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
C:\Users\maste\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props(37,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]  
tori1277 commented 3 years ago

game version 2021.4.14s isnt supported by oxygen filter yet, so change GameVersion>2021.4.14s to GameVersion>2021.4.12s

EarnestGibbs commented 3 years ago

I have switched the game version to 2021.4.12s, but I am still getting the same errors

DaemonBeast commented 3 years ago

Try one of the solutions here: https://github.com/NuclearPowered/Reactor/issues/29#issuecomment-822761268.

DaemonBeast commented 3 years ago

game version 2021.4.14s isnt supported by oxygen filter yet, so change GameVersion>2021.4.14s to GameVersion>2021.4.12s

Correction: OxygenFilter works fine. It's the mappings that are outdated.

EarnestGibbs commented 3 years ago

Try one of the solutions here: #29 (comment).

Thanks, I still have not gotten this working, but I will continue to tinker with it.

DaemonBeast commented 3 years ago

@EarnestGibbs It's been updated a little. Did you see the note added to the top?

EarnestGibbs commented 3 years ago

@DaemonBeast yes about the mappings being outdated. but I am not sure what that means

DaemonBeast commented 3 years ago

@EarnestGibbs I updated the note at the top of the linked comment I posted (https://github.com/NuclearPowered/Reactor/issues/29#issuecomment-822761268);

EarnestGibbs commented 3 years ago

@DaemonBeast Ok, so I used the edit you mentioned which make the build get further but now in running into a different error

C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TemplatePlugin.cs(32,37): error CS1061: 'TextMeshPro' does not contain a definition for 'Text' and no accessible extension method 'Text' accepting a first argument of type 'TextMeshPro' could be found (are you missing a using directive or an assembly reference?) [C:\Users\maste\Desktop\ModdingAmongUsFolder\TestPlugin\TestPlugin\TestPlugin.csproj]
DaemonBeast commented 3 years ago

@EarnestGibbs Ah yes, change the occurrence of Text to text.

EarnestGibbs commented 3 years ago

@DaemonBeast Thanks that did it.