Page 1 of 1

Localization Question

Posted: Fri Jun 29, 2012 2:48 am
by razac920
Does anyone know how the game sets up the "%s killed %s" messages? I figure it probably is with SOME kind of LUA scripting on a death callback, set up like SetMessageText("game.infomsg.killed"), but I don't know how the game modifies this string to replace the "%s" with the names of the killer and deceased. I had hoped that something like string.format("game.infomsg.killed","[killer]","[killed person]") might work, but it won't make any replacements, because it tries to make the replacements before going to the core for localization and doesn't find any "%s" in "game.infomsg.killed", I think? I ask because in a mod the game makes tons of faulty (inaccurate) "x killed y" messages, and while I could just edit the localization to make all of these messages be blank, I don't see a way to manually recreate them.

On a side note, does anyone know how the game changes the default yellow color of SetMessageText to the red or blue, depending on the team of the killer/killed?

Re: Localization Question

Posted: Fri Jun 29, 2012 4:40 am
by Anakin
maybe this is helpfull for the first problem:
Hidden/Spoiler:
Now your pretty much done! save your .lua and munge! if you have done this correctly, you should now have Jawas running around your map, but if you kill one of them, it will show up as

blahblahblah killed [NULL],

to fix this, go into your MOD_ID folder and run "editlocalize.bat"

once its started, right click on level and select Add Scope, name the Scope the three letter name of your map, mine is LTT (Local team Tutorial)

so now you will have something like this

level -> LTT,

now you need to right click on LTT and select Add Key, once you've done that rename it to the name that we set our local team in the .lua, remember, ours was Jawas, so set it to Jawas, it now should look something like this

level -> LTT -> Jawas

select Jawas and the boxes on the right side of the program will become ungrayed, under the level.MOD_ID.Jawas type the name of the creatures that you have in the map, ours are Jawas so i will type Jawa

now that that is down, click on the drop down menu below the box and select the next language, which should be French, type Jawa in the box again and then select a new language in the box, keep and doing this until you've done every single language,

NOTE: it is VERY important that when your typing the name, that you do it in every language, other wise for people with different version of the game ((example, Australians)) even though we speak English, it will still come up as [NULL] for us because there are two version of English in SWBF II, theres English, and UK English.

Also, if you've done a MASSIVE amount of custom sides, weapons, creatures, tips, etc. it can be VERY pain full to go back in and have to add all the names for other languages that you didn't do the first time.

now save your language files and quit.

open up Visual Munge and select localize, then munge.

In game when you kill the Jawas or what ever creatures you have it should come up as what the typed in the boxes in the editlocalize.bat program.
can be found here:
http://www.gametoast.com/forums/viewtop ... =27&t=6088

Re: Localization Question

Posted: Fri Jun 29, 2012 1:22 pm
by razac920
Ah sorry but that's not what I meant. Basically I'd like to create a localization key, game.infomsg.killed2, which is identical to the default game.infomsg.killed, which in English reads "%s killed %s". I want to make the default message blank, and use the one I created instead, whenever I choose to make this message appear. However, I don't know how to substitute the %s with the names, as the game does.