feat: add initial People Playground mod development kit
This commit is contained in:
6
extracted_wiki_content/details/built_in_components.txt
Normal file
6
extracted_wiki_content/details/built_in_components.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
URL: https://wiki.studiominus.nl/details/builtInComponents.html
|
||||
Title: People Playground Modding - Built-in components
|
||||
==================================================
|
||||
|
||||
Built-in components
|
||||
Of course you can write your own game components, but it may be useful to understand the existing game components. There are hundreds of components in People Playground, most of which are not fully explained. However, the most significant components have been properly documented in the documentation.
|
||||
15
extracted_wiki_content/details/extended_mod_description.txt
Normal file
15
extracted_wiki_content/details/extended_mod_description.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
URL: https://wiki.studiominus.nl/details/readme.html
|
||||
Title: People Playground Modding - Extended mod description
|
||||
==================================================
|
||||
|
||||
Extended mod description
|
||||
Your mod can optionally contain a README.txt file in its root directory (the same folder as the mod.json).
|
||||
The file should contain a more detailed description that supports TMP Rich Text, but can also just be written as plain text.
|
||||
The text will appear on the pane on the right, irrespective of the mod's current state (active, inactive, suspicious, errored). It could contain usage instructions, extended credits, or just a lengthy description of the mod.
|
||||
Its file size cannot exceed 5 kilobytes and it cannot contain any links.
|
||||
|
||||
|
||||
|
||||
|
||||
With README.txt
|
||||
Without README.txt
|
||||
66
extracted_wiki_content/details/layers.txt
Normal file
66
extracted_wiki_content/details/layers.txt
Normal file
@@ -0,0 +1,66 @@
|
||||
URL: https://wiki.studiominus.nl/details/layers.html
|
||||
Title: People Playground Modding - Layers
|
||||
==================================================
|
||||
|
||||
Layers
|
||||
Unity has a layer system and a sprite sorting system. The game makes extensive use of these systems and the configuration may be useful to modders. This page will describe each layer and what its used for.
|
||||
Object layers
|
||||
Here is an article explaining Unity's object layers.
|
||||
|
||||
DefaultTransparentFXIgnore RaycastWaterUIPost ProcessingObjectsDebrisBoundsOverlayCollidingDebrisPortalLightSpriteScreenUIEnergyHoverSurfaceImmobilityFieldThumbnailDefaultTransparentFXIgnore RaycastWaterUIPost ProcessingObjectsDebrisBoundsOverlayCollidingDebrisPortalLightSpriteScreenUIEnergyHoverSurfaceImmobilityFieldThumbnail
|
||||
|
||||
|
||||
0: Default
|
||||
Comes with Unity. Not used for anything.
|
||||
1: TransparentFX
|
||||
Comes with Unity. Not used for anything.
|
||||
2: Ignore Raycast
|
||||
Comes with Unity. Not used for anything.
|
||||
4: Water
|
||||
The water layer. Liquid body (water and lava) colliders are on this layer. Used by firearms to create splash effects. Why is it called "Water" if there's also lava? Because there wasn't always lava.
|
||||
5: UI
|
||||
The UI is on this layer.
|
||||
8: Post Processing
|
||||
Post processing volumes are on this layers.
|
||||
9: Objects
|
||||
Most physical objects are on this layer. Objects on this layer collide with each other, the room, and some debris. If you want to create an object that colliders with other objects, this is the layer to put it on.
|
||||
10: Debris
|
||||
Most debris is on this layer. Debris only colliders with the walls, ceiling, and floor.
|
||||
11: Bounds
|
||||
Collides with everything. The chamber walls are on this layer.
|
||||
12: Overlay
|
||||
Not used for anything.
|
||||
13: CollidingDebris
|
||||
Colliding debris colliders with the room and objects.
|
||||
14: Portal
|
||||
Not used for anything.
|
||||
15: LightSprite
|
||||
Objects on this layer are rendered by the lighting camera. Most objects in this layer are large radial gradients.
|
||||
16: ScreenUI
|
||||
Objects on this layer are rendered under the normal UI and above game objects. They are not affected by post processing effects.
|
||||
17: Energy
|
||||
Energy weapons that should collide with each other, but not anything else, are on this layer.
|
||||
18: HoverSurface
|
||||
Unused.
|
||||
19: ImmobilityField
|
||||
Immobility capture fields have a collider on this layer. Other objects can cheaply query this layer to find out if they are inside an immobility capture field.
|
||||
31: Thumbnail
|
||||
When a contraption is saved, the whole thing is taken to a thumbnail room where everything is on this layer.
|
||||
Sorting layers
|
||||
Here is an article explaining Unity's sorting layers.
|
||||
Bottom
|
||||
The lowest sorting layer. Used by map decorations and such.
|
||||
Background
|
||||
Originally created for the background limbs of humans. It's used by objects that have parts that necessarily need to be behind most other objects.
|
||||
Default
|
||||
Most objects are on this layer.
|
||||
Portals
|
||||
Unused.
|
||||
Foreground
|
||||
Originally created for the foreground limbs of humans. It's used by objects that have parts that necessarily need to be in front of most other objects.
|
||||
Bubbles
|
||||
Used by some effects and renderers that should not render outside of water bodies.
|
||||
Top
|
||||
The top sorting layer. Not actually the top though. Contains map decorations like water and such.
|
||||
Decals
|
||||
Contains decals that are supposed to be shown on top of everything. Does not mean all decals are on this layer. Rarely used.
|
||||
33
extracted_wiki_content/details/metadata.txt
Normal file
33
extracted_wiki_content/details/metadata.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
URL: https://wiki.studiominus.nl/details/meta.html
|
||||
Title: People Playground Modding - Metadata
|
||||
==================================================
|
||||
|
||||
Metadata
|
||||
Every mod has a metadata file. Metadata files describe information about the mod itself. The file looks something like this:
|
||||
{
|
||||
"Name": "No gore mod",
|
||||
"Author": "ActualHuman32",
|
||||
"Description": "This mod adds cool beans",
|
||||
"ModVersion": "1.0",
|
||||
"GameVersion": "1.8.1",
|
||||
"ThumbnailPath": "thumb.png",
|
||||
"EntryPoint": "Mod.Mod",
|
||||
"Tags": [
|
||||
"Fun"
|
||||
],
|
||||
"Scripts": [
|
||||
"script.cs"
|
||||
]
|
||||
}
|
||||
|
||||
Name is the mod name.
|
||||
Author is the mod creator.
|
||||
Description describes the mod.
|
||||
ModVersion is the version of the mod.
|
||||
GameVersion is the game version this mod was intended for.
|
||||
ThumbnailPath is the relative path to the thumbnail image.
|
||||
Tags is an array of strings that indicate what to categorise it by on the Workshop.
|
||||
EntryPoint is the C# location of the mod entry point.
|
||||
Scripts is an array of file paths that tell the mod loader what files to include. This is relative to the json file.
|
||||
|
||||
There is an online generator available here.
|
||||
31
extracted_wiki_content/details/mod_lifecycle.txt
Normal file
31
extracted_wiki_content/details/mod_lifecycle.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
URL: https://wiki.studiominus.nl/details/lifecycle.html
|
||||
Title: People Playground Modding - Mod Lifecycle
|
||||
==================================================
|
||||
|
||||
Mod Lifecycle
|
||||
Mods have a simple lifecycle. A lifecycle describes when a mod is created, what it does during its lifetime, and when it is destroyed.
|
||||
|
||||
|
||||
|
||||
1. Load
|
||||
Main menu loaded
|
||||
mod.json is found and interpreted. All referenced scripts are read.
|
||||
|
||||
|
||||
2. Compile
|
||||
Mod loaded
|
||||
All loaded scripts are compiled and written to a DLL by the compiler server. The DLL is loaded into memory. OnLoad is called.
|
||||
|
||||
|
||||
3. Execute
|
||||
Map loaded or catalog updated
|
||||
ModAPI.ModMetaData is set and `Main` is called.
|
||||
|
||||
|
||||
4. Termination
|
||||
Game is exited
|
||||
OnUnload is called. All resources are freed.
|
||||
|
||||
|
||||
Note that OnLoad is only called if the mod is active after compilation. If it's inactive (the default), it will call OnLoad once activated and never again.
|
||||
A mod may spit out errors in the compilation stage (or other stages). The errors are always logged to the Logs folder.
|
||||
49
extracted_wiki_content/details/script_files.txt
Normal file
49
extracted_wiki_content/details/script_files.txt
Normal file
@@ -0,0 +1,49 @@
|
||||
URL: https://wiki.studiominus.nl/details/scriptFiles.html
|
||||
Title: People Playground Modding - Script Files
|
||||
==================================================
|
||||
|
||||
Script Files
|
||||
The metadata file contains a Scripts field. This field is an array that lists all the scripts to be loaded by the mod as relative paths. While not necessary, it's convenient to split your mod into multiple files if it's big enough.
|
||||
The EntryPoint field points the game to the entry point in your mod. This is typically formatted like Namespace.Class. The game will look for static void Main() at the specified entry point. This method is called every time the toybox (aka catalog) is repopulated. This typically happens when the map is opened or when a local contraption was modified.
|
||||
The game will also look for static void OnLoad(). This is an optional method but it is useful for initialisation code that runs before anything else. The method is invoked right after the mod is compiled. Complementing OnLoad, static void OnUnload() is called just before the game window is closed.
|
||||
using UnityEngine;
|
||||
|
||||
namespace CoolMod
|
||||
{
|
||||
public class CoolMod
|
||||
{
|
||||
public static void OnLoad()
|
||||
{
|
||||
Debug.Log("Cool Mod has loaded! :)");
|
||||
}
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
ModAPI.Register(
|
||||
new Modification()
|
||||
{
|
||||
OriginalItem = ModAPI.FindSpawnable("Generator"),
|
||||
NameOverride = "Ultra gaming generator [CoolMod]",
|
||||
NameToOrderByOverride = "Generator 2",
|
||||
DescriptionOverride = "Generator specifically for gaming",
|
||||
CategoryOverride = ModAPI.FindCategory("Machinery"),
|
||||
ThumbnailOverride = ModAPI.LoadSprite("gen2.png"),
|
||||
AfterSpawn = (Instance) =>
|
||||
{
|
||||
Instance.transform.localScale = new Vector3(5, 5, 5);
|
||||
Instance.GetComponent<GeneratorBehaviour>().TargetCharge = 150000;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public static void OnUnload()
|
||||
{
|
||||
Debug.Log("Cool Mod has been unloaded :(");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Common script file. The entry point would be CoolMod.CoolMod
|
||||
A typical script file will look like the image above. The two important parts of the modding API are ModAPI and Modification. There are a few classes that may be useful aside from the two mentioned earlier.
|
||||
66
extracted_wiki_content/details/shady_code_rejection.txt
Normal file
66
extracted_wiki_content/details/shady_code_rejection.txt
Normal file
@@ -0,0 +1,66 @@
|
||||
URL: https://wiki.studiominus.nl/details/shadyCodeRejection.html
|
||||
Title: People Playground Modding - Shady Code Rejection
|
||||
==================================================
|
||||
|
||||
Shady Code Rejection
|
||||
To prevent modders from creating malicious mods, the game skims the source code and rejects the mod completely if it encounters specific structures or keywords.
|
||||
If you try to use any of the following, your mod will be marked as suspicious:
|
||||
Forbidden modifiers
|
||||
|
||||
extern
|
||||
|
||||
Forbidden identifiers
|
||||
|
||||
InteropServices
|
||||
Diagnostics
|
||||
Http
|
||||
CodeDom
|
||||
Application
|
||||
Quit
|
||||
UnityWebRequest
|
||||
TextReader
|
||||
TextWriter
|
||||
BinaryReader
|
||||
BinaryWriter
|
||||
StreamReader
|
||||
StreamWriter
|
||||
StringReader
|
||||
StringWriter
|
||||
FileStream
|
||||
IsolatedStorageFileStream
|
||||
NetworkStream
|
||||
PipeStream
|
||||
UserPreferenceManager
|
||||
WebRequest
|
||||
WebClient
|
||||
WebSocket
|
||||
Socket
|
||||
Steamworks
|
||||
Process
|
||||
DllImport
|
||||
LoadFile
|
||||
ReadFile
|
||||
WWW
|
||||
AppDomain
|
||||
AssemblyBuilder
|
||||
FromFile
|
||||
OpenURL
|
||||
LoadURL
|
||||
RejectShadyCode
|
||||
CreateType
|
||||
File
|
||||
FileInfo
|
||||
Directory
|
||||
DirectoryInfo
|
||||
Assembly
|
||||
|
||||
Forbidden using directives
|
||||
|
||||
using System.Security
|
||||
using System.Web
|
||||
using UnityEngine.Networking
|
||||
using Steamworks
|
||||
|
||||
or any using directive with aliases, such as
|
||||
|
||||
using Rand = UnityEngine.Random
|
||||
6
extracted_wiki_content/details/the_unity_engine.txt
Normal file
6
extracted_wiki_content/details/the_unity_engine.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
URL: https://wiki.studiominus.nl/details/unity.html
|
||||
Title: People Playground Modding - The Unity Engine
|
||||
==================================================
|
||||
|
||||
The Unity Engine
|
||||
A lot of the functionality you'll be using lives in the Unity engine. Their documentation may be useful to you.
|
||||
Reference in New Issue
Block a user