[Les moddeurs et moddeuses de DSV travaillant sur des fichiers en anglais, nous considérons qu'iels maitrisent assez cette langue. Cette page n'est donc pas traduite.]
Config Values
This explanation assumes that you are familiar with the basics of creating a Content Patcher mod. If you aren't, please see the author's guide for Content Patcher first.
DSV's config values are added as tokens in the format "DSV.Core/ConfigValue:[ConfigName]", eg. DSV.Core/ConfigValue:AlexVariant. To find config names, open DSV Core's options.json. Inside, you will find sections formatted like so:
"Name" is the name of the setting, while "AllowedValues" contains the names of the options. If "Type" is set to "bool", this indicates a true/false option.
DSV tokens can be used in Content Patcher in the same way that dynamic tokens can be used. If using the token directly to get the value, use {{ }} around the token like so: {{DSV.Core/ConfigValue:AlexVariant}}. This will display what config option the player is using.
If using the token in a When condition, use the format "DSV.Core/ConfigValue:[ConfigName] |contains= [OptionName]": true/false. For example, if you wanted to edit dialogue only if a player is using Alex's Mexican variant, you would format the code like so:
With this, you can access the player's configuration choices for any of DSV's settings! If you're having trouble finding an option name or need more assistance in using DSV's tokens in your mod, feel free to ask for help in the DSV server.
Flower Queen's Crown
If you would like to add custom NPCs to DSV's Flower Queen's Crown feature as potential Flower Queens (with permission from the original NPC author), there are two parts that need coding. The first is adding the character to the pool of candidates, which is done by using EditData to add new entries to "Target": "DSV.Core/FlowerQueen" like so:
{ "LogName": "DSV FQC - Always Raining in the Valley Add as Queen", "Action": "EditData", "Target": "DSV.Core/FlowerQueen", "Entries": { "Sterling": "true", "Mia": "true", "Henry": "true" }, "When": { "DSV.Core/ConfigValue:FlowerQueensCrown |contains= True": true "DSV.Core/FQCImmersion |contains= MarriageCandidates, Anyone": true } },
You can add as many characters as you like in the Entries section. In the When section, you must have both of the above lines in order to match the player's Flower Queen's Crown and FQC - Immersion Mode settings, but can also add extra conditions if desired, such as only adding the characters after a particular heart event has been seen.
If the character you are adding is a marriage candidate, use "DSV.Core/FQCImmersion |contains= MarriageCandidates, Anyone": true. If the character you are adding is a child or non-marriageable, use the line "DSV.Core/FQCImmersion |contains= Anyone": true.
Once the character has been added, you then need to edit their portrait, sprite, and optionally dialogue. This is a standard Content Patcher edit, but using DSV's Flower Queen token, DSV.Core/FlowerQueen, in the When condition like so:
This tells the game to only edit the character's art or dialogue if that character has been selected as Flower Queen. You can also edit dialogue for other characters using the same token so that they can react to the character being chosen, like so:
Note: Please make sure you include the "Update": "OnLocationChange, OnTimeChange" section! Dialogue that relies on the DSV.Core/FlowerQueen token will not load without it.
A copy of the Flower Queen's crown for portrait and sprite with a transparent background is available in the Miscellaneous Files section of the DSV FQC - ARV add-on pack's Nexus page and mod creators are welcome to modify it as needed to fit their character. The design of the crown should be kept the same though.
Flower Queen's Crown Lore Notes
Here are some details about the Flower Queen traditions if you would like to ensure lore consistencies with DSV:
"Flower Queen" is a gender-neutral title, and people of any gender can be selected as Queen.
If using Immersion Mode, Haley will always be the Flower Queen in Year 1, marriage candidates will have the chance to be Flower Queen in Year 2, and children can also have the chance to be Flower Queen in Year 3.
The Flower Queen leads the dance, thus traditionally only people who can join the dance can be chosen as Flower Queen. However, Pelican Town isn't particularly strict about this.
The Flower Queen is chosen by popular vote from a list of nominated names and Lewis awards the Flower Queen with their crown.
Translations
For anyone wanting to translate DSV, it has two main components: DSV Core's config option names and descriptions are translated via a separate Content Patcher mod, "DSV Core English", while the dialogue, map strings, and event text are translated via i18n in DSV's Content Patcher section. Both of these will need to be translated as they contain separate parts of the mod.
To translate DSV Core, the simplest method is to create a copy of DSV Core English and edit the content.json. Inside, the code will be laid out as such:
Before starting, "en" should changed to the appropriate language code for your translation. Each line to be translated contains a key (the first half of each line before the colon) and the value (the second half after the colon) - make sure that you only translate the values, otherwise this will break the code. One additional note is that any instances of {name} in the value should be left untranslated in the translated text.
The last step for the DSV Core translation is to edit the manifest.json to use your unique mod & author name, mod ID, and update key. If you aren't sure how to do this or what these are, see the manifest section of the Content Patcher documentation.
The process for translating DSV CP is very similar: open the i18n folder, make a copy of the default.json file, and rename it to your language code (ie. "fr.json" for a French translation). The text will also have a key and a value for each line like so:
"DSV.DialogueEdit.Alex.Workout": "Unghh... Can't talk.$6", "DSV.DialogueEdit.Demetrius.IceFest": "Even with a jacket on, it's still cold out here. I admire Robin's ability to stand so close to the ice!", "DSV.DialogueEdit.Haley.NightMarket": "Brrr... I thought I was dressed warmly enough, but that sea breeze is icy-cold!$s",
Only the value should be translated, with the exception of any dialogue and portrait commands (#$b#, #$e#, $b, $1, etc). Once translated, create a folder structure of "Diverse Stardew Valley/DSV CP/i18n" and place your json file inside the i18n folder. This will allow it to automatically add the translated json to DSV's i18n folder and thus DSV will be able to read the translation.
If you have any trouble with translating DSV, either with code or with specifics of how a certain line should be translated, feel free to ask for help or feedback in the DSV server!