Skip to content

Commit 789e548

Browse files
authored
Merge pull request #487 from ow-mods/dev
Some Docs Improvements
2 parents 69e2fcb + ae138c0 commit 789e548

File tree

11 files changed

+60
-52
lines changed

11 files changed

+60
-52
lines changed

docs/config.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@
3838
"name": "GitHub",
3939
"link": "https://github.com/ow-mods/owml",
4040
"icon": "github"
41+
},
42+
{
43+
"name": "Nuget",
44+
"link": "https://www.nuget.org/packages/OWML",
45+
"icon": "boxes"
4146
}
4247
]
4348
}
44-
}
49+
}

docs/content/pages/guides/getting_started.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This page will outline how to get a working mod that will simply log a message t
99

1010
## Choosing an IDE
1111

12-
An IDE will help`provide the ability to create, edit, and build your mod.
12+
An IDE will help provide the ability to create, edit, and build your mod.
1313

1414
The recommended IDE for modding is [Visual Studio](https://visualstudio.microsoft.com/){ target="_blank" }, however, stuff like Rider and VSCode can also work. This tutorial will assume you're using Visual Studio.
1515

@@ -21,7 +21,7 @@ Head to the [Visual Studio downloads page](https://visualstudio.microsoft.com/th
2121

2222
We want the "Desktop development with .NET" module, this will provide us with the tools we need to build the mod.
2323

24-
After installing Visual Studio, launch it once an then close it, this will ensure certain files are generated.
24+
After installing Visual Studio, launch it once and then close it, this will ensure certain files are generated.
2525

2626
## Installing the Template
2727

@@ -58,7 +58,7 @@ Now that we have the template installed, open Visual Studio and select "New Proj
5858

5959
Set the project name to the name of your mod, **please note this should NOT have spaces or special characters in it**. The standard casing for projects is PascalCase, which involves capitalizing the start of every word and removing spaces.
6060

61-
On the next screen, set author name to the name you want to appear in the manager and on the website, **this should also not contain spaces**
61+
On the next screen, set the author name to the name you want to appear in the manager and on the website, **this should also not contain spaces**
6262

6363
Finally, click "Create Project"
6464

@@ -80,30 +80,30 @@ This file is used by OWML to generate the settings menu for your mod, we'll go o
8080

8181
### {YourProjectName}.csproj
8282

83-
This file tell Visual Studio about your project, it determines stuff like dependencies and versions, you shouldn't need to touch this.
83+
This file tells Visual Studio about your project, it determines stuff like dependencies and versions, you shouldn't need to touch this.
8484

8585
## Viewing The C# File
8686

87-
Double-click {YourProjectName}.cs, it should open up in the main editor pane.
87+
Double-click {YourProjectName}.cs, and it should open up in the main editor pane.
8888

8989
This file should contain a class that has the same name as your project and some methods within that class.
9090

9191
We'll focus on `Start()`. In this method we do two things:
9292

9393
1. We output a message to the console alerting the user that the mod has loaded
94-
2. We subscribe to the scene loaded event in order to output a message to the log when the SolarSystem scene is loaded.
94+
2. We subscribe to the scene loaded event to output a message to the log when the SolarSystem scene is loaded.
9595

9696
You may have noticed we use the ModHelper field to achieve console output, ModHelper is a collection of utilities your mod can use to do a variety of things. It's covered in the "Mod Helper" section of the site.
9797

9898
## Building The Mod
9999

100-
Now that we know what the mod *should* do, let's make sure it actually does it. Building your mod should be as simple as pressing "Solution -> Build Solution" in the menu bar, if you get an error involving Visual Studio not being able to find a path, please see the section below, otherwise skip to "Running The Mod"
100+
Now that we know what the mod *should* do, let's make sure it does it. Building your mod should be as simple as pressing "Solution -> Build Solution" in the menu bar, if you get an error involving Visual Studio not being able to find a path, please see the section below, otherwise, skip to "Running The Mod"
101101

102102
### Fixing .csproj.user
103103

104-
Your mod contains a special file called {YourProjectName}.csproj.user, this file tells Visual Studio where to build the mod to, if you've installed the manager in a non-standard location, this file will be incorrect. To fix this, open the manager and select settings, then copy the path in the "OWML Path" field. Copy and paste this value between the `<OutputPath>` and `</OutputPath>`, and add `\Mods` to the end of the path. Then open up your manifest file and copy the `uniqueName` field (don't include the quotes). Paste this value preceded by a `\` a the end of the path.
104+
Your mod contains a special file called {YourProjectName}.csproj.user, this file tells Visual Studio where to build the mod, if you've installed the manager in a non-standard location, this file will be incorrect. To fix this, open the manager and select settings, then copy the path in the "OWML Path" field. Copy and paste this value between the `<OutputPath>` and `</OutputPath>`, and add `\Mods` to the end of the path. Then open up your manifest file and copy the `uniqueName` field (don't include the quotes). Paste this value preceded by a `\` at the end of the path.
105105

106-
For example, if my mod's uniqueName is `Bwc9876.CoolMod`, my file would look like:
106+
For example, if my mod's uniqueName is `Bwc9876.CoolMod`, my file would look like this:
107107

108108
```xml
109109
<OutputPath>C:\MyCoolFolder\DifferentManagerInstallFolderBcImAHacker\Mods\Bwc9876.CoolMod</OutputPath>
@@ -113,7 +113,7 @@ For example, if my mod's uniqueName is `Bwc9876.CoolMod`, my file would look lik
113113

114114
Now the mod should have appeared in your mod manager at the very bottom, notice how the download count is a dash.
115115

116-
You mod should now be ready to run!
116+
Your mod should now be ready to run!
117117

118118
Click start game and wait for the title screen to load in. Now search your manager logs (there's a search box) for a message along the lines of "My mod {YourProjectName} is loaded!". This means your mod was loaded successfully! You can also try loading into the main game and checking the logs for another message from your mod.
119119

@@ -123,4 +123,10 @@ When developing your mod you may want to get line numbers in your stack trace. T
123123

124124
## Next Steps
125125

126-
You've successfully created and built your first Outer Wilds mod, moving forward may require a bit of knowledge in unity and will depend on what exactly you're trying to do. These guides will provide information on how to use various aspects of OWML, but it won't cover everything. If you ever need help, or even just want to chat about modding, feel free to [join our Discord](https://discord.gg/wusTQYbYTc){ target="_blank" }. There's almost always someone available to help.
126+
You've successfully created and built your first Outer Wilds mod, moving forward may require a bit of knowledge in unity and will depend on what exactly you're trying to do. You may want to read the following guides to get an idea of how to make your mod:
127+
128+
- [Patching the game with HarmonyX]({{ "Patching"|route }})
129+
- [Creating custom mod settings]({{ "Creating Mod Settings"|route }})
130+
- [Publishing your mod]({{ "Publishing Your Mod"|route }})
131+
132+
These guides will provide information on how to use various aspects of OWML, but they won't cover everything. If you ever need help, or even just want to chat about modding, feel free to [join our Discord](https://discord.gg/wusTQYbYTc){ target="_blank" }. There's almost always someone available to help.

docs/content/pages/guides/mod_settings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This guide outlines how to use OWML's config system to display mod settings in t
99

1010
## Editing default-config.json
1111

12-
First things first, you're going to need to define your settings, open up `default-config.json` and add an object called `settings`.
12+
First things first, you're going to need to define your settings, open up `default-config.json`, and add an object called `settings`.
1313

1414
```json
1515
{
@@ -20,7 +20,7 @@ First things first, you're going to need to define your settings, open up `defau
2020
}
2121
```
2222

23-
The settings object is comprised of key-value pairs where the key is the ID of the setting and the value is default value of that setting.
23+
The settings object is comprised of key-value pairs where the key is the ID of the setting and the value is the default value of that setting.
2424

2525
For example, if I wanted a check box called "Party Mode", I would do:
2626

@@ -33,7 +33,7 @@ For example, if I wanted a check box called "Party Mode", I would do:
3333
}
3434
```
3535

36-
You can also do other data-types like numbers and strings
36+
You can also do other data types like numbers and strings
3737

3838
```json
3939
{

docs/content/pages/guides/patching.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ Patching allows you to run code before and after base-game methods. It also all
99

1010
## Decompiling The Game
1111

12-
In order to examine base-game methods and figure out what you need to patch, we recommend you use [DnSpy](https://github.com/dnSpyEx/dnSpy/releases){target="_blank"}, a tool for decompiling and viewing .NET assemblies.
12+
To examine base-game methods and figure out what you need to patch, we recommend you use [DnSpy](https://github.com/dnSpyEx/dnSpy/releases){target="_blank"}, a tool for decompiling and viewing .NET assemblies.
1313

1414
Once installed, select File -> Open. Then, navigate to the game's folder and open the `Assembly-CSharp.dll` file located in `OuterWilds_Data/Managed`.
1515

1616
You should now see the assembly loaded on the left, most classes in Outer Wilds' assembly do not have a namespace, so they'll be located under a `-`
1717

1818
![The - Namespace]({{ "images/patching/dnspy.webp"|static }})
1919

20-
Here's some tip for viewing base game code:
20+
Here are some tips for viewing the base game code:
2121

22-
- If you ever need to find out where a method, class, or variable is used, you can right click it an select "Analyze".
22+
- If you ever need to find out where a method, class, or variable is used, you can right-click it and select "Analyze".
2323
- You can jump to the definition of a method, class, or variable by clicking on it, you can also control-click to open it in a new tab.
2424
- Sometimes the decompiler treats switch statements strangely, it may look like they're simply chaining else ifs when in reality they're using a switch
2525

@@ -32,17 +32,17 @@ To prepare for adding patches to our mod we'll do two things:
3232

3333
### CreateAndPatchAll
3434

35-
To make our patches actually run, we need to execute `Harmony.CreateAndPatchAll` in our `Start` method (technically it doesn't *need* to be in start but you should try to run it as early as possible)
35+
To make our patches run, we need to execute `Harmony.CreateAndPatchAll` in our `Awake` method (technically it doesn't *need* to be in `Awake` but you should try to run it as early as possible)
3636

3737
```csharp
3838
public class MyCoolMod : ModBehaviour {
39-
public void Start() {
39+
public void Awake() {
4040
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
4141
}
4242
}
4343
```
4444

45-
And that's it! Now our patches will actually be applied
45+
And that's it! Now our patches will be applied
4646

4747
### Using A Singleton
4848

@@ -81,9 +81,9 @@ A prefix is code that runs before another method.
8181

8282
To create a prefix, add a new method with the `HarmonyPrefix` attribute.
8383

84-
Then, add the `HarmonyPatch` attribute as well, this attribute takes at least two arguments, the first is the type you want to patch, the second is the name of the method you wish to patch.
84+
Then, add the `HarmonyPatch` attribute as well, this attribute takes at least two arguments, the first is the type you want to patch, and the second is the name of the method you wish to patch.
8585

86-
Let's say I want to log to the console everytime the player dies, to do so I need to prefix `DeathManager.KillPlayer`, so my patch might look something like this:
86+
Let's say I want to log to the console every time the player dies, to do so I need to prefix `DeathManager.KillPlayer`, so my patch might look something like this:
8787

8888
```csharp
8989
[HarmonyPatch]
@@ -104,7 +104,7 @@ public class MyPatchClass {
104104
Prefixes also allow you to completely stop the original method from running, to do so, make your method return a bool.
105105

106106
- If the boolean returned from the method is `true` the original method will be skipped
107-
- If the boolean returned from the method if `false` the original method is still run
107+
- If the boolean returned from the method is `false` the original method is still run
108108

109109
Let's say instead of simply logging when the player dies, we want to prevent it from happening entirely.
110110

@@ -126,7 +126,7 @@ A postfix is code that runs after another method.
126126

127127
To create a postfix, add a new method with the `HarmonyPostfix` attribute.
128128

129-
Also add the `HarmonyPatch` attribute, it functions the exact same as it does with prefixes, you need to provide the type to patch and the name of the method to patch.
129+
Also add the `HarmonyPatch` attribute, it functions the same as it does with prefixes, you need to provide the type to patch and the name of the method to patch.
130130

131131
We'll use `DeathManager.KillPlayer` as an example again:
132132

@@ -147,9 +147,9 @@ These next few sections will apply to both Prefixes and Postfixes, so even if th
147147

148148
### Getting The Object You're Patching
149149

150-
If you want to be able to access the actual object you'r patching you can make your patch take an argument named `__instance`.
150+
If you want to be able to access the actual object you're patching you can make your patch take an argument named `__instance`.
151151

152-
Let's say I want to log to the console where the Quantum Moon goes to everytime it's observed:
152+
Let's say I want to log to the console where the Quantum Moon goes to every time it's observed:
153153

154154
```csharp
155155
public class MyPatchClass {
@@ -200,7 +200,7 @@ public class MyPatchClass {
200200

201201
You can patch the getters and setters of properties by passing in a third argument to the `HarmonyPatch` attribute of `MethodType.Getter` and `MethodType.Setter` respectively.
202202

203-
For example if I wanted to log the repair fraction everytime ShipComponent.repairFraction is gotten, I would do:
203+
For example, if I wanted to log the repair fraction every time ShipComponent.repairFraction is gotten, I would do:
204204

205205
```csharp
206206
[HarmonyPatch]
@@ -215,9 +215,9 @@ public class MyPatchClass {
215215

216216
### Patching Overloads
217217

218-
When you want to patch a specific overload of a method, you need to pass the types of the parameters that overload takes as a `Type[]` as a third argument to `HarmonyPatch`.
218+
When you want to patch a specific overload of a method, you need to pass the types of the parameters that overload takes as a `Type[]` as the third argument to `HarmonyPatch`.
219219

220-
For example if I wanted to log `ReferenceFrameTracker.UntargetReferenceFrame` but only the overload that takes a single `bool`, I would do:
220+
For example, if I wanted to log `ReferenceFrameTracker.UntargetReferenceFrame` but only the overload that takes a single `bool`, I would do:
221221

222222
```csharp
223223
[HarmonyPatch]

docs/content/pages/mod_helper/assets.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
Title: Assets
33
---
44

5-
<!-- TODO: AAAAAAAAAAAAAAAAAA WHY ARE THE SIGNATURES SO WEIRD -->
6-
<!-- Awaiting context -->
7-
85
# ModHelper.Assets
96

107
This module helps with loading assets from the filesystem.

docs/content/pages/mod_helper/config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ Whether your mod is enabled.
1212

1313
## Settings
1414

15-
A `Dictionary<string, object>` containing your mod's settings, it's recommended to use the below methods to access the settings instead of interfacing with this dict directly.
15+
A `Dictionary<string, object>` containing your mod's settings, it's recommended to use the below methods to access the settings instead of interfacing with this dictionary directly.
1616

1717
## GetSettingValue&lt;T&gt;
1818

19-
Gets the settings value from the mod's config with the given key. Deserialized into type `T`
19+
Gets the setting's value from the mod's config with the given key. Deserialized into type `T`
2020

2121
### Get Parameters
2222

2323
- `string key`: The key to get
2424

2525
## SetSettingsValue
2626

27-
Sets the settings value in the mod's config with the given key to the given value.
27+
Sets the setting's value in the mod's config with the given key to the given value.
2828

2929
### Set Parameters
3030

docs/content/pages/mod_helper/console.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Used to log a message to the console.
1616

1717
- `string message`: The message to log
1818
- *`MessageType type`*: The type of message to log, see below; Defaults to `MessageType.Message`
19-
- *`string senderType`*: Usually used internally, the type that logged this message, don't pass unless you have to
19+
- *`string senderType`*: Usually used internally, the type that logged this message, don't pass this unless you have to
2020

2121
### MessageType Reference
2222

docs/content/pages/mod_helper/interaction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class MyCoolMod : ModBehaviour {
2121

2222
## GetDependants
2323

24-
Gets a list of all mods that are dependant on the mod with the given uniqueName
24+
Gets a list of all mods that are dependent on the mod with the given uniqueName
2525

2626
```csharp
2727
public class MyCoolMod : ModBehaviour {
@@ -60,7 +60,7 @@ public class MyCoolMod : ModBehaviour {
6060

6161
## TryGetModApi&lt;T&gt;
6262

63-
Attempts to get the api for the mod with the given unique name. You must define the mod's api as an interface and pass that in as the `T`. Returns `null` if the API couldn't be loaded.
63+
Attempts to get the API for the mod with the given unique name. You must define the mod's API as an interface and pass that in as the `T`. Returns `null` if the API couldn't be loaded.
6464

6565
```csharp
6666
public class MyCoolMod : ModBehaviour {

docs/content/pages/mod_helper/manifest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ These properties are converted from camelCase to PascalCase (ex: `uniqueName` ->
1818

1919
## ModFolderPath
2020

21-
The absolute filepath to your mod's directory, most OWML methods auto-prepend this.
21+
The absolute file path to your mod's directory, most OWML methods auto-prepend this.

docs/content/pages/mod_helper/menus.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Title: Menus
44

55
# ModHelper.Menus
66

7-
Provides utilities to extend base-game menus and ui.
7+
Provides utilities to extend base-game menus and UI.
88

99
## Interfaces
1010

@@ -16,15 +16,15 @@ Represents a menu
1616

1717
### OnInit
1818

19-
Event that's fired when the menu has been initialized.
19+
The event that's fired when the menu has been initialized.
2020

2121
## IModButton
2222

2323
Represents a button
2424

2525
### OnClick
2626

27-
Event that fires when clicked
27+
The event that fires when clicked
2828

2929
### Title
3030

@@ -46,11 +46,11 @@ Hides the button
4646

4747
### OnConfirm
4848

49-
Event that's fired when the confirm button is pressed
49+
The event that's fired when the confirm button is pressed
5050

5151
### OnCancel
5252

53-
Event that's fired when the cancel button is pressed
53+
The event that's fired when the cancel button is pressed
5454

5555
## IModInputMenu
5656

@@ -60,7 +60,7 @@ The event that's fired when the input is confirmed, it expects an Action&lt;stri
6060

6161
## MainMenu
6262

63-
The main menu of the game, represented by `IModMainMenu`.
63+
The main menu of the game. It is represented by `IModMainMenu`.
6464

6565
### IModButtons
6666

@@ -73,7 +73,7 @@ The main menu of the game, represented by `IModMainMenu`.
7373

7474
## PauseMenu
7575

76-
The pause menu, represented by `IModPauseMenu`.
76+
The pause menu. It is represented by `IModPauseMenu`.
7777

7878
### IModButtons
7979

docs/content/pages/mod_helper/storage.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ Helps with storing data that persists through different runs using JSON.
88

99
## Load&lt;T&gt;
1010

11-
Loads an object (of type &lt;T&gt;) from the given filepath. Loads the `default` of `T` if the file doesn't exist.
11+
Loads an object (of type &lt;T&gt;) from the given file path. Loads the `default` of `T` if the file doesn't exist.
1212

1313
### Load Parameters
1414

1515
(*italicized* = optional)
1616

17-
- `string filename`: The filepath, relative to your mod's directory, of the JSON file to load the object from.
18-
- *`bool fixBackslashes`*: Replaces back slashes with forward slashes, this can mess up escape characters, defaults to `true`
17+
- `string filename`: The file path, relative to your mod's directory, of the JSON file to load the object from.
18+
- *`bool fixBackslashes`*: Replaces backslashes with forward-slashes, this can mess up escape characters; defaults to `true`
1919
- *`JsonSerializerSettings settings`*: Use custom [JsonSerializerSettings](https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonSerializerSettings.htm){target="_blank"}.
2020

2121
## Save&lt;T&gt;
2222

23-
Saves an object (of type &lt;T&gt;) to the given filepath. Creates a new file if one doesn't exist.
23+
Saves an object (of type &lt;T&gt;) to the given file path. Creates a new file if one doesn't exist.
2424

2525
### Save Parameters
2626

2727
- `T obj`: The object to save.
28-
- `string filename`: The filepath, relative to your mod's directory, of the file to save the object to.
28+
- `string filename`: The file path, relative to your mod's directory, of the file to save the object to.
2929

3030
## Example
3131

0 commit comments

Comments
 (0)