You must be logged in to post messages.
Please login or register

Game Modifications
Moderated by Aurilux

Hop to:    
Topic Subject: Disable sound
posted 08-15-16 04:44 PM EDT (US)   
Does anyone know how to disable sound effect for a unit?

Currently I am creating a new tribe (Based on Alim) such that each time when a new military district is created, the free unit given becomes Dark Walkers instead of Desert Walkers. I wrote the following function as a workaround:
void game_callback on_unit_trained (Unit the_unit, Leader the_leader, UnitType the_type, Build the_build) {
Location loc = unit_location(the_unit);
UnitType the_type2 = get_unit_type(the_unit);
if(the_type2 == "Desert Walker") {
create_unit(the_leader, "Dark Walker", loc);

It almost works except that the "remove_unit" function will play a sound effect of the Desert Walkers dying, and I want to get rid of that, does anyone know how to do this?

[This message has been edited by modder00 (edited 08-15-2016 @ 04:45 PM).]

posted 08-17-16 10:55 AM EDT (US)     1 / 3  
I searched this ROL HG forum (when logged in a forum page you can use the search bar below to search for info) for sound modding info and basically most of it is only about replacing existing sound with other sound.

You could create a sound file of a few seconds of silence and use that as a workaround for "disabling" sound.

I have also emailed your questions to Motter, he is taking a break from modding ROL but eventually he will be back, hopefully he will post here or email some ideas.

[This message has been edited by alincarpetman (edited 08-17-2016 @ 11:07 AM).]

posted 08-17-16 07:50 PM EDT (US)     2 / 3  
Thank you for your help. I actually eventually figured out that what the Military District code does is search for the first Grunt unit that is enabled for the tribe in a linear order; as a result if I disable all desert walker units and place Dark Walkers as the first neutral unit in the xml it works. However there is still a possibility I may need to use the remove_unit function silently in the future, if that happens I will look into modifying sound files.
posted 08-17-16 09:13 PM EDT (US)     3 / 3  
Your follow up info will help others so it's good to always know any details.

To create a silent sound file you can usually find a Generate Silence or Create Silence option in an audio editor.

After generating a few seconds of silence and saving the file as "Silence" or "Disabled Sound" in a work folder, the sound can be copied over an existing sound such as the unit death sound effects and renamed to whatever the original sound effect file name was so it will work properly.

Eventually I may put together a more detailed sound modding tool and samples pack as more modders are finding ROL BIG Archiver and posting in this forum.

[This message has been edited by alincarpetman (edited 08-17-2016 @ 09:32 PM).]

Rise of Legends Heaven » Forums » Game Modifications » Disable sound
You must be logged in to post messages.
Please login or register
Hop to:    
Rise of Legends Heaven | HeavenGames