Frictional Games Forum (read-only)
Terminals. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: SOMA (https://www.frictionalgames.com/forum/forum-55.html)
+--- Forum: User created content (https://www.frictionalgames.com/forum/forum-79.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-80.html)
+---- Thread: Terminals. (/thread-43652.html)

Pages: 1 2 3


Terminals. - Hypercube - 03-31-2016

I think I'm getting a tiny bit better at them, or at least understand it. But I need help. How do you get the ImGui_SetTransCategory("insert name here") to connect with your lang file? For example, mine is "computer bedroom", I have the language file, but how do you connect the script to the lang file? Is there a preprocessor, a helper of some sort? I included the correct stuff in my resources file, so I'm not sure by this point. I'm not too good with this stuff.

Huh


RE: Terminals. - Abion47 - 03-31-2016

It sounds like you've already done most of it, so all that's left is to call ImGui_SetTransCategory at the beginning of your terminal's OnGui function. Make sure that you have #include "helpers/helper_imgui.hps" at the top of your map script. If it still doesn't work, try replacing the spaces in your lang file categories with underscores (none of the SOMA lang files have spaces in the category names, so maybe spaces aren't supported).


RE: Terminals. - Hypercube - 03-31-2016

(03-31-2016, 09:34 PM)Abion47 Wrote: It sounds like you've already done most of it, so all that's left is to call ImGui_SetTransCategory at the beginning of your terminal's OnGui function. Make sure that you have #include "helpers/helper_imgui.hps" at the top of your map script. If it still doesn't work, try replacing the spaces in your lang file categories with underscores (none of the SOMA lang files have spaces in the category names, so maybe spaces aren't supported).
So I already have the gui helper, and I am using underscores. What could be the problem?
here's what I have for the terminal:
void computer_bedroom_OnGui(const tString&in asEntityName, float afTimeStep)
{
ImGui_SetTransCategory("computer_bedroom");

//Background
StationGuiBG_Scanlines();
StationGuiBG_Taskbar("theta");

int lActiveApp = StationGui_GetActiveApp(eComputerTerminalApp_MainMenu);
bool bBackButton = true;
switch(lActiveApp)
{
case eComputerTerminalApp_MainMenu:
StationGui_AddApp("Containment Status",true,eComputerTerminalApp_Containment);
StationGui_AddApp("Test Subject #26",false,eComputerTerminalApp_TestSubject);
StationGui_AddApp("Test Subject #37",true,eComputerTerminalApp_TestSubject);
StationGui_MainMenu();
bBackButton = false;
break;

case eComputerTerminalApp_Containment:
StationGui_TextReaderSingle("TerminalLogCaption","TerminalLog");
bBackButton = true;
break;

case eComputerTerminalApp_TestSubject:
StationGui_TextReaderSingle("TestSubjectCaption","TestSubject");
bBackButton = true;
break;
}
StationGui_BackButton(bBackButton);
}


RE: Terminals. - Abion47 - 03-31-2016

What does your lang file look like?


RE: Terminals. - Hypercube - 03-31-2016

(03-31-2016, 10:41 PM)Abion47 Wrote: What does your lang file look like?
Just so you know, in the add app section of the script, I put the whole name there because I wanted to figure this out first then change the name.

Lang file:
<LANGUAGE>

<RESOURCES>
<Directory Path="fonts/" />
<Directory Path="lang/eng" />
</RESOURCES>

<CATEGORY Name="computer_bedroom">
<Entry Name="TerminalApp_Containment">Containment Status</Entry>
<Entry Name="TerminalApp_Document">Test Subject #37</Entry>
<Entry Name="TerminalLogCaption">Containment Status:</Entry>
<Entry Name="TerminalLog">All entrances sealed, preparing to lock chamber doors...[br]//ERROR [Security systems inactive][br]Containment breach! Initiating emergency lockdown![br]Attempt failed, restarting lockdown...[br]//ERROR [Door control inactive][br]Awaiting further command...</Entry>
<Entry Name="TestSubjectCaption">Subject Report #37</Entry>
<Entry Name="TestSubject"></Entry>
</CATEGORY>

</LANGUAGE>

I'm assuming this would be the file with the problem in it.


RE: Terminals. - Abion47 - 04-01-2016

When you change the lang file you are using with ImGui_SetTransCategory, anything you put in the text parameter of the app functions (such as StationGui_AddApp) will be interpreted as an entry in that lang file rather than as plain text. So you are basically telling SOMA that you want it to use the text in the entry "Containment Status" in your lang file, but since no such entry exists, I imagine that you are getting apps with no text at all.

If you want to use plain text, then use ImGui_SetTransCategory(""). Otherwise, you have to give the functions the names of the entries you want it to use, not the text inside them.


RE: Terminals. - Hypercube - 04-01-2016

(04-01-2016, 05:58 AM)Abion47 Wrote: When you change the lang file you are using with ImGui_SetTransCategory, anything you put in the text parameter of the app functions (such as StationGui_AddApp) will be interpreted as an entry in that lang file rather than as plain text. So you are basically telling SOMA that you want it to use the text in the entry "Containment Status" in your lang file, but since no such entry exists, I imagine that you are getting apps with no text at all.

If you want to use plain text, then use ImGui_SetTransCategory(""). Otherwise, you have to give the functions the names of the entries you want it to use, not the text inside them.

I figured that was the problem once you started talking about the add app functions. I knew I had to put the entry names but I didn't think that was the problem. I'll try it and see if it works.

(04-01-2016, 10:02 PM)Hypercube Wrote:
(04-01-2016, 05:58 AM)Abion47 Wrote: When you change the lang file you are using with ImGui_SetTransCategory, anything you put in the text parameter of the app functions (such as StationGui_AddApp) will be interpreted as an entry in that lang file rather than as plain text. So you are basically telling SOMA that you want it to use the text in the entry "Containment Status" in your lang file, but since no such entry exists, I imagine that you are getting apps with no text at all.

If you want to use plain text, then use ImGui_SetTransCategory(""). Otherwise, you have to give the functions the names of the entries you want it to use, not the text inside them.

I figured that was the problem once you started talking about the add app functions. I knew I had to put the entry names but I didn't think that was the problem. I'll try it and see if it works.
It's still not working. Maybe the problem could be that how the break is [br] in the brackets. So how one of the entries has something like [security systems down] It's reading it as a wrong command of sorts? I'm not sure.
Edit: It still doesn't work.


RE: Terminals. - Abion47 - 04-01-2016

I probably should have asked this first, but what exactly is it doing now?


RE: Terminals. - Hypercube - 04-01-2016

(04-01-2016, 10:12 PM)Abion47 Wrote: I probably should have asked this first, but what exactly is it doing now?
Still nothing. No words, same effect as usual


RE: Terminals. - Abion47 - 04-01-2016

Also, how are you storing the values in your lang file? Are you adding to an existing file or creating a new one?