Skip to content

Commit

Permalink
Merge pull request #11 from Tobi-Mob/1_0_2
Browse files Browse the repository at this point in the history
* TurboAttack default active
  • Loading branch information
Tobi-Mob authored Jul 11, 2022
2 parents 8a6a437 + 5060e5c commit 63574b2
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 46 deletions.
45 changes: 45 additions & 0 deletions Docs/Full-Installation-Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Full Installation Guide

This is a more detailed description of things I did to get the mod working. If you just want to play with the mod, you don't have to read this.


## Install BepInEx in your Skul Root folder
Long general installation guide for BepInEx can be found [here](https://docs.bepinex.dev/master/articles/user_guide/installation/index.html).
Shorter description for Skul below:

At the time of writing, BepInEx 6 has no stable release.
The current builds can be found here: [BepisBuilds](https://builds.bepis.io/projects/bepinex_be).

For Windows use: BepInEx_UnityMono_x64
For Linux use: BepInEx_UnityMono_unix

Extract the content of the archive into the Root folder of your Skul Installation. So that the Root folder of the game contains a "BepInEx" folder

For Windows usually: C:\Program Files\Steam\steamapps\common\Skul\
For Linux usually: /home/MyUserName/.steam/debian-installation/steamapps/common/Skul/

Linux Only:
- modify `run_bepinex.sh` to set the `executable_name` on line 15 like this: `executable_name="Skul.x86_64"`
- make `run_bepinex.sh` executable. To do that, run in terminal: `chmod u+x run_bepinex.sh`
- In Steam, under properties for Skul, set the Launch Options to `./run_bepinex.sh %command%`

## Build the Mod/PlugIn

Open the `Skul.Mod.csproj` and modify `<SkulDirectory>` to point to your Skul folder.
Building the .net project will then build the .dll to `$(SkulDirectory)\BepInEx\plugins` where it will be automatically loaded by BepInEx

## Unstrip Unity dlls
Skul ships with stripped assemblies. ([for further reading](https://github.com/NeighTools/UnityDoorstop/issues/10#issuecomment-776921796))
Downloading the unstripped assemblies and dropping them into `$(SkulDirectory)\Skul_Data\Managed\` fixes that (overwriting existing files as needed).
The `Managed` folder can be backed up in case something goes wrong. Alternatively Steams "Verify integrity of game files" can be used to restore the modified files.

Long Description: [Guide by ghorsington](https://hackmd.io/@ghorsington/rJuLdZTzK)

Short Description:
- download https://unity.bepinex.dev/libraries/2020.3.22.zip and extract the content into `$(SkulDirectory)\Skul_Data\Managed\`
- go to the [Unity Download Archives](https://unity3d.com/get-unity/download/archive) and download the Unity [UnitySetup64-2020.3.22f1.exe](https://download.unity3d.com/download_unity/e1a7f79fd887/Windows64EditorInstaller/UnitySetup64-2020.3.22f1.exe) (Linux users should download the Windows Version)
- Install the Unity Editor and copy `$(UnityDirectory)/Editor/Data/MonoBleedingEdge/lib/mono/4.5` into `$(SkulDirectory)\Skul_Data\Managed\`.

## Run the game

If the mod is running correclty, pressing F1 while in the game will display a message above the player character.
37 changes: 37 additions & 0 deletions Docs/How-To-Mod.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Foreword
===

If you already know C# and coded a bit in Unity you should be finde. If not, this could be a furstrating place to start learning.

What technologies are used
===
Skul itself is made with Unity. So most of the Unity C# API is also available to the modder: [Unity Monobehaviour](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html)

The Mod uses [BepInEx](https://github.com/BepInEx/BepInEx) which is build on top of [Harmony](https://github.com/pardeike/Harmony). They have a lot of documentation on how the stuff works and how it can be used.

How does the build work
===

The build requires 2 special things:
* Skul game files
* BepInEx dependencies

### Skul game files

The `Skul.Mod.csproj` has a `SkulDirectory` entry.
The required gamefiles will be obtained from there and the build output of the mod will be copied there.

If you change the entry, you may have to restart your IDE

### BepInEx dependencies

The required NuGets are inside the "Package"-directory of this repository. The original source for these NuGets is: https://nuget.bepinex.dev/v3/index.json

The Build tries to get the NuGets from the "Package"-directory if possible, so you don't have to add the NuGets source manually.

Where to get help
===
First, consider the docs for [Unity](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html), [BepInEx](https://docs.bepinex.dev/master/) and [Harmony](https://harmony.pardeike.net/).

If that is not enough:
This mod was only possible with help from the smart and motivated people from the BepInEx Discord. If you need help on Unity-Modding, that would be a good place to start.
50 changes: 13 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ Compability
Installation
===


## TLDR Installation

`$(SkulDirectory)` would be the folder where the Skul.exe is.
For Windows it usually is: `C:\Program Files (x86)\Steam\steamapps\common\Skul` or something like that.

Expand All @@ -45,48 +42,27 @@ For Windows it usually is: `C:\Program Files (x86)\Steam\steamapps\common\Skul`

* Install Unity and copy `$(UnityDirectory)\Editor\Data\MonoBleedingEdge\lib\mono\4.5` into `$(SkulDirectory)\Skul_Data\Managed\`.

## Full Installation Guide

### Install BepInEx in your Skul Root folder
Long general installation guide for BepInEx can be found [here](https://docs.bepinex.dev/master/articles/user_guide/installation/index.html).
Shorter description for Skul below:

At the time of writing, BepInEx 6 has no stable release.
The current builds can be found here: [BepisBuilds](https://builds.bepis.io/projects/bepinex_be).
* Run the game via Steam. If the mod is running correclty, pressing F1 while in the game will display a message above the player character.

For Windows use: BepInEx_UnityMono_x64
For Linux use: BepInEx_UnityMono_unix
There are more detailed Instructions available here: [Full Installation Guide](Docs/Full-Installation-Guide.md)

Extract the content of the archive into the Root folder of your Skul Installation. So that the Root folder of the game contains a "BepInEx" folder

For Windows usually: C:\Program Files\Steam\steamapps\common\Skul\
For Linux usually: /home/MyUserName/.steam/debian-installation/steamapps/common/Skul/

Linux Only:
- modify `run_bepinex.sh` to set the `executable_name` on line 15 like this: `executable_name="Skul.x86_64"`
- make `run_bepinex.sh` executable. To do that, run in terminal: `chmod u+x run_bepinex.sh`
- In Steam, under properties for Skul, set the Launch Options to `./run_bepinex.sh %command%`

### Install the Mod/PlugIn
How to build the mod yourself
===

Open the `Skul.Mod.csproj` and modify `SkulDirectory` to point to your Skul folder.
Building the .net project will then build the .dll to `$(SkulDirectory)\BepInEx\plugins` where it will be automatically loaded by BepInEx
Before you continue here, do everything in the `Installation` section first.

### Unstrip Unity dlls
Skul ships with stripped assemblies. ([for further reading](https://github.com/NeighTools/UnityDoorstop/issues/10#issuecomment-776921796))
Downloading the unstripped assemblies and dropping them into `$(SkulDirectory)\Skul_Data\Managed\` fixes that (overwriting existing files as needed).
The `Managed` folder can be backed up in case something goes wrong. Alternatively Steams "Verify integrity of game files" can be used to restore the modified files.
With [git](https://github.com/git-guides/install-git) and [dotnet](https://dotnet.microsoft.com/en-us/download/dotnet) installed these commands should build the mod:

Long Description: [Guide by ghorsington](https://hackmd.io/@ghorsington/rJuLdZTzK)
```
git clone https://github.com/Tobi-Mob/Skul.Mod.git
cd Skul.Mod
dotnet build
```

Short Description:
- download https://unity.bepinex.dev/libraries/2020.3.22.zip and extract the content into `$(SkulDirectory)\Skul_Data\Managed\`
- go to the [Unity Download Archives](https://unity3d.com/get-unity/download/archive) and download the Unity [UnitySetup64-2020.3.22f1.exe](https://download.unity3d.com/download_unity/e1a7f79fd887/Windows64EditorInstaller/UnitySetup64-2020.3.22f1.exe) (Linux users should download the Windows Version)
- Install the Unity Editor and copy `$(UnityDirectory)/Editor/Data/MonoBleedingEdge/lib/mono/4.5` into `$(SkulDirectory)\Skul_Data\Managed\`.
If no errors are thrown, the new build mod was installed into the SkulDirectory.

### Run the game

If the mod is running correclty, pressing F1 while in the game will display a message above the player character.
More infos on how this mod works and how it can be changed are here: [how to mod](Docs/How-To-Mod.md)

Future Ideas
===
Expand Down
12 changes: 6 additions & 6 deletions Skul.Mod/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ private void Update()
{
Vector3 v = levelManager.player.transform.position;
float offset = 0.4f;

Helper.TextSpawner.SpawnBuff(" Mod running! ", v);
v += Vector3.downVector * offset;
Helper.TextSpawner.SpawnBuff(" Mod running ", v);
v += Vector3.down * offset;
Helper.TextSpawner.SpawnBuff("F2: Toggle turbo attack", v);
v += Vector3.downVector * offset;
v += Vector3.down * offset;
Helper.TextSpawner.SpawnBuff("F3: Toggle item modifications", v);
v += Vector3.downVector * offset;
v += Vector3.down * offset;
Helper.TextSpawner.SpawnBuff("F4: Toggle path modifications", v);
v += Vector3.downVector * offset;
v += Vector3.down * offset;
Helper.TextSpawner.SpawnBuff("F5: Get some dark quartz", v);
}

Expand Down
2 changes: 1 addition & 1 deletion Skul.Mod/Skul.Mod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net472</TargetFramework>
<PackageId>Skul.Mod</PackageId>
<Description>Tobi-Mob Skul Mod</Description>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>9.0</LangVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
Expand Down
4 changes: 2 additions & 2 deletions Skul.Mod/TurboButtonMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class TurboButtonMode
/// <summary>
/// Indicates if Turbo-Mode is currently active
/// </summary>
public static bool IsTurboActive { get; private set; }
public static bool IsTurboActive { get; private set; } = true;

/// <summary>
/// Toggles Turbo Mode.
Expand Down Expand Up @@ -75,7 +75,7 @@ public static void StartSetTurboCoroutine(MonoBehaviour anyObject)
if (SetTurboCoroutineHandle == null)
{
Helper.Logger.LogInfo("Turbo-Button coroutine starting");
anyObject.StartCoroutine(SetTurboCoroutine());
SetTurboCoroutineHandle = anyObject.StartCoroutine(SetTurboCoroutine());
}
}

Expand Down

0 comments on commit 63574b2

Please sign in to comment.