diff --git a/CUSTOM-SETTINGS.md b/CUSTOM-SETTINGS.md index d7714d0..0b685b4 100644 --- a/CUSTOM-SETTINGS.md +++ b/CUSTOM-SETTINGS.md @@ -17,3 +17,9 @@ When creating assets using ComfyUI: ## Image Dimensions - **Any size can be chosen** for sprites - **Thumbnail**: 512x512 pixels + +## Audio effects: +- **Format**: WAV (PCM) +- **Sample Rate**: 44.1 kHz +- **Bit Depth**: 16-bit +- **Channels**: Mono diff --git a/README.md b/README.md index 06dc3c2..338f778 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,30 @@ Clone `ppg-snippets` repo: git clone https://github.com/mestiez/ppg-snippets.git ``` -## Important files -- `ppg-snippets/` folder with code snippets from `https://github.com/mestiez/ppg-snippets` +## Files + - `extracted_wiki_content/` full docs for create mods from `https://wiki.studiominus.nl/` -- `How-To-Mod-In-People-Playground.md` - complete tutorial to creating a mode (from `https://steamcommunity.com/sharedfiles/filedetails/?id=3363454139`) +- `mods/` folder with complete mods +- `parsing_docs/` for creating `extracted_wiki_context/` folder +- `ppg-snippets/` folder with code snippets from `https://github.com/mestiez/ppg-snippets` +- `SledgeHammer/` example mod to understand the structure +- `AGENTS.md` for AI - `CUSTOM-SETTINGS.md` for personal asset style guidelines and custom configuration. +- `How-To-Mod-In-People-Playground.md` - complete tutorial to creating a mode (from `https://steamcommunity.com/sharedfiles/filedetails/?id=3363454139`) ## Example prompt ``` -READ `AGENTS.md`, `README.md` and other files that necessary for you to create new mode in new folder. -I provide all what you need. You can use grep or whatenver in `extracted_wiki_content/`, `ppg-snippets/` and `How-To-Mod-In-People-Playground.md`. -Do whatever you want. +You are a People Playground modding expert. Create mods ONLY in new folders `mods//`. + +**Knowledge base:** `AGENTS.md`, `How-To-Mod-In-People-Playground.md`, `extracted_wiki_content/`, `ppg-snippets/`, `SledgeHammer/` + +**Workflow:** +1. Parse mod request (items, mechanics, effects) +2. Auto-search knowledge base for relevant examples & base mechanics +3. Use SledgeHammer/ to understand basic mod structure and context +4. Briefly explain implementation approach +5. Generate valid mod + - `README.txt` (user-friendly description for players) + - Create ComfyUI prompt for .png based on `CUSTOM-SETTINGS.md` ``` diff --git a/SledgeHammer/README.txt b/SledgeHammer/README.txt index b7a360e..15cda0d 100644 --- a/SledgeHammer/README.txt +++ b/SledgeHammer/README.txt @@ -1,25 +1,20 @@ SledgeHammer Mod ================ +A heavy sledgehammer that makes satisfying impact sounds when hitting things. -A basic example mod that introduces a classic sledgehammer weapon to People Playground. +How to use: +- Spawn it from the Melee category +- Swing it around and hit objects +- Hear the different impact sounds based on how hard you hit -Features --------- -• Simple, functional sledgehammer item -• Basic physics and collision detection -• Demonstrates core modding concepts -• Clean, minimal code structure +Features: +- Heavy weight for realistic physics +- Custom impact sound effects +- Cool sprite design -How to Use ----------- -1. Activate the mod in your mod list -2. Find the sledgehammer in the weapons category -3. Spawn it and start smashing! +Includes 3 sound effects: +- Light impacts +- Heavy impacts +- Spawn sound when created -Technical Details ------------------ -This mod serves as an educational example showing: -• Proper mod.json configuration -• Item registration with ModAPI -• Basic sprite loading and assignment -• Simple weapon implementation +Enjoy smashing things with style! \ No newline at end of file diff --git a/SledgeHammer/mod.json b/SledgeHammer/mod.json index 83a8c3e..bc871d9 100644 --- a/SledgeHammer/mod.json +++ b/SledgeHammer/mod.json @@ -7,7 +7,6 @@ "ThumbnailPath": "thumb.png", "EntryPoint": "Mod.Mod", "Tags": [ - "Fun", "Weapons", "Melee" ], diff --git a/SledgeHammer/script.cs b/SledgeHammer/script.cs index 3e4774c..23b27a1 100644 --- a/SledgeHammer/script.cs +++ b/SledgeHammer/script.cs @@ -24,16 +24,43 @@ namespace Mod NameOverride = "SledgeHammer", //new item name DescriptionOverride = "A heavy demolition sledgehammer.", //new item description CategoryOverride = ModAPI.FindCategory("Melee"), //new item category - ThumbnailOverride = ModAPI.LoadSprite("sledgeHammerView.png"), //new item thumbnail (relative path) + ThumbnailOverride = ModAPI.LoadSprite("sprites/sledgeHammerView.png"), //new item thumbnail (relative path) AfterSpawn = (Instance) => //all code in the AfterSpawn delegate will be executed when the item is spawned { - Instance.GetComponent().sprite = ModAPI.LoadSprite("sledgeHammer.png"); //get the SpriteRenderer and replace its sprite with a custom one + Instance.GetComponent().sprite = ModAPI.LoadSprite("sprites/sledgeHammer.png"); //get the SpriteRenderer and replace its sprite with a custom one var physical = Instance.GetComponent(); if (physical != null) { physical.InitialMass = 8f; //make it heavier for realistic sledgehammer feel physical.TrueInitialMass = 8f; //ensure the mass is actually applied + + // Add custom impact sounds for different collision types + physical.OverrideImpactSounds = new AudioClip[] + { + ModAPI.LoadSound("sfx/simple-hit.wav"), + ModAPI.LoadSound("sfx/hard-hit.wav") + }; + + // Add custom bullet impact sounds (when shot) + physical.OverrideShotSounds = new AudioClip[] + { + ModAPI.LoadSound("sfx/hard-hit.wav") + }; + } + + // Add a spawn sound when the hammer is created + var audioSource = Instance.GetComponent(); + if (audioSource == null) + { + audioSource = Instance.AddComponent(); + } + + // Play spawn sound + var spawnSound = ModAPI.LoadSound("sfx/spawn.wav"); + if (spawnSound != null && audioSource != null) + { + audioSource.PlayOneShot(spawnSound); } Instance.FixColliders(); //fix colliders to match new sprite diff --git a/SledgeHammer/sfx/hard-hit.wav b/SledgeHammer/sfx/hard-hit.wav new file mode 100644 index 0000000..26c1de7 Binary files /dev/null and b/SledgeHammer/sfx/hard-hit.wav differ diff --git a/SledgeHammer/sfx/simple-hit.wav b/SledgeHammer/sfx/simple-hit.wav new file mode 100644 index 0000000..55ffaad Binary files /dev/null and b/SledgeHammer/sfx/simple-hit.wav differ diff --git a/SledgeHammer/sfx/spawn.wav b/SledgeHammer/sfx/spawn.wav new file mode 100644 index 0000000..d3c41c9 Binary files /dev/null and b/SledgeHammer/sfx/spawn.wav differ diff --git a/SledgeHammer/sledgeHammer.png b/SledgeHammer/sprites/sledgeHammer.png similarity index 100% rename from SledgeHammer/sledgeHammer.png rename to SledgeHammer/sprites/sledgeHammer.png diff --git a/SledgeHammer/sledgeHammerView.png b/SledgeHammer/sprites/sledgeHammerView.png similarity index 100% rename from SledgeHammer/sledgeHammerView.png rename to SledgeHammer/sprites/sledgeHammerView.png diff --git a/mods/SledgeHammer-Enhanced/script.cs b/mods/SledgeHammer-Enhanced/script.cs index aa9792a..d2594a2 100644 --- a/mods/SledgeHammer-Enhanced/script.cs +++ b/mods/SledgeHammer-Enhanced/script.cs @@ -28,7 +28,7 @@ namespace Mod NameOverride = "Enhanced SledgeHammer", DescriptionOverride = "A massive demolition sledgehammer with devastating impact force and realistic physics.", CategoryOverride = ModAPI.FindCategory("Melee"), - ThumbnailOverride = ModAPI.LoadSprite("sledgeHammerView.png"), + ThumbnailOverride = ModAPI.LoadSprite("sprites/sledgeHammerView.png"), AfterSpawn = (Instance) => { try @@ -55,7 +55,7 @@ namespace Mod var spriteRenderer = Instance.GetComponent(); if (spriteRenderer != null) { - var customSprite = ModAPI.LoadSprite("sledgeHammer.png"); + var customSprite = ModAPI.LoadSprite("sprites/sledgeHammer.png"); if (customSprite != null) { spriteRenderer.sprite = customSprite; diff --git a/mods/SledgeHammer-Enhanced/sledgeHammer.png b/mods/SledgeHammer-Enhanced/sprites/sledgeHammer.png similarity index 100% rename from mods/SledgeHammer-Enhanced/sledgeHammer.png rename to mods/SledgeHammer-Enhanced/sprites/sledgeHammer.png diff --git a/mods/SledgeHammer-Enhanced/sledgeHammerView.png b/mods/SledgeHammer-Enhanced/sprites/sledgeHammerView.png similarity index 100% rename from mods/SledgeHammer-Enhanced/sledgeHammerView.png rename to mods/SledgeHammer-Enhanced/sprites/sledgeHammerView.png diff --git a/mods/ZombieCureSyringe/README.txt b/mods/ZombieCureSyringe/README.txt new file mode 100644 index 0000000..311ea5b --- /dev/null +++ b/mods/ZombieCureSyringe/README.txt @@ -0,0 +1,28 @@ +Zombie Cure Syringe Mod +======================= +A revolutionary medical breakthrough that can reverse zombie infections and restore humanity to the undead! + +How to use: +- Spawn the Zombie Cure Syringe from the Medical category +- Inject it into any zombie or infected person +- Watch as the infection is cured and humanity is restored +- The cure also provides healing effects to damaged limbs + +Features: +- Cures zombie infection completely +- Restores normal human appearance and behavior +- Provides continuous healing while active +- Prevents re-infection +- Creates a healing aura effect +- Custom green healing liquid with glowing effects + +The cure works by: +- Removing zombie poison from the bloodstream +- Restoring normal skin color and physical properties +- Healing zombie-related damage +- Preventing future infections +- Providing regenerative effects to all limbs + +Perfect for medical scenarios, zombie apocalypse survival, or bringing your undead friends back to life! + +Note: Works best when injected into the head or torso for maximum effect. \ No newline at end of file diff --git a/mods/ZombieCureSyringe/mod.json b/mods/ZombieCureSyringe/mod.json new file mode 100644 index 0000000..44c1367 --- /dev/null +++ b/mods/ZombieCureSyringe/mod.json @@ -0,0 +1,11 @@ +{ + "Name": "Zombie Cure Syringe", + "Author": "Nuclear.Lab", + "Description": "A special syringe that cures zombie infections and restores humanity to the undead.", + "ModVersion": "1.0", + "GameVersion": "1.27.5", + "ThumbnailPath": "thumb.png", + "EntryPoint": "Mod.Mod", + "Tags": ["Medical", "Biohazard", "Utility"], + "Scripts": ["script.cs"] +} diff --git a/mods/ZombieCureSyringe/script.cs b/mods/ZombieCureSyringe/script.cs new file mode 100644 index 0000000..b6339c0 --- /dev/null +++ b/mods/ZombieCureSyringe/script.cs @@ -0,0 +1,154 @@ +using UnityEngine; + +namespace Mod +{ + public class Mod + { + public static void Main() + { + // Register the cure liquid first + ModAPI.RegisterLiquid(ZombieCureSyringe.CureSerum.ID, new ZombieCureSyringe.CureSerum()); + + // Register the zombie cure syringe + ModAPI.Register( + new Modification() + { + OriginalItem = ModAPI.FindSpawnable("Zombie Syringe"), // Base it on zombie syringe + NameOverride = "Zombie Cure Syringe", + DescriptionOverride = "A revolutionary antidote that reverses zombie infection and restores humanity.", + CategoryOverride = ModAPI.FindCategory("Medical"), + ThumbnailOverride = ModAPI.LoadSprite("sprites/cure_syringe_view.png"), + AfterSpawn = (Instance) => + { + // Remove the original zombie syringe behavior + UnityEngine.Object.Destroy(Instance.GetComponent()); + + // Add our custom cure behavior + Instance.GetOrAddComponent(); + + // Customize the appearance + Instance.GetComponent().sprite = ModAPI.LoadSprite("sprites/cure_syringe.png"); + + // Add a healing glow effect + var glow = Instance.GetComponent(); + if (glow != null) + { + glow.color = new Color(0.3f, 1f, 0.3f, 0.8f); // Green healing glow + } + + // Add spawn sound effect + var audioSource = Instance.GetComponent(); + if (audioSource == null) + { + audioSource = Instance.AddComponent(); + } + + var spawnSound = ModAPI.LoadSound("sfx/cure_spawn.wav"); + if (spawnSound != null && audioSource != null) + { + audioSource.PlayOneShot(spawnSound); + } + + Instance.FixColliders(); + } + } + ); + } + } + + public class ZombieCureSyringe : SyringeBehaviour + { + public override string GetLiquidID() => CureSerum.ID; + + public class CureSerum : Liquid + { + public const string ID = "ZOMBIE CURE SERUM"; + + public CureSerum() + { + // Bright green color for the cure liquid + Color = new Color(0.2f, 1f, 0.2f, 0.9f); + } + + public override void OnEnterLimb(LimbBehaviour limb) + { + // Cure zombie infection by removing zombie-related effects + var person = limb.Person; + if (person != null) + { + // Remove zombie poison if present + var zombiePoison = person.GetComponent()?.GetLiquid("REANIMATION AGENT"); + if (zombiePoison != null) + { + person.GetComponent().RemoveLiquid(zombiePoison); + } + + // Restore human appearance and behavior + if (limb.gameObject.name.Contains("Head")) + { + // Restore normal skin color + var spriteRenderer = limb.GetComponent(); + if (spriteRenderer != null) + { + spriteRenderer.color = new Color(1f, 0.85f, 0.7f); // Normal skin tone + } + } + + // Heal any zombie-related damage + limb.WoundIntensity = 0f; + limb.BruiseIntensity = 0f; + limb.BurnIntensity = 0f; + + // Restore normal physical properties + limb.BreakingThreshold = limb.OriginalBreakingThreshold; + limb.RegenerationSpeed = limb.OriginalRegenerationSpeed; + } + + // Apply healing effect + limb.HealDamage(5f); + } + + public override void OnUpdate(BloodContainer container) + { + // Continuous healing effect while cure is in bloodstream + if (container is LimbBehaviour limb) + { + limb.HealDamage(0.1f); + + // Prevent re-infection + var zombiePoison = container.GetLiquid("REANIMATION AGENT"); + if (zombiePoison != null) + { + container.RemoveLiquid(zombiePoison); + } + } + } + + public override void OnEnterContainer(BloodContainer container) + { + // Healing aura effect + if (container is LimbBehaviour limb) + { + var person = limb.Person; + if (person != null) + { + // Apply gentle healing to all limbs + foreach (var personLimb in person.Limbs) + { + personLimb.HealDamage(0.5f); + } + } + } + } + + public override void OnExitContainer(BloodContainer container) + { + // Final healing burst when cure leaves the system + if (container is LimbBehaviour limb) + { + limb.HealDamage(2f); + } + } + } + } +} \ No newline at end of file diff --git a/mods/ZombieCureSyringe/sprites/cure_syringe.png b/mods/ZombieCureSyringe/sprites/cure_syringe.png new file mode 100644 index 0000000..9e68e9c Binary files /dev/null and b/mods/ZombieCureSyringe/sprites/cure_syringe.png differ diff --git a/mods/ZombieCureSyringe/sprites/cure_syringe_view.png b/mods/ZombieCureSyringe/sprites/cure_syringe_view.png new file mode 100644 index 0000000..9e68e9c Binary files /dev/null and b/mods/ZombieCureSyringe/sprites/cure_syringe_view.png differ diff --git a/mods/ZombieCureSyringe/thumb.png b/mods/ZombieCureSyringe/thumb.png new file mode 100644 index 0000000..7823db9 Binary files /dev/null and b/mods/ZombieCureSyringe/thumb.png differ