slushiegoose / Town-Of-Us

An Among Us mod containing a bunch of roles
GNU General Public License v3.0
823 stars 355 forks source link

Unable to compile the mod #135

Closed szpic closed 3 years ago

szpic commented 3 years ago

Hello i downloaded source code. Opened it in visual studio but when i try to build it i receive error:

Error   MSB4018 The "GenerateReferences" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Cecil, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e' or one of its dependencies. Nie można odnaleźć określonego pliku.
File name: 'Mono.Cecil, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e'
   at Il2CppDumper.DummyAssemblyExporter.Export(Il2CppExecutor il2CppExecutor, String outputDir, Boolean addToken)
   at Il2CppDumper.Il2CppDumper.PerformDump(String gameAssemblyPath, String metadataDatPath, String outputDirectoryPath, Config config, Action`1 reportProgressAction)
   at Reactor.OxygenFilter.MSBuild.GenerateReferences.Execute() in /home/js6pak/Development/AmongUs/Reactor.OxygenFilter/Reactor.OxygenFilter.MSBuild/GenerateReferences.cs:line 56
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    TownOfUs    C:\Users\szpic\.nuget\packages\reactor.oxygenfilter.msbuild\0.3.0\build\Reactor.OxygenFilter.MSBuild.props  37  

Before build i modified csproj file:

<GameVersion>2021.4.14s</GameVersion>
<Mappings>NuclearPowered/Mappings:0.4.0</Mappings>

my dependencies tree looks like below: image

probably it is connected to this issue with mono file but as you can see all those dll are correctly downloaded from nuget. I have also set environment variable set with correct path to the game folder.

pylixonly commented 3 years ago

the source code is made for v2021.3.31.3.

hawkerm commented 3 years ago

The source code has been updated for 2021.5.10s as the csproj file references it, but there's some other mapping file I think that's required, but that repo isn't updated and it's not included here?

Similar to #118, it'd be great to have some info on how to compile the mod and be able to make contributions to the project.

pylixonly commented 3 years ago

The source code has been updated for 2021.5.10s as the csproj file references it, but there's some other mapping file I think that's required, but that repo isn't updated and it's not included here?

Similar to #118, it'd be great to have some info on how to compile the mod and be able to make contributions to the project.

the mappings is empty actually.. he added it so that Reactor.OxygenFilter wont complain

pylixonly commented 3 years ago

you can have the mappings by using the unofficial fork of Reactor by @DaemonBeast here https://github.com/DaemonBeast/Reactor

DaemonBeast commented 3 years ago

The 2021.5.10s release of Town Of Us comes with a 2021.5.10s build of Reactor with it if I recall correctly. That build and my build should be almost identical though, so choose whichever.

Also, I don't think Slushiegoose made the mappings public (since the csproj references a file on their computer). You'll have to set the mappings to DaemonBeast/Mappings:0.5.0 (the mappings are identical to what Slushiegoose used, or at least I think they are. I just put them on GitHub).

hawkerm commented 3 years ago

Thanks @DaemonBeast, I had tried just putting DaemonBeast/Mappings:0.5.0 string in for the Mappings property, but it still gave an error. Do I need to clone your repo alongside or something?

DaemonBeast commented 3 years ago

@hawkerm Make sure you have a 2021.5.10s version of Reactor and the correct unhollowed dlls for 2021.5.10s (remember to delete the BepInEx/unhollowed folder after updating Among Us, then start Among Us to regenerate the correct unhollowed dlls).

If you're using Visual Studio, try running dotnet build in a cmd in the project's directory.

hawkerm commented 3 years ago

Thanks @DaemonBeast, dotnet build worked when I pointed to the modded town-of-us version so it could reference the right reactor.dll. Not entirely sure how I'm supposed to generate it on it's own without the copy of Town of Us already though.

DaemonBeast commented 3 years ago

@hawkerm You could use my Reactor fork instead. It should be fully compatible as far as I know. Alternatively, you could compile Slushiegoose's Reactor fork. Just change the mappings to DaemonBeast/Mappings:0.5.0 before compiling.