rpd:modding_quick_reference
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| rpd:modding_quick_reference [2025/12/25 18:23] – auto lint fix Mikhael | rpd:modding_quick_reference [2025/12/25 18:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Non-Java Modding Quick Reference ====== | ||
| + | This quick reference guide covers the most common modding tasks you can accomplish without Java coding in Remixed Dungeon. | ||
| + | |||
| + | ===== Common File Locations ===== | ||
| + | |||
| + | ==== For Mods ==== | ||
| + | * ''/ | ||
| + | * '' | ||
| + | |||
| + | ==== Important Files ==== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ===== Resource Overrides ===== | ||
| + | |||
| + | ==== Replace a Sprite ==== | ||
| + | 1. Find original sprite in game assets | ||
| + | |||
| + | 2. Create your new sprite in the same format/ | ||
| + | |||
| + | 3. Place in matching directory in your mod: | ||
| + | |||
| + | < | ||
| + | YourMod/ | ||
| + | └── sprites/ | ||
| + | └── items/ | ||
| + | └── weapon.png (replaces original weapon sprites) | ||
| + | </ | ||
| + | |||
| + | ==== Configure Custom Sprite Animations ==== | ||
| + | Sprites can be configured using JSON files in '' | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Replace Sound ==== | ||
| + | < | ||
| + | YourMod/ | ||
| + | └── sounds/ | ||
| + | └── your_sound.wav (use same filename as original) | ||
| + | </ | ||
| + | |||
| + | ==== Replace Music ==== | ||
| + | < | ||
| + | YourMod/ | ||
| + | └── music/ | ||
| + | └── your_track.ogg (use same filename as original) | ||
| + | </ | ||
| + | |||
| + | ===== JSON Configuration Changes ===== | ||
| + | |||
| + | ==== Change Item Stats ==== | ||
| + | Create '' | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Change Mob Stats ==== | ||
| + | Create '' | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Create Custom Mobs with JSON Configuration ==== | ||
| + | Mobs can be configured using JSON files in '' | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Add New Text ==== | ||
| + | Create '' | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Configure Mob Spawning ==== | ||
| + | Mobs can be configured to spawn in specific levels using '' | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Common Lua Functions ===== | ||
| + | |||
| + | ==== Damage Functions ==== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ==== Summoning Functions ==== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ==== Effect Functions ==== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ==== Information Functions ==== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ===== Simple Custom Item (Complete Example) ===== | ||
| + | |||
| + | ==== 1. Create the item JSON ==== | ||
| + | '' | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== 2. Create the Lua script ==== | ||
| + | '' | ||
| + | |||
| + | <code lua> | ||
| + | local RPD = require " | ||
| + | local item = require " | ||
| + | |||
| + | return item.init{ | ||
| + | desc = function() | ||
| + | return { | ||
| + | image = 25, | ||
| + | imageFile | ||
| + | name = "Ice Wand", | ||
| + | info = "A wand that shoots ice bolts. Freezes enemies temporarily.", | ||
| + | stackable | ||
| + | upgradable | ||
| + | isFlies | ||
| + | defaultAction = " | ||
| + | } | ||
| + | end, | ||
| + | |||
| + | actions = function() | ||
| + | return {RPD.Actions.ZAP} | ||
| + | end, | ||
| + | |||
| + | execute = function(self, | ||
| + | if action == RPD.Actions.ZAP then | ||
| + | -- Find mob at target location | ||
| + | local level = RPD.Dungeon.level() | ||
| + | local allMobs = level: | ||
| + | local target = nil | ||
| + | |||
| + | for i = 0, allMobs: | ||
| + | local mob = allMobs: | ||
| + | if mob: | ||
| + | target = mob | ||
| + | break | ||
| + | end | ||
| + | end | ||
| + | |||
| + | if target then | ||
| + | -- Deal damage | ||
| + | target: | ||
| + | -- Freeze for 3 turns - using paralysis as an example | ||
| + | RPD.affectBuff(target, | ||
| + | RPD.glog(" | ||
| + | -- Visual effect | ||
| + | RPD.topEffect(target: | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== 3. Add to your mod's version.json ==== | ||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Common Modding Patterns ===== | ||
| + | |||
| + | ==== Equipment with On-Equip Effects ==== | ||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | <code lua> | ||
| + | function M.equipEffect(item, | ||
| + | -- In practice, you would use different mechanics as properties may not work this way | ||
| + | RPD.glog(" | ||
| + | end | ||
| + | |||
| + | function M.unequipEffect(item, | ||
| + | RPD.glog(" | ||
| + | end | ||
| + | </ | ||
| + | |||
| + | ==== Mobs that Summon Others ==== | ||
| + | <code lua> | ||
| + | function M.onTurn(mob) | ||
| + | if math.random() < 0.1 then -- 10% chance per turn | ||
| + | local mobPos = mob: | ||
| + | local summonPos = nil | ||
| + | -- Find an empty adjacent cell | ||
| + | local level = RPD.Dungeon.level() | ||
| + | for direction = 0, 7 do | ||
| + | local adjCell = mobPos + RPD.PathFinder.CIRCLE8[direction + 1] | ||
| + | if level: | ||
| + | | ||
| + | | ||
| + | summonPos = adjCell | ||
| + | break | ||
| + | end | ||
| + | end | ||
| + | |||
| + | if summonPos then | ||
| + | local rat = RPD.spawnMob(" | ||
| + | RPD.glog(mob: | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | </ | ||
| + | |||
| + | ==== Mobs with Special Attack Effects ==== | ||
| + | Mobs can have special effects during attacks, similar to how SpiderElite applies the Vertigo debuff: | ||
| + | |||
| + | <code lua> | ||
| + | function M.attackProc(self, | ||
| + | -- 20% chance to apply Vertigo effect (disorientation) | ||
| + | if math.random() < 0.2 then | ||
| + | RPD.affectBuff(enemy, | ||
| + | end | ||
| + | end | ||
| + | </ | ||
| + | |||
| + | ==== Items that Change Terrain ==== | ||
| + | <code lua> | ||
| + | function M.useItem(item, | ||
| + | -- Change terrain at target location | ||
| + | local level = RPD.Dungeon.level() | ||
| + | level: | ||
| + | RPD.glog(" | ||
| + | end | ||
| + | </ | ||
| + | |||
| + | ===== Testing Checklist ===== | ||
| + | |||
| + | Before releasing your mod: | ||
| + | |||
| + | * [ ] Does '' | ||
| + | * [ ] Do all JSON files have valid syntax? (Use JSON validator) | ||
| + | * [ ] Are all file paths correct and matching original structure? | ||
| + | * [ ] Do all referenced sprites exist? | ||
| + | * [ ] Do Lua scripts have proper syntax? (Use Lua validator) | ||
| + | * [ ] Are new items/mobs appearing in-game? | ||
| + | * [ ] Do custom behaviors work as expected? | ||
| + | * [ ] Is balance appropriate compared to existing content? | ||
| + | |||
| + | ===== Troubleshooting Common Issues ===== | ||
| + | |||
| + | ==== Mod Not Loading ==== | ||
| + | * Check that '' | ||
| + | * Verify file permissions allow reading | ||
| + | * Make sure all JSON syntax is valid | ||
| + | |||
| + | ==== Lua Scripts Not Working ==== | ||
| + | * Check game log for Lua error messages | ||
| + | * Verify script path in JSON matches actual file location | ||
| + | * Validate Lua syntax with an online checker | ||
| + | |||
| + | ==== Items/Mobs Not Appearing ==== | ||
| + | * Make sure item/mob class in JSON matches an actual class | ||
| + | * Check that the item/mob is being placed somewhere (in bestiary, level, shop, etc.) | ||
| + | * Verify file paths and JSON syntax | ||
| + | |||
| + | This quick reference should help you tackle most non-Java modding tasks in Remixed Dungeon! | ||
rpd/modding_quick_reference.txt · Last modified: by 127.0.0.1
