Product Chat / Custom sound for characters

Author
Message
Lord Reven
7
Years of Service
User Offline
Joined: 28th May 2017
Playing:
Posted: 4th Jul 2017 01:33
I have some custom sound files I want to use for the characters in my game. I have selected the sounds I want for the sound strings but they do not always work and are always random. I was told to check the solider.lua file on how the sound works but it only has two functions so I can't see how the entity fetches the sound files and what order.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 17th Jul 2017 15:35 Edited at: 17th Jul 2017 15:37
This is actually quite easy to do. Game Guru has a folder in the audiobank folder called "character". Copy one of the existing character folders in there and rename it your custom character. Open the folder and replace the audio files in the various sub folders with your custom media.


This will allow the AI to detect for which audio to play at random within each status:

onAggro - when he is aggressive
onAlert - when he sees the player
onDeath - when he dies
onHurt - when he is hurt
onHurtPlayer - when he hurts the player
onIdle - when he is idle
onInteract - when the player interacts with him

Once you have placed all your custom sounds in the following sub folders you will need to set your character to use those sounds instead of the default "male" sounds. So you will have to open up the FPE file of your character and add the line "soundset =" and the name of your folder. Example "soundset = lizardman". You can add that line anywhere within the FPE file.

Now for some reason the solider AI seems to no longer have "soundset = male" in their FPE files. So not sure if it will work with them. But it does indeed work with custom characters I have created. What loads the audio properly is the PlayCharacterSound LUA commands:

PlayCharacterSound(e,"onAlert")

Where it says onAlert for example is a sub folder within your custom character sounds folder you have created. Some AI scripts have this command in there by default and your new sounds should just play automatically without you touching the LUA scripts.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GT 740

Login to post a reply

Server time is: 2024-11-24 12:07:44
Your offset time is: 2024-11-24 12:07:44