Your first lines or shop mod in 10 minutes
Write lines for villagers to say, or make the flower shop a shop of your own. You edit only text, in any text editor. There is no code to write.
What you need #
- The game running in your browser, with your town loaded. The game runs from your own disc file. See Your disc.
- A plain text editor. Notepad on Windows works. So does TextEdit on a Mac (choose Format, Make Plain Text), or a code editor such as VS Code. Do not use a word processor. Word and Pages add formatting the game cannot read.
- A way to make a ZIP file. Windows, macOS and most Linux desktops can do it from the file manager.
Path A: villager lines #
Your lines become part of the villagers' talk. Talk to a villager and choose to chat: after their hello, they pick a
topic. When they pick small talk, one of your lines can be what they say. The lines are in one file, talk.json, in pools. A pool can be for everyone, for one personality or for one villager, and can be kept
to a season, a time of day, the weather or a day of your calendar. A pool's place can also put its lines
before the hello, as the hello, after the topic, or as the whole conversation.
- Download the Villager lines kit from GitHub and unzip it.
- Open
mod.json. Changeyournamein"id"and"authors"to your own name. Give the mod your own"name"and"description". - Open
talk.jsonand write your lines.
This is the file as it comes:
{
"pools": [
{
"place": "topic",
"lines": [
"Did you hear? The river was extra sparkly this morning.",
"I've been practising my whistling. Want to hear? Maybe later.",
"If you find a shiny rock, tell me first, okay?"
]
},
{
"place": "topic",
"weather": "rain",
"lines": [
"Rain, rain, rain! The puddles are perfect for stomping."
]
},
{
"place": "topic",
"time": "evening",
"lines": [
"The sky goes all orange this time of day. I love it."
]
},
{
"place": "topic",
"personality": "peppy",
"lines": [
"Ooh, it's you! Today is going to be amazing, I can tell!",
"I did ten twirls in a row this morning. Ten!"
]
},
{
"place": "topic",
"personality": "lazy",
"lines": [
"I had a snack, then a nap, then another snack. Busy day."
]
},
{
"place": "topic",
"personality": "cranky",
"lines": [
"Hmph. You again. Well, I suppose that's fine.",
"Back in my day, the trees were taller."
]
},
{
"place": "topic",
"personality": "cranky",
"season": "winter",
"lines": [
"Cold enough to freeze a fish. Don't stand there, it's cold."
]
},
{
"place": "topic",
"villager": "Bob",
"chance": 80,
"lines": [
"Bob here! I've been thinking about lunch all day."
]
}
]
}
- Each pool has a list of
lines. A pool with nopersonalityand novillageris for everyone. personalityis one of normal, peppy, lazy, jock, cranky and snooty.villageris one villager's name, in any case.season(spring, summer, fall, winter),time(morning, day, evening, night) andweather(clear, rain, snow) keep a pool to a moment. Leave them out for any.chanceis in how many talks in 100 the pool fits that its line is said. Leave it out for every one.placeis where the line goes:before,hello,topic,afterorconversation. See places in a talk.- The game uses the most specific pools that match: the villager's own, else their personality's, else everyone's. In the kit, a peppy villager says a peppy line, and a jock says a line for everyone, because no pool names jocks.
- A file holds up to 32 pools, and a pool 1 to 32 lines. A line is 1 to 160 characters, with at most 3 line breaks, written
\n, or a list of up to 8 such pages. - Each line goes in double quotes. Put a comma after every line and every pool except the last.
- The game wraps a line by width. A row holds about 24 letters, and a page holds 4 rows. Narrow letters like i take less room, and wide ones like W take more.
- A letter the game's font does not have shows as
?. Plain English letters, digits and common punctuation are safe. - To put a quote mark inside a line, write
\".
There is no script, and nothing is saved. The same villager can say several of your lines in one day, and never the same line twice running when the pools hold another. The Lines guide has every rule. To say something only when something in the game is true, such as an item in your pockets, or to ask the player a question, use a script: see the scripter path.
Path B: your own shop #
The flower shop gets your name on its sign, your hours, your greeting and up to 6 goods at your prices. The kit also adds two goods at Nook's.
- Download the Shop kit from GitHub and unzip it.
- Open
mod.jsonand put your own name in it, as in path A. - Open
shops.json:
{
"shops": {
"flower": {
"when": { "hours": { "from": "09:00", "to": "21:00" } },
"own_goods": false,
"goods": [
{ "item": "0x2900", "price": 500 },
{ "item": "0x2908", "price": 300 },
{ "item": "0x2905", "price": 300 },
{ "item": "0x2902" }
],
"name": "My Shop",
"lines": {
"greeting": "Hello and welcome! Have a look around.",
"stock": "Saplings and seeds today. Point at one and I'll tell you the price."
}
},
"nook": {
"goods": [
{ "item": "0x1110", "price": 1800 },
{ "item": "0x2205", "price": 900 }
]
}
}
}
"flower"and"nook"are the shops it changes, by id. Delete one you do not want to change. The Shops guide lists every shop.when: the block applies fromfromup toto, as 24 hour"HH:MM". Outside those hours the shop is the game's own.own_goods:falsemakes your goods the whole stock. Leave it out to put them among the shop's own.goods: 1 to 6 at the flower shop.itemis the item's number, in quotes.priceis in Bells. Leave it out for the usual price.name: the shop's name on its sign while it is shut, up to 40 characters.lines:greetingis what the keeper says when you walk in,stockher answer when you ask what is in stock. Each is up to 160 characters.
The item list has every item number with its name, its price and the shops that can sell it. The flower shop can sell fruit, saplings, seed bags and clothing. It cannot sell the game's own furniture. The Shops guide explains why.
Goods that fit your theme, such as lanterns for a festival stall or a tea set for a tea stall, are furniture. Make them your own with a mod item. A mod item is a new piece with your own name and price, drawn with one of the game's furniture models. The flower shop and Nook's both sell it. It is one more JSON file and still no code.
Path C: calendar days and letters #
There are two more kinds of text. Each is one JSON file with its own rules, and neither needs code.
- Calendar days: a dated day, like the second Friday of November. It can have a notice on the bulletin board and a letter in the mailbox, and a talk pool that names it has villagers talk about it that day. See calendar days and the Harvest Post recipe. To try one without waiting for its date, see test your day.
- Letters: you write a letter once in a letters file. A calendar day mails it with its
"letter"key, or a script mails it at any time. See letters.
The recipes are in the cookbook, ready to copy.
Install and try it #
- ZIP the folder. On Windows, right-click it, then Send to, Compressed (zipped) folder. On a Mac, right-click it, then Compress. You can zip the folder or the files inside it.
mod.jsonmay be at the top of the ZIP or inside one folder. The game ignores a repository's own files in the folder, such asREADME.md,LICENSE,media/,.gitignoreand.vscode/. - In the game, open Settings, then Mods. Under Install from a file, choose Choose a file.
- Choose Restart now.
- Talk to a villager (path A), or visit the flower shop in your opening hours (path B). For a calendar day, see test your day.
Get the playac-mod tool (optional) #
playac-mod is a command line tool that checks a mod folder with the game's own rules, reloads it in the game
as you save, and packs the ZIP. It needs Node.js 18.17 or newer (free, from nodejs.org; node --version says which you have). Nothing on this path needs it: installing a ZIP in the Mods tab runs the same checks.
npm install -g https://github.com/Play-AC-Online/playac-mods/releases/download/cli-v1.1.0/playac-mod-1.1.0.tgz
cd my-mod # your mod's folder
playac-mod check # every rule the game checks, each problem with its file
playac-mod dev # serve the folder to the game's developer mode (see Testing)
playac-mod pack # the ZIP to install or share, the same bytes every timeEvery command and option is on The playac-mod tool.
Next #
- The Lines guide covers talk pools, messages files and reading lines from other mods. The Springtime Town recipe in the cookbook has more pools.
- The Shops guide covers every field and rule.
- A few lines of Lua can make villagers say something only on Sundays, or only when you carry an apple. See the scripter path.
- Before you share, read the rules, then publishing.