[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/jp/ - Otaku Culture

Search:


View post   

>> No.19185652 [View]
File: 21 KB, 1048x207, localization.png [View same] [iqdb] [saucenao] [google]
19185652

>>19184999
I resisted learning lua because I thought it was just for games. I was right but I regret not doing it.
I imitated Civilization V for Elona#. There's a sqlite db that gets populated with the selected language on initialization. It would generate a list of language options based on folders that exist inside executingassembly/External/XML/Text/. There is only one table, GameText with fields TextKey and LocalizedText. I made it a static class to encapsulate populating, resolving keys and disposing the connection but it could just as easily be a member of Game with a public accessor since that gets passed around to all the Scene subclasses anyway. I also created a GameData schema that was going to hold tables describing item and npc attributes but work stalled in December when I had a small nervous breakdown after realizing I'm losing my hair to alopecia, then was so ashamed of my lack of progress I stopped coming here all together.
The GameData tables would have been a bit more complex, I need to populate Items before NPCs to stay on the good side of the FK constraint to that NPC's unique loot. I had it hardcoded but you could have a metadata file that describes which order each data file loads. You could really drive yourself crazy trying to find the limit of data externalization. I did :^) Should there be a DamageTypes table? What if somebody really wants to make a Filthy Frank NPC and needs to add a Retardation damage type? Maybe I decide I want to change Meteor to deal half fire and half physical damage without recompiling. Now I need DamageTypes and Spells, and a way to interpret each spell's damage scaling formula.

Navigation
View posts[+24][+48][+96]