The /project
directory contains a specific set of folders and files required to make your project run. This page outlines the exact layout of this directory and explains the point of each folder/file.
/project
├┬ /speakers
└─┬ speaker_id
├─ (various assets)
└─ speaker.json
│
├┬ /sounds
└── sound.wav
│
├┬ /scripts
└── main.chat
│
├┬ /backgrounds
├── background1.png
├── background2.png
└── etc...
│
└─ chatty.json
Let’s go through each item, starting from the bottom
chatty.json
This is the main project file - without this, nothing else works. It contains basic info on your project - it’s name, version number, and crucially the starting script. When a project loads, it can have multiple script files, and so the start_script
parameter tells Chatty which one to load at the beginning.
{
"project_name": "Iekika and Amber blow up a milk jug",
"description": "Just a normal saturday for these two",
"version": 1,
"start_script": "main"
}
/scripts
The scripts directory. This folder contains every script in your project - scripts are just plain text files, marked with the .chat
file extension.
To see more on scripting, check Scripting Reference
/backgrounds
The backgrounds directory. Images placed in here will be loaded into the project for use with the bg
command. Backgrounds can be in png
or jpeg
format, and will be cropped to a maximum 320x256 pixels on screen.
/sounds
The sounds directory contains any wav
/mp3
files you want to be able to play with the sound
command. Unfortunately, Godot 4 can’t load ogg files at runtime
/speakers
The speakers directory. Contains every speaker your project will use, and their required assets. Instead of a file, each speaker is represented by a sub-folder named after that speakers id. This is the name used when writing scripts, so whitespace and commas are not allowed in the name.
Each speaker folder must contain a speaker.json
file. This describes the speaker - their animations, name, talk sound, etc. The format is described in depth below
{
"name": "J.N.F.R.",
"animations": {
"default": {
"spritesheet": "frames.png",
"frames": [0, 1, 2],
"fps": 8
},
"angry": {
"spritesheet": "frames.png",
"frames": [3, 4, 5],
"fps": 8
},
...
},
"talksound": {
"clips": ["talksound/keys-01.wav","talksound/keys-02.wav","talksound/keys-03.wav","talksound/keys-04.wav"],
"pitch_variance": 0.2
},
"ui_atlas_override": "custom_ui_atlas.png"
}
"name"
The display name of the speaker. This can be different from the speaker’s id, and is shown above the dialogue box when the speaker is active. If this is left empty, the nametag is hidden.