Wargus / wargus

Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales
GNU General Public License v2.0
360 stars 55 forks source link

Certain sounds for certain buildings #296

Closed DinkyDyeAussie closed 5 years ago

DinkyDyeAussie commented 5 years ago

I am playing 2.41 of wargus, because 2.4.2 is having issues where you extract the data and it runs the first time but then errors out every time after that...But that's not my point of this post.

I was playing mission 4 of TOD human campaign and there is this thing where if a peasant finishes a building they say "Job's done", in their nasally dopey tone, and when oil tankers finish building an oil platform they say "work completed" in their astute proper tone.

I can't have a voice for each one in the lua files. It's one or the other for both units. I would like to have the proper voices for the proper "work completed" based on which unit is performing the task, like it the original game.

Is there a way to hack the script files to do this? Or is it an engine issue?

timfel commented 5 years ago

I think right now it's one sound per race for any "work complete". This issue may not have been noticed by others, because afaict only the English version of warcraft has two different sounds here. The German, French, and Russian versions use the same sound for Peasants and Oil tankers work complete.

timfel commented 5 years ago

Yeah, I think it's an engine issue. See here: https://github.com/Wargus/stratagus/blob/461a69986e8cf13f9b75d2cdc18d984b5446c18a/src/sound/sound.cpp#L183

This would need to change to check unit.Type->MapSound.WorkCompleted.Sound first, and then fall back to the current code. Then in https://github.com/Wargus/stratagus/blob/461a69986e8cf13f9b75d2cdc18d984b5446c18a/src/unit/script_unittype.cpp#L1056 we need an additional case so we can define a work-completed sound.

timfel commented 5 years ago

(Shouldn't be too much work, it'll take maybe a few hours to a day all in all with testing it and updating both stratagus and wargus)

timfel commented 5 years ago

I think I've fixed this, but don't have time to test right now. So I'm leaving the code in the two pull requests until someone can test it and say that it works.

DinkyDyeAussie commented 5 years ago

I'll check it out today. Will let you know how I go.