feat: add initial People Playground mod development kit

This commit is contained in:
2026-01-06 06:35:51 +03:00
parent b89c805060
commit b4c22a7c63
1095 changed files with 40281 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
URL: https://wiki.studiominus.nl/snippets/activation.html
Title: People Playground Modding - Activation action
==================================================
Activation action
This code snippet shows how to execute code when the player activates the object.
//add a built-in component that invokes a delegate when the item receives an activation signal
Instance.AddComponent<UseEventTrigger>().Action = () =>
{
//everything inside this delegate will be executed
//show a notification to the player
ModAPI.Notify("I'VE BEEN USED!");
};

View File

@@ -0,0 +1,48 @@
URL: https://wiki.studiominus.nl/snippets/simpleGun.html
Title: People Playground Modding - Adding a firearm
==================================================
Adding a firearm
This code snippet shows an example on how to add a firearm with custom properties and sprites.
ModAPI.Register(
new Modification()
{
OriginalItem = ModAPI.FindSpawnable("Pistol"), //item to derive from
NameOverride = "Mauser C96 -TooManyGuns", //new item name with a suffix to assure it is globally unique
DescriptionOverride = "World War era pistol developed by the Germans.", //new item description
CategoryOverride = ModAPI.FindCategory("Firearms"), //new item category
ThumbnailOverride = ModAPI.LoadSprite("c96view.png"), //new item thumbnail (relative path)
AfterSpawn = (Instance) => //all code in the AfterSpawn delegate will be executed when the item is spawned
{
//setting the sprite
Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("C96.png");
//getting the FirearmBehaviour for later manipulation
var firearm = Instance.GetComponent<FirearmBehaviour>();
//creating a custom cartridge for the gun
Cartridge customCartridge = ModAPI.FindCartridge("9mm"); //load a copy of the 9mm cartridge
customCartridge.name = "7.63×25mm Mauser"; //set a name
customCartridge.Damage *= 0.8f; //change the damage however you like
customCartridge.StartSpeed *= 1.5f; //change the bullet velocity
customCartridge.PenetrationRandomAngleMultiplier *= 0.5f; //change the accuracy when the bullet travels through an object
customCartridge.Recoil *= 0.7f; //change the recoil
customCartridge.ImpactForce *= 0.7f; //change how much the bullet pushes the target
//set the cartridge to the FirearmBehaviour
firearm.Cartridge = customCartridge;
//set the new gun sounds. this is an array of AudioClips that is picked from at random when shot
firearm.ShotSounds = new AudioClip[]
{
ModAPI.LoadSound("c96_1.wav"),
ModAPI.LoadSound("c96_2.wav"),
ModAPI.LoadSound("c96_3.wav"),
};
// set the collision box to the new sprite shape
// this is the easiest way to fix your collision shape, but it also the slowest.
Instance.FixColliders();
}
}
);

View File

@@ -0,0 +1,16 @@
URL: https://wiki.studiominus.nl/snippets/texturePackSystem.html
Title: People Playground Modding - Basic texture pack system
==================================================
Basic texture pack system
by Talon
public static void Main()
{
ReplaceTextures("Sword");
}
public static void ReplaceTextures(string ItemToReplace)
{
ModAPI.FindSpawnable(ItemToReplace).Prefab.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("sprites/" + ItemToReplace + ".png");
ModAPI.FindSpawnable(ItemToReplace).ViewSprite = ModAPI.LoadSprite("sprites/" + ItemToReplace + "Thumb.png");
}

View File

@@ -0,0 +1,17 @@
URL: https://wiki.studiominus.nl/snippets/cartridges.html
Title: People Playground Modding - Cartridges
==================================================
Cartridges
This is a list of all names that FindCartridge can understand.
120 mm
30 mm
30-06
38 Special
5.56x45mm
50 AE
50 BMG
7.62x39mm
7.62x51mm
7.62×25mm
9mm

View File

@@ -0,0 +1,19 @@
URL: https://wiki.studiominus.nl/snippets/changeEnvironmentSettings.html
Title: People Playground Modding - Change environment settings
==================================================
Change environment settings
This snippet shows you how to manipulate the environment settings.
//clone settings because its safer this way or whatever the hell, I don't remember
var set = MapConfig.Instance.Settings.ShallowClone();
//do whatever
//set.Floodlights = false;
//set.Rain = true;
//set.Snow = false;
//set.Fog = true;
//etc.
//apply settings
MapConfig.Instance.ApplySettings(set);

View File

@@ -0,0 +1,37 @@
URL: https://wiki.studiominus.nl/snippets/createExplosion.html
Title: People Playground Modding - Create an explosion
==================================================
Create an explosion
This code snippet shows an example of how to create explosions.
//The most basic explosion function. Give a position and a strength and the rest is assumed from these values.
ExplosionCreator.Explode(transform.position, 2);
// -- OR --
//Call the full explosion function for more control
ExplosionCreator.Explode(new ExplosionCreator.ExplosionParameters
{
//Explosion center
Position = transform.position,
//Should particles be created and sound played?
CreateParticlesAndSound = true,
//Should the particles, if created, be that of a large explosion?
LargeExplosionParticles = false,
//The chance that limbs are torn off (0 - 1, 1 meaning all limbs and 0 meaning none)
DismemberChance = 0.1f,
//The amount of force for each "fragment" of the explosion. 8 is a pretty powerful explosion. 2 is a regular explosion.
FragmentForce = 8,
//The amount of rays cast to simulate fragments. More rays is more lag but higher precision
FragmentationRayCount = 32,
//The ultimate range of the explosion
Range = 10
});

View File

@@ -0,0 +1,31 @@
URL: https://wiki.studiominus.nl/snippets/backgroundScriptCreation.html
Title: People Playground Modding - Creating a background script
==================================================
Creating a background script
This code snippet shows how to create a background script.
using UnityEngine;
namespace Mod
{
public class Mod
{
public static void Main()
{
//tell the game that a component of this type should be created in the background
ModAPI.Register<CoolBackgroundScriptTime>();
}
}
//define a behaviour that will run in the background
//it will be attached to an otherwise empty gameobject floating in the scene, created when the catalog is first populated
public class CoolBackgroundScriptTime : MonoBehaviour
{
//treat it like any other component
void Update()
{
if (Input.GetKey(KeyCode.P))
ModAPI.Notify("gamer is holding the P key");
}
}
}

View File

@@ -0,0 +1,20 @@
URL: https://wiki.studiominus.nl/snippets/createLight.html
Title: People Playground Modding - Creating a light
==================================================
Creating a light
This code snippet shows how to create a light that interacts with the lighting system.
//creating a light object with myself as a parent, a red colour, a radius of 5 units, and a brightness of 1 (default)
var glow = ModAPI.CreateLight(transform, Color.red, 5, 1);
//change the colour to whatever the hell
glow.Color = Color.yellow;
//blind the player
glow.Brightness = 1500;
//devour the world
glow.Radius = 1000;
//it's a component of a new child GameObject so you can set its local position
glow.transform.localPosition = new Vector3(0,0,0);

View File

@@ -0,0 +1,40 @@
URL: https://wiki.studiominus.nl/snippets/customHuman.html
Title: People Playground Modding - Custom human sprite
==================================================
Custom human sprite
This code snippet shows how to create a human with custom sprites. This also works on Gorses and Androids. Very useful if you want to create a mind-numbingly boring mod.
// register item to the mod registry
ModAPI.Register(
new Modification()
{
OriginalItem = ModAPI.FindSpawnable("Human"), //item to derive from
NameOverride = "Human but blue -BH", //new item name with a suffix to assure it is globally unique
DescriptionOverride = "From avatar!!!! (the one with the blue people).", //new item description
CategoryOverride = ModAPI.FindCategory("Entities"), //new item category
ThumbnailOverride = ModAPI.LoadSprite("blueMan.png"), //new item thumbnail (relative path)
AfterSpawn = (Instance) => //all code in the AfterSpawn delegate will be executed when the item is spawned
{
//load textures for each layer (see Human textures folder in this repository)
var skin = ModAPI.LoadTexture("blueSkin.png");
var flesh = ModAPI.LoadTexture("blueFlesh.png");
var bone = ModAPI.LoadTexture("blueBone.png");
//get person
var person = Instance.GetComponent<PersonBehaviour>();
//use the helper function to set each texture
//parameters are as follows:
// skin texture, flesh texture, bone texture, sprite scale
//you can pass "null" to fall back to the original texture
person.SetBodyTextures(skin, flesh, bone, 1);
//change procedural damage colours if they interfere with your texture (rgb 0-255)
person.SetBruiseColor(86, 62, 130); //main bruise colour. purple-ish by default
person.SetSecondBruiseColor(154, 0, 7); //second bruise colour. red by default
person.SetThirdBruiseColor(207, 206, 120); // third bruise colour. light yellow by default
person.SetRottenColour(202, 199, 104); // rotten/zombie colour. light yellow/green by default
person.SetBloodColour(108, 0, 4); // blood colour. dark red by default. note that this does not change decal nor particle effect colours. it only affects the procedural blood color which may or may not be rendered
}
}
);

View File

@@ -0,0 +1,41 @@
URL: https://wiki.studiominus.nl/snippets/debug.html
Title: People Playground Modding - Debug drawing
==================================================
Debug drawing
This code snippet shows how to draw lines and shapes for debugging purposes. Do not use this code in a released mod. It is meant for debugging only and will cause performance issues.
public class SuperCoolBehaviour : MonoBehaviour
{
private void Awake()
{
//create polygon collider for demonstration purposes
var poly = gameObject.AddComponent<PolygonCollider2D>();
poly.SetPath(0, new[]{
new Vector2(0,0),
new Vector2(5,0),
new Vector2(0,5),
});
}
//you should generally draw debug primitives in OnWillRenderObject
private void OnWillRenderObject()
{
//NEVER USE ModAPI.Draw IN YOUR RELEASED MOD
//THEY ARE SLOW AND NOT MEANT FOR ANYTHING OTHER THAN DEBUGGING
//draw line from this GameObject to some place else
ModAPI.Draw.Line(transform.position, new Vector3(76, 43));
//draw rectangle here and with width 4, height 2
ModAPI.Draw.Rect(transform.position, new Vector3(4,2));
//draw a cool circle with a radius of 8 at the transform position
ModAPI.Draw.Circle(transform.position, 8);
//draw the effective shapes of all colliders attached to this object
foreach (var item in GetComponents<Collider2D>())
{
ModAPI.Draw.Collider(item);
}
}
}

View File

@@ -0,0 +1,9 @@
URL: https://wiki.studiominus.nl/snippets/editingExistingItems.html
Title: People Playground Modding - Editing pre-existing items
==================================================
Editing pre-existing items
by Talon
A decently underutilized function of the modding API is the ability to change items that already exist.
ModAPI.FindSpawnable("Sword").Description = "This sword SUCKS!!!";
ModAPI.FindSpawnable("Sword").Prefab.GetComponent<SpriteRenderer>().color = Color.red;

View File

@@ -0,0 +1,18 @@
URL: https://wiki.studiominus.nl/snippets/entrypoint.html
Title: People Playground Modding - Empty entry point
==================================================
Empty entry point
This code snippet is an entry point template.
using UnityEngine;
namespace Mod
{
public class Mod
{
public static void Main()
{
}
}
}

View File

@@ -0,0 +1,40 @@
URL: https://wiki.studiominus.nl/snippets/eventListening.html
Title: People Playground Modding - Listen for events
==================================================
Listen for events
This code snippet shows how to listen for, and respond to, events provided by the modding API.
using UnityEngine;
namespace Mod
{
public class Mod
{
public static void Main()
{
// listen for the event that is fired when wires are created
ModAPI.OnWireCreated += (sender, wire) => {
// check if it is a spring cable
if (wire is SpringCableBehaviour)
{
// make it red
wire.SetColor(Color.red);
// make it thinner
wire.SetThickness(0.05f);
}
};
// listen for the event that is fired when something is killed
ModAPI.OnDeath += (sender, being) => {
//notify player of their action
ModAPI.Notify("this is really immoral");
};
// listen for gunshot event
ModAPI.OnGunShot += (sender, gun) => {
//notify player what round the gun uses
ModAPI.Notify(gun.Cartridge.name);
};
}
}
}

View File

@@ -0,0 +1,47 @@
URL: https://wiki.studiominus.nl/snippets/mapId.html
Title: People Playground Modding - Map IDs
==================================================
Map IDs
The UniqueIdentity of each map. See Map for more info.
Abyss
cce24b21-779f-44e4-a4f5-9cc5c3fc6b18
Blocks
b77a3f22-10da-4ef5-9dce-0413f15e15c1
Default
fb813068-e717-45de-a97f-4677a41758e6
Humongous
8a2f165e-d4e9-4e6c-b20c-8ffa660c10c8
Hybrid
1f444372-71ce-4862-a02e-708d82eb9dc0
Lava
498b4aad-0ccc-4167-aee2-324a28cd57ae
Sea
35a41d94-8bc7-47a2-93de-3a297955e97c
Slanted
75c18cc2-5e0d-4e3c-b966-c852cdd1bb8b
Small
544cf3d4-018d-4dd1-b442-b3845e07f1a3
Snow
3924fb95-dc1d-43e9-b8b1-b161b91c1f9b
Substructure
004cb5da-0d40-4fc7-aba2-d86a9659c724
Tiny
5b8c90b2-59fb-4fc7-9915-229cbc04ef0d
Tower
5bb837ca-bbf1-4b64-a39d-33b0ab684e1d
Void
265b1c13-c372-4ea4-8448-09731f0b0985

View File

@@ -0,0 +1,8 @@
URL: https://wiki.studiominus.nl/snippets/materials.html
Title: People Playground Modding - Materials
==================================================
Materials
This is a list of all names that FindMaterial can understand.
Sprites-Default
VeryBright

View File

@@ -0,0 +1,26 @@
URL: https://wiki.studiominus.nl/snippets/particles.html
Title: People Playground Modding - Particle effects
==================================================
Particle effects
This is a list of all names that CreateParticleEffect can understand.
BlasterImpact
FuseBlown
MetalHit
Disintegration
BlasterImpactHole
Spark
WoodHit
PinkExplosion
EnormousExplosion
BloodExplosion
BigZap
BigExplosion
HugeZap
Ricochet
BrokenElectronicsSpark
Explosion
RedBarrelExplosion
Flash
IonExplosion
Vapor

View File

@@ -0,0 +1,32 @@
URL: https://wiki.studiominus.nl/snippets/physicalProperties.html
Title: People Playground Modding - Physical properties
==================================================
Physical properties
This is a list of all names that FindPhysicalProperties can understand.
AndroidArmour
Bottle
Bowling ball
Bowling pin
Brick
Bulletproof
Ceramic
Concrete
Flammable metal
Glass
Gorse
Hollow metal
Human
Ice
Incredible
Insulator
Metal
Plastic
Rock
Rubber
Snow
Soap
Soft
Tempered Glass
Weapon
Wood

View File

@@ -0,0 +1,14 @@
URL: https://wiki.studiominus.nl/snippets/assignTextures.html
Title: People Playground Modding - Random sprite assignment
==================================================
Random sprite assignment
This code snippet shows how to set the sprites of an object that has a random sprite. Think of items like the Handcannon, Bowlingball, and Balloon🎈.
//get the RandomSpriteBehaviour from the object (if it has one) and assign an array of your sprites to it
Instance.GetComponent<RandomSpriteBehaviour>().sprites = new Sprite[]
{
ModAPI.LoadSprite("ball_1.png"),
ModAPI.LoadSprite("ball_2.png"),
ModAPI.LoadSprite("ball_3.png"),
ModAPI.LoadSprite("ball_4.png"),
};

View File

@@ -0,0 +1,22 @@
URL: https://wiki.studiominus.nl/snippets/registerItem.html
Title: People Playground Modding - Registering an item
==================================================
Registering an item
This code snippet shows a simple template of a ModAPI.Register call.
// register item to the mod api
ModAPI.Register(
new Modification()
{
OriginalItem = ModAPI.FindSpawnable("Knife"), //item to derive from
NameOverride = "Dagger -MoreMelee", //new item name with a suffix to assure it is globally unique
DescriptionOverride = "It is a dagger.", //new item description
CategoryOverride = ModAPI.FindCategory("Melee"), //new item category
ThumbnailOverride = ModAPI.LoadSprite("daggerView.png"), //new item thumbnail (relative path)
AfterSpawn = (Instance) => //all code in the AfterSpawn delegate will be executed when the item is spawned
{
//get the SpriteRenderer and replace its sprite with a custom one
Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("dagger.png");
}
}
);

View File

@@ -0,0 +1,23 @@
URL: https://wiki.studiominus.nl/snippets/spawnParticle.html
Title: People Playground Modding - Spawn particles on activation
==================================================
Spawn particles on activation
This code snippet shows how to spawn the built-in particle effects when the object is activated.
ModAPI.Register(new Modification()
{
//set item details
OriginalItem = ModAPI.FindSpawnable("Knife"),
NameOverride = "Epic knife that sparks when you use it",
DescriptionOverride = "not a single soul knows why this exists",
ThumbnailOverride = ModAPI.LoadSprite("sparkknife_view.png"),
AfterSpawn = (Instance) =>
{
//add a UseEventTrigger and set its action
Instance.AddComponent<UseEventTrigger>().Action = () => {
//spawn an effect by the name of "Spark" at the transform position
ModAPI.CreateParticleEffect("Spark", Instance.transform.position);
};
}
});

View File

@@ -0,0 +1,267 @@
URL: https://wiki.studiominus.nl/snippets/spawnables.html
Title: People Playground Modding - Spawnable items
==================================================
Spawnable items
This is a list of all names that FindSpawnable can understand.
1000kg Weight
9mm Pistol
Accelerator
Accumulator
Acid Syringe
Activation Fuse
Activation Toggle
Activation Transformer
Activator Electrode
Adrenaline Syringe
AK-47
Anchor
Android
Archelix Caster
Assault Rifle
Atom Bomb
Axe
Balloon
Baseball Bat
Battery
Bazooka
Beam Rifle
Bell
BG Signal Converter
Bicycle
Blaster
Blaster Rifle
Blood Flask
Blood Tank
Blue cathode light
Boat Motor
Bone Eating Syringe
Bottle
Bowling Ball
Bowling Pin
BR Signal Converter
Brick
Brick Cube
Brick Wall
Bulletproof Sheet
Bus
Bus Chair
Button
Capacitor Attachment
Car
Cardiopulmonary Bypass Machine
Ceiling Turret
Centrifuge
Chainsaw
Clamp
Coagulation Syringe
Cobblestone Wall
Concrete slab
Container Wagon
Conveyor Belt
Cooling Element
Crate
Crossbow
Crossbow Bolt
Crystal
Dampening Box
De staf van Sinterklaas
Death Syringe
Decimator
Defibrillator
Detached 120mm Cannon
Detached 30mm HEAT Cannon
Detached Beam Cannon
Detached Laser Cannon
Detached Ray Cannon
Detector
Disassembler
Dynamite
Electricity Transformer
Electromagnet
EMP Generator
Empty Syringe
Energy Sword
Energy Vessel Explosive
Explosive Rounds Attachment
Fan
Fire Detector
Fire Extinguisher
Fireworks
Flamethrower
Flashlight
Flashlight Attachment
Flask
Flintlock Pistol
Floodlight
Fluorescent Lamp
Freeze Syringe
Freezeray
Fusion Bomb
G1 Submachine Gun
Gate
General Purpose Bomb
Generator
Giant Wooden Bowl
Glass Pane
Gorse
Gorse Blood Flask
Green cathode light
Grenade Launcher
Gyroscope Stabiliser
Hammer
Handcannon
Handgrenade
Heart Monitor
Heating Element
Heatray
Holographic Display
Hover Thruster
Hovercar
Human
I-Beam
Immobility Field
Incendiary Rounds Attachment
Industrial Generator
Industrial Gyrostabiliser
Industrial Piston
Infrared Thermometer
Insulator
Ion Cannon
Ion Thruster
Jet Engine
Jukebox
Key Trigger
Knife
Knockout Syringe
Lagbox
Lance
Landmine
Large Bush
Laser Attachment
Laser Pointer
Laser Receiver
Laser sentry turret
Launch Platform
LED Bulb
Life Detector
Life Syringe
Light Machine Gun
Lightbulb
Liquid Canister
Liquid Duplicator
Liquid Outlet
Liquid Pressuriser
Liquid Valve
Liquidentifier
Machine Blaster
Machine Gun
Magnum Revolver
Mending Syringe
Metal Cube
Metal Detector
Metal Pole
Metal Pyramid
Metal Wheel
Metronome
Mini Thruster
Minigun
Mirror
Missile Launcher
Motion Detector
Motorised Wheel
Nitroglycerine Flask
Normal Sized Gun
Oil Flask
Painkiller Syringe
Particle Projector
Physics Gun
Pink Explosive
Pink Syringe
Pistol
Piston
Plank
Plastic Barrel
Plastic Explosive
Plate
Power Gauge
Power Hammer
Pressure Valve
Propeller
Pulse Drum
Pumpkin
Purple cathode light
Radio
Ramp
Reconstructor
Red Barrel
Red cathode light
Resistor
Resizable Housing
Revolver
RG Signal Converter
Rifle
Rigidifier
Rocket Launcher
Rod
Rotor
Scherbenwerfer
Scope Attachment
Sentry Turret
Servo
Shock Detector
Shotgun
Signal Flare
Siren
Slider
Small Boulder
Small Bush
Small Button
Small I-Beam
Sniper Rifle
Soap
Soviet Submachine Gun
Spear
Spike
Spike Grenade
Spike Rifle
Spot Light
Stick
Sticky Grenade
Stielhandgranate
Stone Brick
Stone Brick Wall
Stormbaan
Structural Pillar
Stunner
Submachine Gun
Sword
Tall Tree
Tank
Television
Tempered Glass Pane
Tesla Coil
Text Display
Thermometer
Thruster
Thrusterbed
Timed Gate
Toggleable Mirror
Torch
Truck
Ultra Strength Syringe
Vase
Water Breathing Syringe
Wheel
White cathode light
Winch
Wing
Wooden Chair
Wooden Pillar
Wooden Pole
Wooden Table
Wooden Wheel
Worm Staff
Wrench
Yellow cathode light
Zombie Syringe