Skip to content

Latest commit

 

History

History
116 lines (102 loc) · 5.28 KB

Documentation.md

File metadata and controls

116 lines (102 loc) · 5.28 KB

Installation

Place the voice mod (default: voice-mod) in the directory <Your CrossCode Directory>/assets/mods/voice-mod/.... When you're done, it should look something like this:

  • assets
    • ...
    • mods
      • ...
      • voice-mod
        • package.json
        • plugin.js
        • packs
        • voice

Note

While there are pre-existing .ogg files when you download the mod, they're only for demonstration on how the structure works. If you come up with a more full voice pack, DO NOT COMMIT IT TO GITHUB!! Binary files (like images, sound, and videos) do not work well with GitHub since it stores every version of a file, which can lead to slow downloading and large file sizes you can't easily get rid of. The demo voice files are from Wervyn (at least according to the metadata).

What is a langUid?

A langUid is a piece of information attached to any message which gives that message a unique id number, which probably assist in translation as well. While it is not required to function for the game itself, it is required to have those present for this mod. For the base game, there are langUids for each message, though the same might not be true for other mods.

The two main places to find dialogue is in the database for dialogue events that aren't bound to any map and then dialogue that is part of a map.

  • The database mostly stores dialogue events in the commonEvents key.
  • Maps store dialogue in EventTrigger entities.

The structure of a LangLabel (which contains everything about the content of a message) is as follows:

{
	"en_US": "English",
	"de_DE": "Deutsch",
	"zh_CN": "简体中文",
	"ja_JP": "日本語",
	"ko_KR": "한국어",
	"langUid": 1
}

Once you have the langUid of the message you want, just apply a voice file to that message.

The Structure of the Mod

The idea behind this structure is that all of the core code and hard configuration is done at the top-level, with the subdirectories being the configurable elements. Pack order is determined alphabetically (case-inspecific).

  • voice-mod
    • package.json
    • plugin.js
    • packs
      • demo-pack
        • Voice Pack Structure
      • other-packs
        • Voice Pack Structure
    • voice
      • Voice Pack Structure

The Structure of a Voice Pack

Any folders can be exchanged with each other and still work since the structure is the same.

  • voice (or any pack)
    • common
      • .ogg files with any name you want
    • database
      • .ogg files matching the langUid of the database message
    • lang
      • en_US
        • Voice Pack Structure (only "database/" and "maps/")
      • de_DE
        • Voice Pack Structure (only "database/" and "maps/")
      • zh_CN
        • Voice Pack Structure (only "database/" and "maps/")
      • ja_JP
        • Voice Pack Structure (only "database/" and "maps/")
      • ko_KR
        • Voice Pack Structure (only "database/" and "maps/")
      • ...
        • Voice Pack Structure (only "database/" and "maps/")
    • maps
      • path to map
        • map name
          • .ogg files matching the langUid of the map message
      • hideout
        • entrance
          • 2.ogg (since the langUid targeted is 2)
    • common.json

common.json

In case one of the common.json files isn't working, an error will appear on the screen letting you know the directory of the malformed one. The core structure of a common.json file is an object containing a list of string:object pairs, where the key is either the map path or a special value such as the database. Inside each object, there's a list of string:array pairs, where the key is the .ogg file of either a sound in the common/ directory, a special value, or an external file starting with a root of assets/. The array is a list of numerical langUids to target.

{
	"special:database":
	{
		...
	},
	"hideout/entrance":
	{
		...
	},
	...
}

Of the top-level entries, it is either a map path or a special: key, with the only current special key being database. Only put : if you are specifying a special type. Here, putting database as an entry would lead the program to try and find a map called "database" instead of linking to the actual database.

"key":
{
	"hi": [14778],
	"special:silence": [269],
	"external:media/sound/va/lea/hi": [4,5,6]
}

Inside each entry, you'll get a list of string:array pairs. .ogg is assumed, so don't include it. Use special: if you want to specify a special type. The only special type right now is silence, which lets you silence a message from having both a voice and a dialogue beep. Then there's external:, which allows you to grab a resource from the root directory of assets/.... The arrays specify which langUids to affect, and you must have an array.

For the purposes of this example, <pack> will refer to either voice/ or packs/<pack>/.

  • The first one will look for a file found in assets/mods/voice-mod/<pack>/common/hi.ogg. If it's not found, the program will just continue on without crashing the game. Putting hi.ogg would make the program look for assets/mods/voice-mod/<pack>/common/hi.ogg.ogg. Then this sound is applied to any message with the langUid of 14778.
  • The second one will silence any message with the langUid of 269. Keep in mind you must have special:.
  • The third one will look for a file found in assets/media/sound/va/lea/hi.ogg. And you must have external:. Then it applies the sound to any message with a langUid of 4, 5, or 6.