Data files

Every file a mod ships: talk.json, shops.json, letters.json, calendar.json, items.json, the messages file, textures and the script. Each field, limit and error.

A mod names its data files in mod.json: the scripts under scripts, every other file under content. Each path is inside the mod, and you choose the file's name. The names below are the usual ones. A JSON file may start with a "$schema" key that names its schema, so an editor checks it as you type. A messages file cannot, because its keys are its lines.

Index #

Filemod.json keyWhat it is for
shops.jsoncontent.shopsChanges shops, each by its id: "nook", "flower", "redd" and the rest of the shop table.
messages filecontent.messagesLines a script or another mod can use, by key.
textures foldercontent.texturesA folder of replacement textures, named the way Dolphin names a custom texture.
main.luascripts.mainLua 5.4 source text, run once when the game starts.
items.jsoncontent.itemsNew furniture, each on a vanilla base piece.
mod-items.json (the game's)none, the game writes it/save/card_a/mod-items.json.
letters.jsoncontent.lettersLetter templates that a mod command (send_letter) mails through the mailbox, named "<mod id>:<letter id>".
calendar.jsoncontent.calendarCalendar days: dated days with safe effects only, and no script.
talk.jsoncontent.talkVillager lines placed in a villager's talk.

shops.jsonsince 1  #

Named by content.shops in mod.json. A json file. Schema: shops.schema.json.

How the game uses shops.json #

Changes shops, each by its id: "nook", "flower", "redd" and the rest of the shop table. A shop takes one block, or a list of blocks. A block says what changes (goods, open, own_goods, prices, services, name, lines) and, with "when", when. Every field means the same on every shop. The shop table says which fields each shop has; a field a shop does not have is left out and the mod's row says so (rule shop_fields). While a block applies its goods join the shop's own, in at most half the spots of their kind (rounded up), or with "own_goods": false they are the whole stock. When several blocks apply at once their goods are sold together, and for a single value the last of them counts. The game itself, not the page or the mod list, refuses goods with no shelf model, money, turnips, tickets, grab bags, fossils and reserve ids, and raises a price below the item's buy-back to the buy-back. items.json lists what may be stocked. A good may be an item of the same mod, by its full id, at Nook's and the flower shop. Without a price a good takes the shop's own price. Shops are off in The City. When two switched-on mods change the same shop, the one later in the load order has that shop whole and the other's change to it is not used (rule load_order_last_wins). The earlier mod's row says so.

shops.json fields #

FieldValueMeaning
shops requiredobjectThe shops this file changes, by id. Each takes one block or a list of blocks.
shops.nook optionala block or list, 1 to 8 entriesNook's store: open, own_goods, goods, price_percent, buy_back_percent, at most 16 goods in a block.
shops.flower optionala block or list, 1 to 8 entriesThe flower shop: open, own_goods, goods, price_percent, name, lines, at most 6 goods in a block. Line slots: greeting, stock.
shops.redd optionala block or list, 1 to 8 entriesCrazy Redd: own_goods, goods, price_percent, at most 6 goods in a block.
shops.saharah optionala block or list, 1 to 8 entriesSaharah: own_goods, goods, price_percent, at most 6 goods in a block.
shops.fireworks optionala block or list, 1 to 8 entriesThe fireworks stall: own_goods, goods, price_percent, at most 6 goods in a block.
shops.able optionala block or list, 1 to 8 entriesAble Sisters: services. Services: design.
shops.barber optionala block or list, 1 to 8 entriesThe barber shop: open, services. Services: haircut.
shops.dream optionala block or list, 1 to 8 entriesThe Dream Suite: services. Services: dream.
shops.katrina optionala block or list, 1 to 8 entriesKatrina: services. Services: fortune.
block.when optionala whenWhen the block or the good applies: while every key here holds. Leave it out for always.
block.open optionalbooleantrue: the shop is open while the block applies, also when its own hours have it shut. false: it is shut while the block applies. Leave it out for the shop's own hours.
block.own_goods optionalbooleanfalse: while the block applies the shop sells only the goods of the blocks that apply, and every spot of a kind they do not list is bare. true (the default): the goods join the shop's own, in at most half the spots of their kind, rounded up.
block.goods optionallist, 1 to 16 entriesThe goods. Each stands in a spot of its own kind. The shop table gives each shop's most goods in a block.
block.goods[].item requiredstring, matching ^0x[0-9a-fA-F]{4}$ or matching ^([a-z0-9][a-z0-9-]{0,31}\.[a-z0-9][a-z0-9-]{0,47}):([a-z0-9][a-z0-9-]{0,31})$The item id as a string, "0x" and 4 hex digits, or the full id of an item in this mod's items file (author.mod:thing), at Nook's and the flower shop. Each item is listed at most once in a block. Two mod items may not share a base.
block.goods[].price optionalinteger, 1 to 99999The price in Bells. Leave it out for the shop's own price.
block.goods[].when optionala whenWhen the block or the good applies: while every key here holds. Leave it out for always.
block.price_percent optionalinteger, 1 to 1000While the block applies the shop asks this percent of its own price for every good with no price of its own. 100 is the game's price. Never below the buy-back.
block.buy_back_percent optionalinteger, 1 to 1000While the block applies the shop pays this percent of what it would pay for what the player sells, never more than it asks for the item. Not turnips.
block.services optionalobjectA service's price in Bells, by the service's name in the shop table (a haircut, a design, a dream, a fortune).
block.services.<key> optionalinteger, 1 to 99999The service's price in Bells, 1 to 99999.
block.name optionalstring, 1 to 40 characters, matching ^[^\n]*$The shop's name where the game shows it: the flower shop's door sign while the shop is shut. One line.
block.lines optionalobjectWhat the keeper says, by slot (the shop table lists each shop's). A slot is one line, or a list of 1 to 8 the keeper picks from each time.
block.lines.<key> optionalstring, 1 to 160 characters or list, 1 to 8 entriesOne line, or a list of 1 to 8 lines the keeper picks from.
when.hours optionalobjectHH:MM to HH:MM. From and to must differ.
when.hours.from requiredstring, matching ^([01][0-9]|2[0-3]):[0-5][0-9]$From this time, on a 24-hour clock.
when.hours.to requiredstring, matching ^([01][0-9]|2[0-3]):[0-5][0-9]$Up to this time, on a 24-hour clock. It may be past midnight.
when.time optionalone of "morning", "day", "evening", "night"The game's four times of day: morning 5 to 12, day 12 to 17, evening 17 to midnight, night midnight to 5.
when.season optionalone of "spring", "summer", "fall", "winter"Spring is March to May, summer June to August, fall September to November, winter December to February.
when.weather optionalone of "clear", "rain", "snow"Cherry blossom and falling leaves count as clear.
when.weekday optionallist, 1 to 7 entriesOnly on these days of the week.
when.weekday[] requiredone of "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"A day of the week, monday to sunday, in lowercase.
when.month optionallist, 1 to 12 entriesOnly in these months, 1 (January) to 12.
when.month[] requiredinteger, 1 to 12A month, 1 (January) to 12.
when.setting optionalstring, matching ^[a-z][a-z0-9_]{0,31}$The name of one of this mod's settings of type bool with scope world. Holds while it is on.

shops.json: the shop table #

Every shop takes the same block under its id, and each field means the same on every shop. A field a shop does not have is left out, and the mod's row in the Mods tab says so (rule shop_fields).

Shop idwhenopenown_goodsgoodsprice_percentbuy_back_percentservicesnamelinesGoods in a blockServicesLine slots
"nook", Nook's storeyesyesyesyesyesyesnonono1 to 16nonenone
"flower", the flower shopyesyesyesyesyesnonoyesyes1 to 6nonegreeting, stock
"redd", Crazy Redd's tentyesnoyesyesyesnononono1 to 6nonenone
"saharah", Saharahyesnoyesyesyesnononono1 to 6nonenone
"fireworks", the fireworks stallyesnoyesyesyesnononono1 to 6nonenone
"able", Able Sistersyesnononononoyesnonononedesignnone
"barber", the barber shopyesyesnonononoyesnonononehaircutnone
"dream", the Dream Suiteyesnononononoyesnonononedreamnone
"katrina", Katrina's tentyesnononononoyesnonononefortunenone

shops.json limits #

  • shops.blocks, 8 blocks: The most blocks in the list one shop takes in shops.json.
  • shops.stock, 6 goods: The most goods in one block for the flower shop: one per bench spot.
  • nook.stock, 16 goods: The most goods in one block for Nook's store.
  • visitors.stock, 6 goods: The most goods in one block for a visiting seller (Crazy Redd, Saharah, the fireworks stall).
  • shops.lines, 8 lines: The most lines in one slot of a block's "lines". The keeper says one of them each time.
  • shops.name_chars, 40 characters: The longest shop name (the flower shop's door sign), in Unicode code points.
  • shops.line_chars, 160 characters: The longest shop line (a slot of "lines"), in Unicode code points.
  • shops.line_newlines, 3 newlines: The most line breaks in one shop line.
  • shops.price_max, 99,999 Bells: The highest price a mod shop may ask. The game raises a price below its own buy-back to the buy-back. The buy-back is what Nook pays for the item.
  • shops.percent_max, 1,000 percent: The highest price_percent or buy_back_percent.
  • file.json_bytes, 256 KB: The largest .json file other than mod.json.
  • json.depth, 32 levels: How deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.

shops.json example #

shops.json
{
  "shops": {
    "flower": {
      "when": {
        "hours": {
          "from": "15:00",
          "to": "01:00"
        }
      },
      "open": true,
      "own_goods": false,
      "name": "Tea Stall",
      "lines": {
        "greeting": "Welcome to the tea stall!"
      },
      "goods": [
        {
          "item": "0x2800",
          "price": 400
        }
      ]
    }
  }
}

Errors shops.json can raise #

Each one, with the message you see and the fix, is in the errors list under shops.json. Any JSON file can also meet the ones under JSON files.

Guide to shops.json #

messages filesince 1  #

Named by content.messages in mod.json. A json file. Schema: messages.schema.json.

How the game uses messages file #

Lines a script or another mod can use, by key. A script reads its own with message("key") and another mod's with message("author.mod:key"). This file cannot carry a $schema key, because every key is a line. Point your editor at messages.schema.json in its settings instead.

messages file fields #

FieldValueMeaning
<key> optionalstring, at least 1 character; the key matching ^[a-z0-9_.-]{1,48}$1 to 400 UTF-8 bytes. Lines wrap by width, not by a count of characters. A row holds 180 pixels of the game's font, which is about 24 letters. Narrow letters like i and l take less room, and wide ones like W and m take more. A page holds 4 rows.

messages file limits #

  • messages.lines, 256 lines: The most lines in one mod's messages file.
  • messages.key_bytes, 48 bytes: The longest line key.
  • messages.text_bytes, 400 bytes: The longest line, in UTF-8 bytes. Lines wrap by width, not by a count of characters. A row holds 180 pixels of the game's font, which is about 24 letters. Narrow letters like i and l take less room, and wide ones like W and m take more. A page holds 4 rows.
  • file.json_bytes, 256 KB: The largest .json file other than mod.json.
  • json.depth, 32 levels: How deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.

messages file example #

messages file
{
  "gossip1": "Did you hear? The museum got a new fossil!"
}

Errors messages file can raise #

Each one, with the message you see and the fix, is in the errors list under Messages files. Any JSON file can also meet the ones under JSON files.

Guide to messages file #

textures foldersince 1  #

Named by content.textures in mod.json. A folder.

How the game uses textures folder #

A folder of replacement textures, named the way Dolphin names a custom texture. A mod's texture beats the HD pack. Among mods, the one lower in the list wins. The exception is that a file for one exact palette beats any mod's "$" (every palette) file for the same texture (rule load_order_last_wins). All mods' DDS textures together may take 96 MB on the graphics card, or 24 MB on a phone. Their PNGs may take 96 MB of pixels, or 24 MB on a phone. A texture past its limit is left out and named on its mod's row. A mod's texture is read a little each frame after it is first drawn, so the game's own texture shows for a moment before it. Find a texture's name in the model viewer (/viewer/).

textures folder: file names #

  • tex1_<w>x<h>_<data>_<fmt>.dds: A texture without a palette.
  • tex1_<w>x<h>_<data>_<tlut>_<fmt>.dds: A palette (C4, C8) texture. <tlut> is the palette's hash.
  • tex1_<w>x<h>_<data>_$_<fmt>.dds: A palette texture under any palette.
  • tex1_<w>x<h>_<data>[_<tlut>|_$]_<fmt>.png: The same names as a PNG, with any case of .png. A PNG is decoded once at load and is at most 2048 a side. A DDS of the same name in the same mod is the same texture, and the first one scanned wins.
  • <label>_tex1_<w>x<h>_<data>[_<tlut>|_$]_<fmt>.dds: Any of these names with a label in front, so you can tell your files apart, as in bookshelf-top_tex1_32x32_626709d910129694_$_8.png. The label is 1 to 40 lowercase letters, digits and dashes, then one underscore. The game matches on the tex1_ part only. A file whose label breaks that rule is refused. Two files in one folder that are the same texture once the labels are taken off are refused when either one has a label. An item's own textures folder reads labels the same way.

Image formats. DDS: BC7, BC1/DXT1, BC3/DXT5 (legacy FourCC or DX10), DX10 R8G8B8A8 or B8G8R8A8, or legacy uncompressed 32 bits a pixel. 1 to 16384 a side. Level 0 only, no stored mipmaps. PNG: grey, RGB, palette, grey with alpha or RGBA, 1 to 16 bits, interlaced or not, tRNS. At most 2048 a side.

textures folder limits #

  • textures.label_chars, 40 characters: The longest label before a texture name in a mod, as in bookshelf-top_tex1_32x32_626709d910129694_$_8.png. A label is lowercase letters, digits and dashes, then one underscore.
  • textures.png_side, 2,048 pixels: The longest side of a PNG texture.
  • textures.png_decoded_bytes, 96 MB: Decoded pixels of every mod's PNG textures together, on a computer. A PNG past it is left out and named on its mod's row.
  • textures.png_decoded_bytes_phone, 24 MB: The same on a phone or low-memory device.
  • textures.dds_bytes, 96 MB: Image bytes of every mod's DDS textures together on a computer, as the graphics card holds them. Only the first mip level counts: 1 byte a pixel for BC7 and DXT5, half a byte for DXT1 and 4 bytes uncompressed. A DDS past the limit is left out and named on its mod's row. The HD pack does not count.
  • textures.dds_bytes_phone, 24 MB: The same on a phone or low-memory device.

textures folder example #

textures folder
textures/tex1_32x32_8b5a1b4a83d4d7c7_14.dds

Errors textures folder can raise #

Each one, with the message you see and the fix, is in the errors list under Textures and images.

Guide to textures folder #

main.luasince 1  #

Named by scripts.main in mod.json. A lua file.

How the game uses main.lua #

Lua 5.4 source text, run once when the game starts. Bytecode is refused. The script registers handlers with on() and returns nothing. Each mod has its own Lua state, and mods cannot see each other's globals.

main.lua limits #

  • file.lua_bytes, 512 KB: The largest .lua file.
  • lua.memory_bytes, 4 MB: Memory one mod's script may use. Over it, the script stops for the session.
  • lua.budget, 200,000 instructions: Instructions one mod may run per event, counting all its handlers for that event together. The main chunk gets its own count. Library work is charged too: every 64 bytes allocated, every 4 pattern-matching steps and every element a table function touches. An allocation the memory limit refuses is charged too: one instruction for every 64 bytes the script holds. Over the limit, the script stops for the session.
  • lua.deadline_ms, 250 milliseconds: Wall-clock backstop on a script's main chunk, for time the instruction count cannot see: one long call into C, or a garbage collection. The instruction budget is what stops a main chunk that does too much. On a slow device it is stretched by the device's pace (lua.pace_frame_ms).
  • lua.event_deadline_ms, 125 milliseconds: Wall-clock backstop on one event run, for time the instruction count cannot see: one long call into C, or a garbage collection. The instruction budget is what stops an event run that does too much, and it counts the same on every device. On a slow device it is stretched by the device's pace (lua.pace_frame_ms). A busy device does not stop a mod that stays inside its budget.
  • lua.handlers_per_event, 16 handlers: The most handlers one mod may register for one event.

main.lua example #

main.lua
on("villager_talked", function(e) return { place = "before", line = "Hi " .. e.villager.name .. "!" } end)

Errors main.lua can raise #

Each one, with the message you see and the fix, is in the errors list under scripts in mod.json and Script stopped.

Guide to main.lua #

items.jsonsince 1  #

Named by content.items in mod.json. A json file. Schema: mod-items.schema.json.

How the game uses items.json #

New furniture, each on a vanilla base piece. The game also refuses a base with no model, fossils, gyroids, clothing, design pieces and pieces a player carries as an item: umbrellas, fish, bugs, tools, balloons, fans, pinwheels and diaries. In the save, a mod item is its base piece. A file beside the save (mod-items.json) maps it back. Removing the mod therefore leaves the base piece behind, and reinstalling restores the mod item. That file belongs to the save it was written beside. Next to another save of the same town, such as a backup put back or an older town file imported, it is not used. Those pieces are then plain base pieces again. An item may carry its own pictures ("textures"). They replace the base piece's textures on that item alone, in a house and on Nook's floor. On the flower shop's bench a furniture good is a leaf. Every other copy of the base keeps its look.

items.json fields #

FieldValueMeaning
items requiredlist, 1 to 64 entriesThe new items. Each one stands on a base piece of the game's own furniture.
items[].id requiredstring, matching ^[a-z0-9][a-z0-9-]{0,31}$The item's own id. Its full id is <mod id>:<id>.
items[].name requiredstring, matching ^[A-Za-z0-9](?:[A-Za-z0-9 '.,!&-]{0,14}[A-Za-z0-9'.,!&-])?$1 to 16 characters: letters, digits, space and ' . , ! & -. It starts with a letter or digit and does not end with a space.
items[].base requiredstring, matching ^0x[0-9a-fA-F]{4}$A south-facing furniture id: 0x1000 to 0x1FFC or 0x3000 to 0x33C4, a multiple of 4.
items[].price optionalinteger, 1 to 99999The price in Bells. Leave it out for the base piece's price.
items[].textures optionalstring, at least 1 characterA folder inside the mod with this item's own pictures: 1 to 16 .png or .dds files named like a texture mod's files, with the base piece's texture names. Only this item draws them. The folder may not be inside content.textures or hold it.

items.json limits #

  • items.per_mod, 64 items: Items in one mod's items file.
  • items.total, 512 items: Mod items across every switched-on mod.
  • items.price_max, 99,999 Bells: The highest price an item in a mod's items file may have.
  • items.renames, 64 renames: Entries in one mod.json "renames".
  • items.texture_files, 16 files: Pictures in one mod item's own textures folder (its "textures" setting), counting the files in its subfolders.
  • file.json_bytes, 256 KB: The largest .json file other than mod.json.
  • json.depth, 32 levels: How deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.

items.json example #

items.json
{
  "items": [
    {
      "id": "cup",
      "name": "Tea cup",
      "base": "0x1000",
      "price": 800,
      "textures": "items/cup/"
    }
  ]
}

Errors items.json can raise #

Each one, with the message you see and the fix, is in the errors list under New items. Any JSON file can also meet the ones under JSON files.

Guide to items.json #

mod-items.json (the game's)since 1  #

Written by the game, never by a mod. A json file.

How the game uses mod-items.json (the game's) #

/save/card_a/mod-items.json. The game writes it beside the home save, and a mod never reads or writes it. It records which placed or carried base pieces are which mod item, and which renames have run. It rides in the cloud save and in a friend visit's town copy.

Guide to mod-items.json (the game's) #

letters.jsonsince 1  #

Named by content.letters in mod.json. A json file. Schema: letters.schema.json.

How the game uses letters.json #

Letter templates that a mod command (send_letter) mails through the mailbox, named "<mod id>:<letter id>". The game wraps the body at the paper's width in its own font and refuses one that needs more than 6 lines. It also refuses a present that is money, turnips, a ticket, a grab bag, a fossil or not an item. Either scope.

letters.json fields #

FieldValueMeaning
letters requiredlist, 1 to 32 entriesThe letter templates. A script mails one with cmd.send_letter, and a calendar day can name one.
letters[].id requiredstring, matching ^[a-z0-9_.-]{1,48}$Unique in the file.
letters[].header requiredstring, 1 to 32 characters1 to 24 characters besides at most one {player}, where the name goes. No line break. Plain text: printable ASCII, no { or }.
letters[].body requiredstring, 1 to 192 characters1 to 192 characters on at most 6 lines. Plain text: printable ASCII, no { or }.
letters[].footer requiredstring, 1 to 32 charactersThe sign-off at the foot of the letter, 1 to 32 characters. Plain text: printable ASCII, no { or }. The mailbox list shows only its first 8 characters unless the letter has a sender.
letters[].sender optionalstring, 1 to 8 charactersOptional. The name in the mailbox list, 1 to 8 characters, which is all the list has room for. Without it the list shows the footer's first 8 characters, so "The Lantern Keepers" reads "The Lant". The letter itself always signs with the whole footer. Plain text: printable ASCII, no { or }.
letters[].item optionalstring, matching ^0x[0-9a-fA-F]{4}$A present, optional.
letters[].paper optionalinteger, 0 to 63The stationery, default 0.

letters.json limits #

  • letters.per_file, 32 letters: Letters in one letters file.
  • letters.header_chars, 24 characters: A letter header, not counting {player}.
  • letters.body_chars, 192 characters: A letter body or a board notice.
  • letters.body_lines, 6 lines: Lines on the letter paper or a board page.
  • letters.footer_chars, 32 characters: A letter footer.
  • letters.sender_chars, 8 characters: A letter's name in the mailbox list. It is the letter's optional sender. Without a sender, it is the footer's first 8 characters.
  • commands.papers, 64 papers: Letter papers, numbered 0 to 63.
  • commands.letters_per_day, 3 commands: send_letter per mod per game day in each town. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule. A command counts when the game applies it, and the count is kept across a reload. A command lost with a closed tab before then never counts. The limit check adds the commands still waiting. A command refused for where the player is (The City, a visit) does not count.
  • file.json_bytes, 256 KB: The largest .json file other than mod.json.
  • json.depth, 32 levels: How deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.

letters.json example #

letters.json
{
  "letters": [
    {
      "id": "thanks",
      "header": "Dear {player},",
      "body": "Thank you for the help.\nHere is a little something.",
      "footer": "The Fair Committee",
      "sender": "The Fair",
      "item": "0x2800",
      "paper": 12
    }
  ]
}

Errors letters.json can raise #

Each one, with the message you see and the fix, is in the errors list under letters.json. Any JSON file can also meet the ones under JSON files.

Guide to letters.json #

calendar.jsonsince 1  #

Named by content.calendar in mod.json. A json file. Schema: calendar.schema.json.

How the game uses calendar.json #

Calendar days: dated days with safe effects only, and no script. A day can have a notice on the town bulletin board. The notice is posted once on the day in the player's own town, never on a visit or in The City, and needs scope world. A day can have villager lines: talk.json pools that name the day's id as their "day", in any place of the talk. A day with no notice and no letter is a date for those pools. A day can have a letter from the same mod's letters file. The letter is mailed once on the day to the player's mailbox in their own town, never on a visit or in The City, and counts against the mod's daily letter limit. A day cannot add decorations, because the game has no data format for them.

calendar.json fields #

FieldValueMeaning
days requiredlist, 1 to 16 entriesThe dated days.
days[].id requiredstring, matching ^[a-z0-9_.-]{1,48}$Unique in the file.
days[].date requiredobject{month, day} (February 29 works) or {month, week 1 to 4 or "last", weekday 0 Sunday to 6}.
days[].date.month requiredinteger, 1 to 121 for January to 12 for December.
days[].date.day optionalinteger, 1 to 31The day of the month. Not with week or weekday.
days[].date.week optionalinteger, 1 to 4 or one of "last"The week of the month: 1 to 4, or "last". Needs weekday.
days[].date.weekday optionalinteger, 0 to 60 for Sunday to 6 for Saturday. Needs week.
days[].board optionalstring, 1 to 192 charactersA bulletin board notice: 1 to 192 characters on at most 6 lines. Plain text: printable ASCII, no { or }. Needs scope world.
days[].letter optionalstring, matching ^[a-z0-9_.-]{1,48}$The id of a letter in this mod's letters file, mailed on the day. It is mailed once per town per day, the first time the player is free in their own town. It follows the same rules as cmd.send_letter: it goes to the mailbox or else the post office, and counts against the daily letter limit. No permission or script is needed.

calendar.json limits #

  • calendar.per_file, 16 days: Days in one calendar file.
  • calendar.board_per_day, 3 notices: Board notices that go up on one day across every mod. The first ones in load order go up. On a full board, a mod notice first takes the place of an earlier day's mod notice. It never pushes off a page dated today.
  • letters.body_chars, 192 characters: A letter body or a board notice.
  • letters.body_lines, 6 lines: Lines on the letter paper or a board page.
  • commands.letters_per_day, 3 commands: send_letter per mod per game day in each town. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule. A command counts when the game applies it, and the count is kept across a reload. A command lost with a closed tab before then never counts. The limit check adds the commands still waiting. A command refused for where the player is (The City, a visit) does not count.
  • file.json_bytes, 256 KB: The largest .json file other than mod.json.
  • json.depth, 32 levels: How deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.

calendar.json example #

calendar.json
{
  "days": [
    {
      "id": "harvest-fair",
      "date": {
        "month": 9,
        "week": 3,
        "weekday": 3
      },
      "board": "HARVEST FAIR TODAY!\nBring your best fruit."
    },
    {
      "id": "lantern-night",
      "date": {
        "month": 11,
        "week": 2,
        "weekday": 5
      },
      "letter": "lanterns"
    }
  ]
}

Errors calendar.json can raise #

Each one, with the message you see and the fix, is in the errors list under calendar.json. Any JSON file can also meet the ones under JSON files.

Guide to calendar.json #

talk.jsonsince 1  #

Named by content.talk in mod.json. A json file. Schema: talk.schema.json.

How the game uses talk.json #

Villager lines placed in a villager's talk. A talk is the hello, which ends in a menu (an errand, a chat, never mind); when the player chats, the game picks a topic, fresh every time: small talk (plain chat, the time of day, the weather, the month), a trade, a letter they got, a memory, a hint, or news of an event. Every pool's "place" says where its line goes; there is no default: "before" the hello (the hello and everything after it still play), as the "hello" (the menu and the topic still play; only an everyday greeting is replaced, never a hello with news such as a bee sting or a collection finished), as the "topic" (instead of the topic the game picked when it is one of the pool's "topics", small talk when it names none; the talk ends after it, as small talk does), "after" the topic (one more message before a chat ends), or the whole "conversation" (no hello, no menu, no topic: the pool's pages, then the talk ends). A line is one page or a list of pages. A special talk (a first meeting, an errand, a villager moving out, the first-job errands) never uses a pool, nor do a new player's first ten chats, whose topics are tips. For each place, the most specific pools that fit are used: this villager, else this personality, else everyone. A pool fits when its season, time, weather and calendar day, if it names them, are the ones now. Each pool that fits rolls its chance; the lines of the pools that pass are put together, from every mod, and one is picked, never the one this villager said last when there is another. When the most specific pools all roll no, that place stays the game's. A script's villager_talked line takes its place first. A pool kept to a calendar "day" speaks only on that day, in its place, like any other pool. A conversation pool is used only when no script took any place. Nothing is saved. Either scope. Pools run in The City too.

talk.json fields #

FieldValueMeaning
pools requiredlist, 1 to 32 entriesThe pools. A pool has a place in the talk, speaks for everyone, for one personality or for one villager, and can be kept to a season, a time of day, the weather or a calendar day.
pools[].place requiredone of "before", "hello", "topic", "after", "conversation"Required: where the line goes in the talk. before: ahead of the hello. hello: instead of an everyday hello. topic: instead of the topic the game picked after a chat answer. after: after the topic, before a chat ends. conversation: the whole talk.
pools[].topics optionalalways "any" or list, 1 to 6 entriesOnly with "place": "topic": the topics the line may stand in for. Default small_talk. "any" is all six. A first-job tip, the birthday question and "should I move?" are never replaced.
pools[].personality optionalone of "normal", "peppy", "lazy", "jock", "cranky", "snooty"Not with villager.
pools[].villager optionalstring, 1 to 8 charactersA villager's name, any case. Not with personality.
pools[].season optionalone of "spring", "summer", "fall", "winter"Only in this season: spring is March to May, summer June to August, fall September to November, winter December to February.
pools[].time optionalone of "morning", "day", "evening", "night"Only at this time of day, the game's own four: morning 5 to 12, day 12 to 17, evening 17 to midnight, night midnight to 5.
pools[].weather optionalone of "clear", "rain", "snow"Only in this weather. Cherry blossom and falling leaves count as clear.
pools[].day optionalstring, matching ^[a-z0-9_.-]{1,48}$Only on this day: the id of a day in the same mod's calendar file. This is how a calendar day gets villager lines, in any place.
pools[].chance optionalinteger, 1 to 100Talks in 100 where this pool's line is said, when the pool fits. Default 100: every talk it fits.
pools[].lines requiredlist, 1 to 32 entriesThe pool's lines. The game picks one each time.
pools[].lines[] requiredstring, 1 to 160 characters or list, 1 to 8 entriesA villager line: one page, or a list of 1 to 8 pages.

talk.json limits #

  • talk.pools, 32 pools: Pools in one talk file.
  • talk.lines_per_pool, 32 lines: Lines in one pool.
  • talk.line_chars, 160 characters: A page of a villager line (a pool's or a script's), in Unicode code points. It may have at most 3 line breaks. A line that is one string is one page, wrapped to as many windows as it needs.
  • talk.line_newlines, 3 newlines: The most line breaks in a page of a villager line (a pool's or a script's).
  • talk.pages, 8 pages: Pages in one villager line, when the line is a list of pages (a pool line, or a line a script returns). Each page starts on a clean window.
  • talk.villager_chars, 8 characters: A pool's "villager" name, as the game spells it.
  • file.json_bytes, 256 KB: The largest .json file other than mod.json.
  • json.depth, 32 levels: How deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.

talk.json example #

talk.json
{
  "pools": [
    {
      "place": "topic",
      "personality": "cranky",
      "lines": [
        "Hmph. Another day of\nyou walking around.",
        "What now? I was just\ngetting comfortable."
      ]
    },
    {
      "place": "hello",
      "weather": "rain",
      "lines": [
        "Rain again! The flowers\nare loving it, at least."
      ]
    },
    {
      "place": "topic",
      "topics": [
        "trade",
        "news"
      ],
      "chance": 30,
      "lines": [
        "No deals today. I just\nwant to chat."
      ]
    },
    {
      "place": "after",
      "season": "fall",
      "time": "evening",
      "lines": [
        [
          "The evenings come so\nearly now.",
          "I like it, though."
        ]
      ]
    }
  ]
}

Errors talk.json can raise #

Each one, with the message you see and the fix, is in the errors list under talk.json. Any JSON file can also meet the ones under JSON files.

Guide to talk.json #