Skip to content

About

Example mods for Kindle (Dark Souls III): small mods, each a different kind of change, used by Kindle's docs

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kindle example mods (Dark Souls III)

Twenty-four small mods, each a different kind of change: new items and shops, param tables, drops, pickups, enemies, event scripts, the player's behaviour, menus, the creation screen, text, game files, mods that use each other, and one for both games. Six of them (marked tour) are built step by step in Kindle's Mod tours. Each folder has a README covering what the mod changes, the permissions it needs, what it teaches, how it works line by line, how to try it, ideas for changing it, and what was checked in the game.

Game: every example here is for Dark Souls III only, except ex-kill-streak, which runs in both Dark Souls III and Elden Ring. Each README says so under its title, from the mod's games line in mod.toml. Elden Ring's examples come with Kindle's Elden Ring release.

They aren't installed with Kindle: copy the folder of one you want to try into Game\kindle\mods.

The examples

Status: verified means it was seen working in the game. partly means some of it was seen, and the README says which part. loaded means it started in the game without errors but wasn't used. not run means it hasn't been in the game.

Items, params and shops

Example What it does Teaches Status
ex-new-item-shop a new consumable with its own effect, sold with two others in a shop opened from the bonfire params.add_row, add_rows, rows pointing at rows, ui.shop, items.set_name verified
ex-param-tuning enemy HP and souls, weapon and armour weight, scaled by settings walking a whole table, int and float fields, undo and re-apply verified
ex-random-drops a chance that an enemy drops something from a weighted pool instead the item_lot event, making ItemLotParam rows, lot chains, pickup flags partly
ex-new-weapon (tour 4) a new longsword made from the Long Sword, with its own numbers and text, given once params.add_row by item name, a weapon's fields, items.weapon, item text not run
ex-pickup-shuffle (tour 5) the world's one-time pickups trade places, from a seed walking a table, ItemLotParam's slots and flags, a seeded shuffle, params.copy with a field kept not run

Enemies and the world

Example What it does Teaches Status
ex-enemy-swap the High Wall's hollow soldiers become knights from other areas maps.parts, maps.edit (replace_enemy), map_loading, maps.preload not run
ex-spawner summons an enemy from a bonfire menu, with a bounty for killing it world.spawn with on_spawn, character_killed, handles partly
ex-difficulty damage taken and dealt, scaled by settings settings of every kind, setting_changed, the damage event loaded
ex-hard-mode (tour 1) harder hits, capped Estus, no sprinting, deaths on screen, each a setting a cap kept by a timer, an hks block that follows a setting, the store not run

Event scripts

Example What it does Teaches Status
ex-event-scripts a gift event added to Firelink, a reward changed, a banner, an area title and a message on demand events.run and named commands, events.add, start, edit with is, view, flags partly

The player

Example What it does Teaches Status
ex-hks-movement no sprinting; falls that don't kill hks.on_act (block an action), hks.on_env (change an answer) not run
ex-character-start rows on the creation screen choosing a starting kit, and a motto ui.character_rows, character_choices, a done-once mark loaded
ex-practice-tool (tour 3) save a spot with the enemies near it and go back; no damage and endless stamina switches the player's state, world.characters, entity ids, input.held, cleanup on unload not run

Menus and screens

Example What it does Teaches Status
ex-bonfire-travel a travel menu by area, a random bonfire, levelling up from the menu menus in menus, world.bonfires, player.warp, ui.open partly
ex-run-stats kills, deaths, bosses and levels counted per character, shown in a tab of the Mods screen game events, kindle.store, ui.mod_tab, ui.toast loaded
ex-run-timer (tour 2) a speedrun clock with splits at bosses and bonfires, against your best play time as a clock, the global store, a tab rebuilt as things change not run
ex-mod-screen a menu of the mod's own with a switch, a choice, a slider, typed text, a sub-screen, a pick from a list and Reset, from the bonfire menu ui.screen, rows of every kind, on_change, sub-screens, screen:update, ui.choose, ui.confirm verified
ex-hud the souls held in a corner, and health bars over nearby enemies ui.layer, the canvas, at and range in the world, a layer set on a timer partly
ex-pictures a framed card with the boss's name as a fight starts, and a screen of the bosses met with icons pictures in a layer, icon on screen rows, boss_bar parts checked

Text and files

Example What it does Teaches Status
ex-text-pack renames a place, an NPC and an item item text by name, any text by category and id, pcall verified
ex-swap-lighting one map's lighting file served in place of another's a mod of files only, files\ paths, Copy into Mod not run

Mods that use each other

Example What it does Teaches Status
ex-shared-lib functions for other mods: number formatting, rolls, counters with milestones kindle.export, kindle.send, the global store loaded
ex-shared-lib-user uses them: counts kills, pays bounties, shows milestones depends, kindle.mods.get, kindle.on_message loaded

Both games

Example What it does Teaches Status
ex-kill-streak (tour 6) kills in a row without dying, paid in souls (DS3) or runes (ER) at every step games = ["ds3", "er"], what the APIs share, telling the games apart, checking against both kindle check both ways; not run

An order to read them in

  1. ex-text-pack: the smallest. A mod is mod.toml and main.lua, and calls fail with messages.
  2. ex-param-tuning: params, the game's tables of numbers, and settings.
  3. ex-new-item-shop: new rows, and rows that point at rows. Most content mods work this way.
  4. ex-run-stats: events, the store and a screen of the mod's own.
  5. ex-bonfire-travel: menus.
  6. ex-random-drops: an event that changes what the game does as it happens.
  7. ex-event-scripts: the game's own event scripts, run, added and edited.
  8. ex-enemy-swap and ex-spawner: enemies, from the map file and live.
  9. ex-hks-movement: the player's behaviour and input.
  10. The rest as needed.

Or follow the Mod tours, which build ex-hard-mode, ex-run-timer, ex-practice-tool, ex-new-weapon, ex-pickup-shuffle and ex-kill-streak a step at a time and say at each step what the other ways were. Ways to do it lists, for each common goal, every way Kindle offers. When a mod goes wrong lists the messages.

Starting a mod from an example

  1. Copy the example's folder and rename it. The folder name is the mod's id: lowercase letters, digits and hyphens.
  2. In mod.toml, set id to the folder name, then name and description. Keep api = 1 and games = ["ds3"].
  3. List only the permissions the code uses. kindle-cli check warns about one that's listed and not used, and errors on one used and not listed. Events, settings and the store need no permission.
  4. Pick ids that no one else uses:
    • Param rows: above every id the table has. params.add_row refuses lower ones. Space them out (ex-random-drops uses steps of 10) when the game reads rows after the one you name.
    • Event flags: from a range the game doesn't use. The DS3 VS Code extension shows which flags a map's events use; ex-event-scripts uses 14000998.
    • Events: an id no event in that map has (kindle.events.view(map, id) returns nil for a free one).
    • Text: an id no entry has (kindle.text.get(category, id) returns nil).
  5. Check it: kindle-cli check <folder>. It catches syntax errors, unknown API names, wrong argument types and permission mismatches.
  6. Install it: copy the folder into the game's kindle\mods. A new mod is on; the game's Mods entry turns mods on and off and opens their settings.
  7. Edit and save while the game runs: Kindle reloads the mod.
  8. Read kindle\logs\kindle.log when something doesn't happen. Every mod's kindle.log.info lines and errors are there under its id.

Name things in full (character, bonfire, count), not c, b, n.

What the tests turned up

These come from running the examples in the game. Each catches people out the first time.

  • New param rows last until the game closes. A mod that unloads takes its field changes back, but rows it added stay until the game closes. Their ids must be above every existing row's.
  • An item lot's "no flag" is -1. That's getItemFlagId's value for a lot that can drop again. A real flag makes it a one-time pickup.
  • Enemy drops are chains. An NpcParam row names its first lot (ItemLotId1), and the game also rolls the rows straight after it, up to the first missing id. A lot you make for drops needs a gap after it, or it rolls your next row too.
  • Backing out of a ui.menu sub-menu at a bonfire stands the character up. It should return to the bonfire's menu. Entries that open a screen (a shop, levelling up) return properly.
  • status_message(text, 1) waits for a button, so the message stays until the player presses one. With 0 it fades on its own.
  • Use is with events.edit. It names the command you expect at that line, and the edit is refused if the game's script is different. Without it an edit can land on the wrong command.
  • Watching a flag the game sets during a load: the watch can fire before anything is on screen, so a toast from it may not be seen.
  • The store is per character. store.get and set keep values with the character's save, and get_global / set_global keep them for the mod across characters.
  • The bonfire menu's title isn't the place name. Renaming PlaceName 2000 changes the area banner ("Shrine of the Kindled") but not the title of the bonfire's menu.
  • SFX spawned on the player at Firelink showed nothing (ids 30300, 652120, 1060, 84), though the command reported done. The cause wasn't found.

Ideas, and where to start

Each line is a mod someone could make, the API that does it, and the example closest to it. None of these exist yet.

Items and economy

Idea How Start from
A wandering merchant at a bonfire, stock changing each rest ShopLineupParam rows, bonfire_rested, ui.shop(first, last) over a different range each time ex-new-item-shop
A consumable that grants a temporary buff an EquipParamGoods row pointing at a new SpEffectParam row ex-new-item-shop
Weapon rebalance pack EquipParamWeapon fields multiplied or set per weapon ex-param-tuning
Rename and redescribe items for a lore pass items.set_name, items.set_description ex-text-pack
Starting classes of your own creation-screen rows, player.set_stats, items.give ex-character-start
Souls tax: lose a share of held souls on each rest bonfire_rested, player.souls, player.set_souls ex-run-stats
Price of a shop item rising with every purchase shop_buy, the row's value field ex-new-item-shop

Enemies and challenge

Idea How Start from
Enemy randomizer by area maps.edit with replace_enemy from other maps' parts, in map_loading ex-enemy-swap
Horde mode: waves summoned at a bonfire world.spawn, world.load_ai, character_killed, kindle.after ex-spawner
Harder with each NG cycle NpcParam fields scaled by player.ng_cycle() ex-param-tuning
Drop randomizer the item_lot event and a pool of lots ex-random-drops
Glass cannon: double damage both ways the damage event, e.attack_power ex-difficulty
Enemies that stay dead until the next rest character_killed, entity ids kept in the store, events.set_enabled on load (untried) ex-run-stats
No-Estus run player.set_estus(0, 0) on a timer, as ex-hard-mode caps them (its cap set to 0). item_used can't block it: its return false keeps the item, but the drink still heals ex-hard-mode
Pickups of every kind shuffled: weapons, armour, rings the categories 0, 0x10000000 and 0x20000000 allowed too ex-pickup-shuffle
A boss that hits harder each time it kills you player_died, the boss's NpcParam row or a damage hook on its attacks, a count in the store ex-hard-mode

Movement and the player

Idea How Start from
No rolling, no sprinting, no jumping hks.on_act blocking the actions ex-hks-movement
Practice tool for a boss: its phase kept too ex-practice-tool's spots, plus the boss's HP and the flags its phases set ex-practice-tool
Training dummy: an enemy that never dies and shows the damage of each hit world.spawn, the damage hook reading e.attack_power and then world.set_hp back to full, ui.status ex-spawner
Slow-motion button input.held, player.set_animation_speed and world.set_animation_speed ex-practice-tool (animation speed)
Level cap: refuse levels past a number the level_up event, player.set_soul_level (untried) ex-run-stats

Event scripts and the world

Idea How Start from
A gift the first time a character reaches an area events.add with Award Item Lot and a flag, or region_changed with a flag ex-event-scripts
Change a boss reward events.find for the award, events.edit with is ex-event-scripts
Boss rush: warp to the next boss after each kill boss_defeated, player.warp, a list of bonfires ex-bonfire-travel
Area titles and banners of your own text.set on PlaceName, events.run DisplayBanner ex-event-scripts
A message when the player first picks something up item_gained, status_message, a store mark ex-event-scripts

Screens, info and tools

Idea How Start from
Splits on a route of your own: flags, items, areas flags.on_set, item_gained, region_changed feeding ex-run-timer's split ex-run-timer
A mod for both games: a death counter or a souls/runes bank the shared API, kindle.player["runes"] to tell the games apart ex-kill-streak
Bonfire utility menu: repair, level up, warp ui.add_menu_option, ui.open, player.warp ex-bonfire-travel
Achievements: toasts for goals, kept per character game events, the store, ui.toast ex-run-stats
A helper library other mods use kindle.export, depends, kindle.mods.get ex-shared-lib
A seed shared between mods one mod picks it, kindle.send, the others' on_message ex-shared-lib

Files

Idea How Start from
Lighting or fog pack draw params (.gparam.dcx) in files\param\drawparam\ ex-swap-lighting
Retextures or sounds the game's archive paths under files\; no Lua ex-swap-lighting
A full translation FMG text through text.set, or the text files under files\msg\ ex-text-pack

The co-op mod is the largest mod built on Kindle. It uses net, game (the catalogue) and nearly every other module, and is worth reading once the examples make sense.

About

Example mods for Kindle (Dark Souls III): small mods, each a different kind of change, used by Kindle's docs

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages