Skip to content
Zenarchist edited this page Aug 31, 2024 · 9 revisions

What are the requirements?

This mod relies on Expansion code for AI, so you need either ExpansionBundle which includes all of their AI mods, or one or more of the following:

ExpansionAI ExpansionQuests ExpansionMarket

There may be bugs with the mod, I haven't experienced any on my own server but I only use it for my safezone guards, my static NPC traders and my quests.

Any advanced/complex usage (eg. setting up multiple voiced AI bot factions) might not be possible with the current codebase but feel free to modify my code and repack the mod if required.

The mod is required to run on both server and client so pack it into your server modpack.

Where to get voices?

I use Speechify. It's free with some restrictions, but for the purposes of making basic DayZ quest and NPC dialogue it does the job fine for me - there are probably other tools out there that are just as good if not better so look around.

You can also just record your own voice or get friends or players on your server to act out NPCs if you want to.

How to edit the audio?

I use Audacity. It's free and super easy to use, especially for the purposes of making basic audio files.

Just remember to export your audio files in .ogg format or they won't work in-game.

How to add new audio files

You will need to download the source code for my SoundSets mod which you can find here.

You can also download the scripts part of the mod if you want to repack that too, but the only mod you need to edit as a server owner wanting to add voice files is the SoundSets mod.

Once you've downloaded the SoundSets mod onto your PC, to add new audio files you will need to export .ogg audio files into the mod folder and then create your own custom SoundShaders and SoundSets.

There are a bunch of examples included in the mod and a video walk-through on my YouTube channel, but here is a quick walk-through below for adding Trader dialogue, AI dialogue and Quest dialogue.

How to add Quest NPC Greetings

Each quest NPC has a unique ID assigned to it in the Expansion quest files (click here to read the official Expansion guide for setting up quest NPCs)

I've created default config for the first 50 quest NPCs and quests, so you don't need to modify any code unless you exceed 50 quest NPCs or unique quests OR you don't want to use 6 random greeting audio clips.

With the default config you need to provide 6 unique "hello" greeting audio files. The reason there is 6 is it aids a lot in immersion as hearing the same greeting gets repetitive very fast otherwise.

If you don't want to modify the code and you don't want to add 6 unique audio files, just copy and paste the same file with the naming convention below.

Simply export your audio files as NPCID_1.ogg through NPCID_6.ogg into the ZenExpansionAudioAI_SoundSets/data/audio/quests/hello folder.

That's it! Here is an example list:

ZenExpansionAudioAI_SoundSets/data/audio/quests/hello/5_1.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/hello/5_2.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/hello/5_3.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/hello/5_4.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/hello/5_5.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/hello/5_6.ogg

How to add Quest Dialog

Adding quest dialog is a bit simpler - there are 2 audio files per quest.

The first audio file is the quest-giving text, the second audio file is the quest-completion text.

Each quest has a unique ID, just like quest NPCs have a unique ID. (click here to read the official Expansion guide for setting up quests)

Simply export your audio files as QUESTID_start.ogg and QUESTID_complete.ogg into the ZenExpansionAudioAI_SoundSets/data/audio/quests/dialogue folder.

That's it! Here is an example list:

ZenExpansionAudioAI_SoundSets/data/audio/quests/dialogue/7_start.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/dialogue/7_complete.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/dialogue/8_start.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/dialogue/8_complete.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/dialogue/9_start.ogg ZenExpansionAudioAI_SoundSets/data/audio/quests/dialogue/9_complete.ogg

How to add Trader Greetings

Note: this mod currently only works with static trader NPCs (so ExpansionTraderAI types won't work with this mod - may change in future).

Adding unique trader greetings is a little more complex - I've included a bunch of example config for traders I use on my server, but you will probably want to over-write my audio files with your own.

The ExpansionTrader classnames included in the default example config are:

ExpansionTraderBoris ExpansionTraderCyril ExpansionTraderDenis ExpansionTraderElias ExpansionTraderLinda ExpansionTraderNaomi ExpansionTraderOliver

To over-write the audio files for these pre-configured trader NPCs, just replace my audio files in ZenExpansionAudioAI/data/audio/traders/hello/X.ogg

Again, each trader has 6 unique greetings which are randomly played to reduce repetitiveness, so you'll need to add 6 files like so:

ZenExpansionAudioAI/data/audio/traders/hello/ExpansionTraderBoris_1.ogg ZenExpansionAudioAI/data/audio/traders/hello/ExpansionTraderBoris_2.ogg ZenExpansionAudioAI/data/audio/traders/hello/ExpansionTraderBoris_3.ogg ZenExpansionAudioAI/data/audio/traders/hello/ExpansionTraderBoris_4.ogg ZenExpansionAudioAI/data/audio/traders/hello/ExpansionTraderBoris_5.ogg ZenExpansionAudioAI/data/audio/traders/hello/ExpansionTraderBoris_6.ogg

If you want to add audio to an NPC which isn't included in my default list, you'll need to create your own SoundShader and SoundSet for that NPC.

Here's an example for adding soundsets for the ExpansionTraderJudy classname - first add this code inside of class CfgSoundShaders {:

class Zen_ExpansionTraderJudy_Hello_SoundShader : ZenExpansionAudio_SoundShaderBase { samples[] = { { "ZenExpansionAudioAI_SoundSets\data\audio\traders\hello\ExpansionTraderJudy_1", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\hello\ExpansionTraderJudy_2", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\hello\ExpansionTraderJudy_3", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\hello\ExpansionTraderJudy_4", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\hello\ExpansionTraderJudy_5", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\hello\ExpansionTraderJudy_6", 1 } }; };

Then add this code inside class CfgSoundSets {

class Zen_ExpansionTraderJudy_Hello_SoundSet { soundShaders[] = { "Zen_ExpansionTraderJudy_Hello_SoundShader" }; };

And you're done!

How to add Quest Required Audio for Traders

To add voice audio to play when a quest is required to access a particular trader, the process is identical to greetings except the naming convention is slightly different:

ZenExpansionAudioAI/data/audio/traders/questrequired/ExpansionTraderJudy_1.ogg ZenExpansionAudioAI/data/audio/traders/questrequired/ExpansionTraderJudy_2.ogg ZenExpansionAudioAI/data/audio/traders/questrequired/ExpansionTraderJudy_3.ogg ZenExpansionAudioAI/data/audio/traders/questrequired/ExpansionTraderJudy_4.ogg ZenExpansionAudioAI/data/audio/traders/questrequired/ExpansionTraderJudy_5.ogg ZenExpansionAudioAI/data/audio/traders/questrequired/ExpansionTraderJudy_6.ogg

class Zen_ExpansionTraderJudy_QuestRequired_SoundShader : ZenExpansionAudio_SoundShaderBase { samples[] = { { "ZenExpansionAudioAI_SoundSets\data\audio\traders\questrequired\ExpansionTraderJudy_1", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\questrequired\ExpansionTraderJudy_2", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\questrequired\ExpansionTraderJudy_3", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\questrequired\ExpansionTraderJudy_4", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\questrequired\ExpansionTraderJudy_5", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\traders\questrequired\ExpansionTraderJudy_6", 1 } }; };

class Zen_ExpansionTraderJudy_QuestRequired_SoundSet { soundShaders[] = { "Zen_ExpansionTraderJudy_QuestRequired_SoundShader" }; }; `

ExpansionAI Patrol Audio

Adding voice files to ExpansionAI (bots) is a bit more complex again.

There are 2 types of voice files - greetings and threat responses.

Greetings are triggered when a player approaches the NPC and the NPC looks at them.

Threat audio is triggered when a player threatens an NPC or the NPC is aggro'd at the player (eg. you encounter a bandit in the wild and are close enough to hear their voice file trigger).

The file structure for AI is like this:

ZenExpansionAudioAI_SoundSets/data/audio/ai/

I have not included any specific audio for AI bots, only a handful of generic hello's and threat responses, but if you wanted to add your own custom audio for a specific bot type you'd do it like this:

` class Zen_eAI_SurvivorF_Irena_Hello_SoundShader : ZenExpansionAudio_SoundShaderBase { samples[] = { { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\hello\eAI_SurvivorF_Irena_Hello_1", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\hello\eAI_SurvivorF_Irena_Hello_2", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\hello\eAI_SurvivorF_Irena_Hello_3", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\hello\eAI_SurvivorF_Irena_Hello_4", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\hello\eAI_SurvivorF_Irena_Hello_5", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\hello\eAI_SurvivorF_Irena_Hello_6", 1 } }; };

class Zen_eAI_SurvivorF_Irena_Threat_SoundShader : ZenExpansionAudio_SoundShaderBase { samples[] = { { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\threat\eAI_SurvivorF_Irena_Threat_1", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\threat\eAI_SurvivorF_Irena_Threat_2", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\threat\eAI_SurvivorF_Irena_Threat_3", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\threat\eAI_SurvivorF_Irena_Threat_4", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\threat\eAI_SurvivorF_Irena_Threat_5", 1 }, { "ZenExpansionAudioAI_SoundSets\data\audio\ai\specific\threat\eAI_SurvivorF_Irena_Threat_6", 1 } }; }; ` I've included a bunch of default greetings and threat responses in the default mod config (6 unique voices) - to make an in-game patrol utilize these generic greetings and threat responses you'll need to modify the JSON config. Instructions are below.

If you want to replace the default generic audio files just replace all the files in ZenExpansionAudioAI_SoundSets\data\audio\ai\generic\hello\ and ZenExpansionAudioAI_SoundSets\data\audio\ai\generic\threat\ with your own audio files.

JSON Config & Generic Voices

When you run this mod on your server for the first time it will create a default JSON file inside the Expansion mod profile settings folder found here:

server_profiles/ExpansionMod/Settings/ZenExpansionAudioAI.json

This file has some basic settings:

{ "CONFIG_VERSION": "1", // Don't touch this "DebugOn": 0, // Set to 1 to enable in-game text debugging to help set up the audio files for specific NPCs "GenericAudioTypes": [ // Any classnames detect in here will have the generic hello files applied to them "ExpansionP2PTrader", // Any NPC with "ExpansionP2PTrader" in the classname will use generic audio "ExpansionTrader", // To make a specific NPC use generic audio but not all NPCs, put its classname in here "Sanctuary_Guards" // This is an AI Patrol group name from AIPatrolSettings.json ], "GenericThreatTypes": [ // These classnames/patrol groups will use generic threat audio "Bunker_Bandits", "Bandit_Patrol" ] }

Buy me a coffee

Creating these mods takes up a huge amount of my free time, they're all free and open-source but if you find them helpful on your server please consider buying me a coffee - it's not expected but obviously extremely appreciated!

https://buymeacoffee.com/zenarchist