Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Language Files in Dev Mode
triadtimes Offline
Senior Member

Posts: 508
Threads: 16
Joined: Jan 2011
Reputation: 21
#1
[SOLVED] Language Files in Dev Mode

This issue has been solved, please look below if you are having trouble setting up a dev environment with .lang files.

--------------------------------------------------------------------------

I'm wondering if anyone knows how extra language files are used for custom maps in dev mode.

I created a map with a terminal in it, I made a file called english.lang and tried putting it in ...\SOMA\mods\my_mod\config\lang_main. The file looks like this:

Spoiler below!

<LANGUAGE>
  <CATEGORY Name="Emails">
    <Entry Name="GUI_EMAIL_SEND">SEND EMAIL</Entry>
    <Entry Name="GUI_MENU_INBOX">INBOX</Entry>
    <Entry Name="GUI_MENU_DRAFTS">DRAFTS</Entry>
    <Entry Name="GUI_MENU_SENT">SENT</Entry>
    <Entry Name="GUIMailWindow">triadmail 2.0</Entry>
    <Entry Name="GUIMailASimon">triadtimes@email.net</Entry>

    <Entry Name="GUI_EMAIL_SUBJ1">Test Subject</Entry>
    <Entry Name="EMAIL_1_FROM">Statyk</Entry>
    <Entry Name="EMAIL_1_SUBJ">Test Subject</Entry>
    <Entry Name="EMAIL_1_DATE">27 September 2015</Entry>
    <Entry Name="EMAIL_1_BODY">Test</Entry>
  </CATEGORY>
</LANGUAGE>


The bit of code for the terminal in my map looks like this:

Spoiler below!

#include "helper_imgui_urban.hps"

void Laptop_OnGui(const tString&in asEntityName, float afTimeStep)
{
    UrbanGui_Unbranded_DrawBackdrop(1.0f);
    UrbanGui_PACE_DrawDesktopIcons(2.0f);

    ImGui_SetTransCategory("Emails");
        
    Depth_ImGui_AddMail("GUI_EMAIL_SUBJ1", "EMAIL_1_BODY", "EMAIL_1_FROM", "EMAIL_1_DATE", eMailAppEntryType_Inbox);
    UrbanGui_MailApp("GUIMailASimon", "MailSent_ApartmentEmail", "Mail_SelectionChanged");
}


When I load the map from the mod launcher and use the terminal my text will show up but not the "default" text like From, Subject, Date, Inbox, Drafts, or Sent. Picture.

When I load from the SomaDev.bat and use the terminal I get the default text, but not my own. Picture.

I noticed in Dev mode it tells me it can't find the language file category "Emails". I also found the UrbanGUI category in the main english.lang, copying that over fixed the first issue. I guess what I need help with is getting dev mode to load up or recognize my own english.lang from the mods directory. Any ideas?

(This post was last modified: 09-30-2015, 12:18 AM by triadtimes.)
09-28-2015, 04:26 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Language Files in Dev Mode

Have you got a resources.cfg file pulling information from SOMA's config/lang?

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 09-28-2015, 06:33 AM by Romulator.)
09-28-2015, 06:33 AM
Find
triadtimes Offline
Senior Member

Posts: 508
Threads: 16
Joined: Jan 2011
Reputation: 21
#3
RE: Language Files in Dev Mode

My resources.cfg file currently looks like:

Spoiler below!

<Resources>
  <Directory Path="/assets" AddSubDirs="true"/>
  <Directory Path="/config" AddSubDirs="true"/>
  <Directory Path="/script" AddSubDirs="true"/>
  <Directory Path="/maps" AddSubDirs="true"/>
  
  <Directory Path="/mods/my_mod/config" AddSubDirs="true"/>
  <Directory Path="/mods/my_mod/config/lang_main" AddSubDirs="true"/>
</Resources>


I guess I'm having trouble understanding directory paths. In the above, is it based off of the redist folder or the folder my resources.cfg is in? If it's the later, how would I tell it to go back to redist?

That aside, my problem might be that my dev environment isn't set up properly. Loading up SomaDev.bat actually doesn't load my map, it loads a blank and from there I load map1.map. Would that make a difference? Relevant part of Dev_user_setting.cfg looks like:

Spoiler below!

<Map File="map1.map" Folder="mods/my_mod/" StartPos="PlayerStartArea_1" />


09-28-2015, 06:38 PM
Find
triadtimes Offline
Senior Member

Posts: 508
Threads: 16
Joined: Jan 2011
Reputation: 21
#4
RE: Language Files in Dev Mode

Something that I have also found is that when I reload the game using F5/the debug console terminals act differently. If I reload the game while using SomaDev.bat to test adding or removing emails then the changes will go through, however, if I reload the game using the mod launcher version my changes will not go through until I fully restart the mod.

I guess this (and my original issue) is because SomaDev.bat uses the an edited version of the original Soma main_int.cfg and my mod would use it's own main_int.cfg. Maybe the convention for naming files or folders is location specific? e.g. when the original main_int.cfg says BaseLanguageFolder = "config/" it means redist/config/, whereas when my mod's main_int.cfg says BaseLanguageFolder = "config/" it means mymod/config/.

Thoughts?

EDIT: Just tried changing the settings for SomaDev.bat to point to my mod's main_int.cfg using

Soma.exe -user Dev -cfg mods/triad_test/config/main_init.cfg

It loaded up a new instance of the game (i.e. put me back to fullscreen, had me pick gamma settings). After hitting New Game and after the loading brain icon disappeared I was stuck on a black screen with the loading ambient noises. I couldn't move, turn on flashlight, open up the escape menu. After about a minute I shut it down using the task manager.

(This post was last modified: 09-29-2015, 06:18 PM by triadtimes.)
09-29-2015, 06:10 PM
Find
triadtimes Offline
Senior Member

Posts: 508
Threads: 16
Joined: Jan 2011
Reputation: 21
#5
RE: Language Files in Dev Mode

Alright, I got it.

My original issue was that in SomaDev.bat mode it wouldn't load my english.lang file, but in ModLauncher mode it wouldn't load the original english.lang file. As I found out, the parts of the terminal for FROM, DATE, SUBJECT, SENT, etc. are held in the game's original english.lang, meaning if you want to use them in a mod you have to find them and transfer them over into your mod's english.lang.

This, however, only solved the problem of having the ModLauncher version having missing text, my SomaDev.bat version still wouldn't load my mod's english.lang. After fiddling around in .cfgs, .bats, and a bunch of other files I found out how to make it all work, how to make your mod's english.lang show up in SomaDev.bat (also, how to make SomaDev.bat actually load the level you want and not pitch black).

So here it is: triadtimes' how to set up a dev environment 101.
(This is assuming you are creating a mod in a folder along the lines of redist/mods/mymod/)

After running SomaDev.bat the first time please sit still. DO NOT (as the wiki suggests) CHANGE YOUR dev_user_settings.cfg. Well, you can, just not the change start map part.

Now that SomaDev.bat has run once, check redist/config/ for a file called main_int_dev.cfg. This is the file that will help you out, this is where you should change the map start location (very bottom), an example will look like:

Spoiler below!

<StartMap
    File = "map1.hpm"
    Folder = "mods/mymod/maps/"
    Pos = "PlayerStartArea_1"
/>


Now, to make your .lang file actually useful! At this point it looks like you can do one of two things 1) find resources.cfg in the redist/ folder and add the line

<Directory Path="/mods" AddSubDirs="true" />

and then save. Or, 2) you can change the line in main_int_dev.cfg that points to a resource file to point to your resource file in your mod, just make sure the one in your mod also has the directory path "/mods" in it.

That's pretty much it! The issue was that resources.cfg did not have a directory for the "mods" folder.

Of course this is only the dev environment, when it comes time to test/ship your mod make sure your mod's own main_int.cfg and resources.cfg are set up correctly.

09-30-2015, 12:16 AM
Find




Users browsing this thread: 2 Guest(s)