How can I add gate and door animation sound?

Crypto29
Posts: 10
Joined: Fri Jun 04, 2021 6:46 am

How can I add gate and door animation sound?

Post by Crypto29 »

Hello fellow farmers. So, I want to start a game in Hebdow map by Tomix but I'm not fairly satisfied with the gates / doors opening and closing without sounds. Would some of you know how to add gates and door animation sounds? I just want to add some immersion to my gameplay and some mod maps do not have those animation sound on some of it's gates and door (or some are not matching with the supposed material of the door to the sound that it makes).
Thanks in advance! :smileynew:
Eische
Posts: 3773
Joined: Thu Oct 18, 2018 5:17 pm

Re: How can I add gate and door animation sound?

Post by Eische »

There should be an animatedObjects.xml file in the map folder.
That is where the door animations are defined.

An example block including sounds looks like this (from map Starowies):

Code: Select all

<animatedObject index="DoorHangar_betonface">
        <controls posAction="ACTIVATE_HANDTOOL" triggerNode="0" posText="Otworz brame" negText="Zamknij brame"/>
        <sound file="maps/Sounds/OpenDoorSound.wav" pitchOffset="1.00" volume="0.80" indoorVolumeFactor="0.55" indoorLowpassGain="0.85" pitchMax="1.15" />
        <animation initialTime="0" duration="4">
            <part node="1">
                <keyFrame time="0.00" translation="0 0 0"/>
                <keyFrame time="0.95" translation="-3 0 0"/>
            </part>
        </animation>
    </animatedObject>
The sound files are in .ogg format but in xml they are referenced as .wav files. I have no idea if this is necessary, but I would say, yes.
Playing on PC - Win10
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
Crypto29
Posts: 10
Joined: Fri Jun 04, 2021 6:46 am

Re: How can I add gate and door animation sound?

Post by Crypto29 »

Eische wrote: Thu Jun 10, 2021 7:16 am There should be an animatedObjects.xml file in the map folder.
That is where the door animations are defined.

An example block including sounds looks like this (from map Starowies):

Code: Select all

<animatedObject index="DoorHangar_betonface">
        <controls posAction="ACTIVATE_HANDTOOL" triggerNode="0" posText="Otworz brame" negText="Zamknij brame"/>
        <sound file="maps/Sounds/OpenDoorSound.wav" pitchOffset="1.00" volume="0.80" indoorVolumeFactor="0.55" indoorLowpassGain="0.85" pitchMax="1.15" />
        <animation initialTime="0" duration="4">
            <part node="1">
                <keyFrame time="0.00" translation="0 0 0"/>
                <keyFrame time="0.95" translation="-3 0 0"/>
            </part>
        </animation>
    </animatedObject>
The sound files are in .ogg format but in xml they are referenced as .wav files. I have no idea if this is necessary, but I would say, yes.
Thank you for this. Will try my way to edit the xml from here and will keep you posted on the result. Thanks, Eische.
Crypto29
Posts: 10
Joined: Fri Jun 04, 2021 6:46 am

Re: How can I add gate and door animation sound?

Post by Crypto29 »

Hello Eische. this does not seem to work. Here is what Iv'e done to the mod map xml of animated objects:

Code: Select all

<!-- DOORS -->
    <animatedObject index="brama_1">
        <controls posAction="ACTIVATE_HANDTOOL" triggerNode="0" posText="action_openGate" negText="action_closeGate" />
	<sound file="maps/sounds/OpenDoorSound.wav" pitchOffset="1.00" volume="0.80" indoorVolumeFactor="0.55" indoorLowpassGain="0.85" pitchMax="1.15" /> 
        <animation initialTime="0" duration="4">
            <part node="1"> <!-- node -> child index -->
                <keyFrame time="0.05" rotation="0 0 0" /> <!-- translation, rotation, scale, visibility -->
                <keyFrame time="1.00" rotation="0 -95 0" />
            </part>
			<part node="2"> <!-- node -> child index -->
                <keyFrame time="0.05" rotation="0 0 0" /> <!-- translation, rotation, scale, visibility -->
                <keyFrame time="1.00" rotation="0 95 0" />
            </part>
Am I missing something?
Eische
Posts: 3773
Joined: Thu Oct 18, 2018 5:17 pm

Re: How can I add gate and door animation sound?

Post by Eische »

So I guess you have the soundfiles placed in the correct folder and named them accordingly?
Folder path must be relative to the location of the modDesc.xml

So beside your modDesc.xml there should be a folder called maps containing a folder sounds where your sound files are located.

Other than this, I have no idea what could be wrong.
Playing on PC - Win10
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
Post Reply