PDA

View Full Version : Tutorial: adding unique sounds to an onager



Makanyane
09-13-2007, 09:51
This is quite simple once you know how - just took me two days to figure out which files reference what so I thought I'd write it up.

Some mods use onager engine to make mock cannons etc.. and it would be nice if they could have a unique sound for the cannon version that does not apply to the onager version as well. Firing and cranking sounds are set in descr_sounds_units_anims.txt and that file appears not to want to accept a 'unit' or 'type' line to restrict a sound to a certain unit.

So:..................................

Your unique onager should have its own section in descr_engines.txt already (as it will be using different model files) in that change the skeleton line to
engine_skeleton newonager

In descr_engine_skeleton.txt (yes that one is used, see descr_engine_skeleton.txt (http://www.twcenter.net/wiki/Descr_engine_skeleton.txt) on TWC Wiki) copy the entire onager section and change the type line of the copied section (and do similar for the dying animation) to
type newonager

the lines for the various animation stages in that file have a reference to the animation.cas first - leave that bit entirely alone, then they have a reference to the .evt file. The .evt file is what calls the sound file.

Go to RTW/data/animations/engine/ballista and copy all the onager_blah.evt files , paste them into your mod-folder (if you are using one) and rename them to newonager_blah.evt. Change the reference line in descr_engine_skeleton for your new skeletons section so that it points at those new files, eg


anim attack_recover data/animations/engine/ballista/onager_fire_recover.CAS -evt:bi/eod2/data/animations/engine/ballista/newonager_recovery.evt

Open the .evt files, you will find that only some actually contain information. For instance the onager_recovery.evt contains:

event SOUND ANIM_ONAGER_FIRE 0 0
(the onager firing sound actually occurs on the recovery stage)
change that to

event SOUND ANIM_NEWONAGER_FIRE 0 0
in your newonager_recovery.evt file


Now go to descr_sounds_anims.txt and add a corresponding event eg:

event ANIM_NEWONAGER_FIRE volume 0 mindist 40 minPitch .85 maxPitch 1.15
folder bi/eod2/data/sounds/new
big_bang_sound
end
'big_bang_sound' would be the name of your new sound file without the.wav at the end, the path relative to the RTW folder goes in the folder line....

voila you should now have one onager only that has big bang sound :beam:

(all the files mentioned work from mod-folder, some may only exist in RTW/data initially, just make a copy of them to amend if so)

Dol Guldur
09-13-2007, 11:00
Top-notch! Great work!