--- Log opened Wed Feb 20 00:00:38 2019 20190220 01:53:25-!- celmin|sleep is now known as celticminstrel 20190220 02:06:32< celticminstrel> @josteph I think gfgtdf might be on the right track actually - does wml.tostring{key=translatable_string} output the untranslated string? 20190220 02:07:04< celticminstrel> (More precisely, I'd expect it to output the string 'key = _ "translatable string"'.) 20190220 02:08:34< celticminstrel> We could add a standardized way of getting this info if you think there's good uses for it; obviously that wouldn't be in 1.14 though. 20190220 02:08:43< celticminstrel> Maybe even just translatable_string.key 20190220 02:20:42<+wesdiscordbot> @josteph - Okay I will give it a try and test it 20190220 02:22:05<+wesdiscordbot> So this code: ~+ [lua] + code = << + old_message = wesnoth.wml_actions.message + function wesnoth.wml_actions.message(cfg) + -- Speaker may be specified by id or by SUF. + local speaker = cfg.speaker or cfg.id + if (not speaker) or speaker:find(',') or speaker == 'narrator' or speaker == 'unit' or speaker == 'second_unit' then + 20190220 02:22:06<+wesdiscordbot> -- Keep the list of exceptions in sync with get_speaker in data/lua/wml/message.lua + speaker = 'noid' + end + ...~ Goes in the scenario file? 20190220 02:22:33<+wesdiscordbot> So this code: + [lua] + code = << + old_message = wesnoth.wml_actions.message + function wesnoth.wml_actions.message(cfg) + -- Speaker may be specified by id or by SUF. + local speaker = cfg.speaker or cfg.id + if (not speaker) or speaker:find(',') or speaker == 'narrator' or speaker == 'unit' or speaker == 'second_unit' then + 20190220 02:22:33<+wesdiscordbot> -- Keep the list of exceptions in sync with get_speaker in data/lua/wml/message.lua + speaker = 'noid' + end + ... Goes in the scenario file? 20190220 02:22:51<+wesdiscordbot> Did you actually just edit that line by line to add the formatting ticks? 20190220 02:23:04<+wesdiscordbot> Who are you talking to? 20190220 02:23:08<+wesdiscordbot> You 20190220 02:23:25<+wesdiscordbot> No I didn't I just put one tick at the start and one at the end 20190220 02:23:32<+wesdiscordbot> xD 20190220 02:23:44<+wesdiscordbot> blah blah blah 20190220 02:23:47<+wesdiscordbot> I didn't realize that worked 20190220 02:24:03<+wesdiscordbot> Most people would use three ticks at the start and three at the end to enclose a multiline block 20190220 02:24:11<+wesdiscordbot> It is helpful that it does 20190220 02:24:23<+wesdiscordbot> Yes that would make sense as well but I guess they are not picky 20190220 02:24:26<+wesdiscordbot> blah blah blah 20190220 02:25:18<+wesdiscordbot> Anyway, haha, 20190220 02:26:00<+wesdiscordbot> What is josteph's code supposed to do: https://forums.wesnoth.org/viewtopic.php?f=10&t=49271#p638509 20190220 02:26:07<+wesdiscordbot> Do you know 20190220 02:26:37<+wesdiscordbot> It looks like I would need to name my sound file a certain way 20190220 02:31:53<+wesdiscordbot> It won't work 20190220 02:32:07<+wesdiscordbot> -- Hash: we ought to use CRC32, but for this prototype we'll just use random numbers. 20190220 02:32:32<+wesdiscordbot> It's designed to not work, it just uses a random number generator as a placeholder for prototyping the functionality 20190220 02:33:19<+wesdiscordbot> If it did the filenames would be along the lines of speaker-hashs-languagecode-somethingthatlookslikethemessage???.ogg 20190220 02:37:23<+wesdiscordbot> Oh wait he does replace the output of the fake hash function with '00000000' 20190220 02:37:34< celticminstrel> Did anyone look into using the image-localization system for voice files BTW 20190220 02:38:12<+wesdiscordbot> So it looks like speaker-00000000-languagecode-istilldontknowwhatthispartis.ogg 20190220 02:38:20< celticminstrel> That would mean the Lua doesn't even need to know that there are translations of the file, I think? 20190220 02:38:48< celticminstrel> Admittedly, I haven't really looked into how the image-localization system works... 20190220 02:39:03<+wesdiscordbot> If I understand correctly the mystery part at the end is the message with all non-alphanumeric (per ASCII rules) characters elided and whitespace replaced with underscores 20190220 02:39:23<+wesdiscordbot> Which is a terrible idea anyway because you could end with overlong/illegal filenames that way 20190220 02:39:30< celticminstrel> I was just about to mention that too. XD 20190220 02:40:25 * celticminstrel contemplates the idea of adding a new type of add-on that's literally a WML diff that gets applied to some other add-on... 20190220 02:41:01<+wesdiscordbot> I'm picturing some of Elynia's lines in IftU scenario 10 yielding filenames over 500 characters long 20190220 02:41:32<+wesdiscordbot> And Windows' limit is something around 250 characters (without getting into the muddy mess that's total path length) 20190220 02:41:57<+wesdiscordbot> The hash really ought to be enough 20190220 02:44:41< celticminstrel> What do you do when the speaker can't be gleaned from the WML? 20190220 02:44:59<+wesdiscordbot> run in circles like a headless chicken 20190220 02:45:17<+wesdiscordbot> The code says to use noid 20190220 02:45:25< celticminstrel> ? 20190220 02:45:34<+wesdiscordbot> The code says to use noid 20190220 02:45:55< celticminstrel> ... 20190220 02:46:14<+wesdiscordbot> idk what you expected me to respond with, I'm literally just reading josteph's code in human terms here 20190220 02:46:53<+wesdiscordbot> You can see it for yourself if you're not convinced 20190220 02:47:56< celticminstrel> .. 20190220 02:47:57< celticminstrel> ... 20190220 02:48:02< celticminstrel> WTH is noid 20190220 02:48:08< celticminstrel> ANYWAY 20190220 02:48:15<+wesdiscordbot> The string that the code uses if the speaker can't be determined 20190220 02:48:20< celticminstrel> Yeah I see it now. 20190220 02:48:24< celticminstrel> Anyway 20190220 02:50:08< celticminstrel> AFAIK, if you used the image localization system for localizing voice clips, then all you'd need to do is provide a default value for the voice key (which wouldn't include the locale at all) and everything would Just Work. Or am I missing something? 20190220 03:02:06<+wesdiscordbot> Okay so as I understand jostephs code calls sound files with what is currently a placeholder string something like "speaker-00000000-languagecode-istilldontknowwhatthispartis.ogg" 20190220 03:02:46<+wesdiscordbot> @josteph - I can test that if you want, but celtic and shadowm have pointed out some potential problems with that idea. 20190220 03:03:25<+wesdiscordbot> I think I figured out what the last part is already 20190220 03:04:01<+wesdiscordbot> Yes it is the lines from the speaker 20190220 03:04:05<+wesdiscordbot> Say you have this line: https://github.com/project-ethea/Invasion_from_the_Unknown/blob/master/scenarios/01_Border_Patrol.cfg#L167 20190220 03:04:21<+wesdiscordbot> Then it puts that for humans to read 20190220 03:04:24<+wesdiscordbot> without spaces 20190220 03:04:34<+wesdiscordbot> because they're illegal in wesnoth 20190220 03:04:36<+wesdiscordbot> The resulting filename in that prototype would be Grumnyr-00000000-en-MoveonyousluggardsLetsclaimtheselandsfortheMaster.ogg 20190220 03:04:44<+wesdiscordbot> Which is an absolutely terrible idea 20190220 03:04:57<+wesdiscordbot> I wonder though 20190220 03:05:08<+wesdiscordbot> Wouldn't it be easier to just do what we are currently doing, voice=sound/CAMPAIGN_NAME/SCENARIO#/NAME 20190220 03:05:54<+wesdiscordbot> The problem of translations would still exist though 20190220 03:06:10< celticminstrel> That's why I keep bringing up the image localization system. 20190220 03:06:25<+wesdiscordbot> I guess it could be voice=sound/language/CAMPGAIGN_NAME/SCENARIO_X/FILE_NAME 20190220 03:06:47<+wesdiscordbot> The only disadvantage of that method is there are more lines of code 20190220 03:06:57<+wesdiscordbot> But that is a minor disadvantage... 20190220 03:07:08< celticminstrel> ...is anyone even listening to me... 20190220 03:07:31<+wesdiscordbot> I am sorry I am not very familiar with the image localization system 20190220 03:07:43< celticminstrel> AIUI there's a system that will automatically add that extra directory named after the language into your image path. 20190220 03:07:44<+wesdiscordbot> Nobody here is familiar with it 🤷 20190220 03:08:02< celticminstrel> I don't know exactly how it works either. 20190220 03:08:16<+wesdiscordbot> You might want to add your thoughts on the matter to the forum thread instead of assuming we're ignoring you in bad faith 20190220 03:08:21< celticminstrel> But the problem it solves is more or less the same one you're talking about. 20190220 03:08:29<+wesdiscordbot> Yes that would be a quick solution 20190220 03:09:37<+wesdiscordbot> But my question was why are we investigating hashing methods of loading sound files automatically? Do you believe it is worthwhile to do so, in order to avoid having to write 'voice=' in each method? 20190220 03:09:47<+wesdiscordbot> And if we do decide we want to avoid writing 'voice= 20190220 03:10:07<+wesdiscordbot> Surely we could just number the characters lines sequentially 20190220 03:10:14< celticminstrel> I think the purpose of the hasing is to avoid having to copy the campaign and add voice= 20190220 03:10:18< celticminstrel> ^hashing 20190220 03:10:40<+wesdiscordbot> Yes 20190220 03:10:57< celticminstrel> Basically, all you'd need to do is add a [modification] that tells the [message] key to generate these filenames, and then you could play the vanilla campaign and the voice acting would magically work. 20190220 03:11:15< celticminstrel> s/key/tag/ 20190220 03:11:49<+wesdiscordbot> Okay sounds like a simple solution... why are there so many problems xD 20190220 03:29:40< celticminstrel> Not that it's surprising, but it seems the image localization system does only work for images ATM, so it'd have to be extended to sounds. 20190220 03:39:12< celticminstrel> That shouldn't be hard though. 20190220 03:41:01< celticminstrel> As for how it works... whenever an image path/to/foo.png is loaded, the game first checks to see if path/to/l10n/fr/foo.png exists (assuming you've set your language to French). If so, it returns that instead. 20190220 03:45:17<+wesdiscordbot> Yes that would be great if it could be extended to sound files such as ogg and mp3 (I believe those are the two the game uses). 20190220 03:45:50<+wesdiscordbot> We only use .ogg (Ogg Vorbis) atm 20190220 03:46:04< celticminstrel> Pretty sure there are some .wav 20190220 03:46:06<+wesdiscordbot> .mp3 is supported where supported but we don't use it in the game 20190220 03:46:12<+wesdiscordbot> Oh yeah .wav is supported too 20190220 03:46:33<+wesdiscordbot> It's used for some sound effects but not a lot since it has a much larger footprint 20190220 04:11:22<+wesdiscordbot> Okay good to know 20190220 04:20:06 * celticminstrel guesses aiff is also supported, though I've never actually tried it. 20190220 04:29:09<+wesdiscordbot> aiff, voc, midi, mikmod and modplug-supported formats, mp3, flac, opus, where available 20190220 04:29:28<+wesdiscordbot> But the only strong guarantee you get with us is ogg and pcm/wav support 20190220 04:29:53<+wesdiscordbot> midi in particular is a highly problematic format for multiple reasons and should not be used 20190220 05:54:27-!- celticminstrel is now known as celmin|sleep 20190220 06:37:55-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20190220 21:51:07-!- wesdiscordbot [~wesdiscor@wesnoth/bot/discord-bridge] has quit [Remote host closed the connection] 20190220 22:47:08-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 255 seconds] --- Log closed Thu Feb 21 00:00:27 2019