Frictional Games Forum (read-only)

Full Version: Terminal doesn't like to show up.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So i've tried to create a terminal (the second one in my map) and the first one works fine but the second one flat out doesn't render anything. Sometimes it renders the text for about a millisecond and then goes back no nothing. My code is the exact same except for the method title. I can't figure this out. I'm using the model "computer_panel_medium_GUI.ent".
What is the wording in the terminals' respective OnGui callback fields in the level editor, and what is the code for your GUI functions?
Working Gui

computer_structurecontrol_1_OnGui

void computer_structurecontrol_1_OnGui(const tString&in asEntityName, float afTimeStep)
{

cImGuiLabelData labelText;
cImGuiLabelData labelNumber;

labelText.mFont.mvSize = cVector2f(50, 50);
labelNumber.mFont.mvSize = cVector2f(50, 50);

//labelNumber.mColorText = cColor(0.9, 0.25, 0.15, 1.0);

ImGui_DoLabelExt("Air Quality", labelText, cVector3f(160, 180, 0));
ImGui_DoLabelExt("86%", labelNumber, cVector3f(220, 230, 0));

}

Non working

security_terminal_OnGui

void security_terminal_OnGui(const tString&in asEntityName, float afTimeStep)
{

cImGuiLabelData labelText;

labelText.mFont.mvSize = cVector2f(50, 50);

ImGui_DoLabelExt("test", labelText, cVector3f(160, 180, 0));

}
Running that code results in two working terminals on my end.
Spoiler below!
[Image: ?interpolation=lanczos-none&output-forma...olor=black]

Check your other terminal settings. These are the values I have as default:

Code:
OnGuiFunction: "security_terminal_OnGui"
EnterCallback: ""
LeaveCallback: ""

ShowMouse: Checked
AllowInteraction: Unchecked
UpdateWhenOutOfView: Unchecked
GuiActive: Checked

CacheAtScreenSize: 0.05f
PlayerPosEntity: ""
FPSWhenIdle: 30

TerminalColorMul: White
TerminalBrightness: 1
VerticalFOV: 70

Is there any other code interacting with your terminal entities?
(11-29-2015, 07:23 PM)Abion47 Wrote: [ -> ]Running that code results in two working terminals on my end.
Spoiler below!
[Image: ?interpolation=lanczos-none&output-forma...olor=black]

Check your other terminal settings. These are the values I have as default:

Code:
OnGuiFunction: "security_terminal_OnGui"
EnterCallback: ""
LeaveCallback: ""

ShowMouse: Checked
AllowInteraction: Unchecked
UpdateWhenOutOfView: Unchecked
GuiActive: Checked

CacheAtScreenSize: 0.05f
PlayerPosEntity: ""
FPSWhenIdle: 30

TerminalColorMul: White
TerminalBrightness: 1
VerticalFOV: 70

Is there any other code interacting with your terminal entities?

I made sure the settings were the same and I put a debug message in the method and it prints to the debug console many times a second. I guess I should mention the working terminal use the model computer_structurecontrol.ent and the non-working one uses computer_panel_medium_GUI.ent
(11-29-2015, 11:26 PM)mysteryman141 Wrote: [ -> ]I made sure the settings were the same and I put a debug message in the method and it prints to the debug console many times a second. I guess I should mention the working terminal use the model computer_structurecontrol.ent and the non-working one uses computer_panel_medium_GUI.ent

That shouldn't really matter, but in this case for my demo I used computer_panel_medium_GUI for both terminals, so the issue isn't with the entity itself. (Unless you've tried to edit the entity file, that is.)

Would you mind sending me a PM with a zip of the whole map file? I'm running out of ideas of what it could possibly be, and I'm starting to suspect that it might be a simple error with how the map files were saved or something.

Okay, I think I know what's going on. Something in either your script or in one of the world entities is overriding your TransCategory and not resetting it back. When I changed the terminal code to the following it started working for me:

Code:
void panel_OnGui(const tString&in asEntityName, float afTimeStep)
{
    cLux_AddDebugMessage("screen");
    cImGuiLabelData labelText;
        
    labelText.mFont.mvSize = cVector2f(50, 50);

    ImGui_SetTransCategory("");
    ImGui_DoLabelExt("test", labelText, cVector3f(160, 180, 0));
}
(11-30-2015, 01:26 AM)Abion47 Wrote: [ -> ]
(11-29-2015, 11:26 PM)mysteryman141 Wrote: [ -> ]I made sure the settings were the same and I put a debug message in the method and it prints to the debug console many times a second. I guess I should mention the working terminal use the model computer_structurecontrol.ent and the non-working one uses computer_panel_medium_GUI.ent

That shouldn't really matter, but in this case for my demo I used computer_panel_medium_GUI for both terminals, so the issue isn't with the entity itself. (Unless you've tried to edit the entity file, that is.)

Would you mind sending me a PM with a zip of the whole map file? I'm running out of ideas of what it could possibly be, and I'm starting to suspect that it might be a simple error with how the map files were saved or something.

Okay, I think I know what's going on. Something in either your script or in one of the world entities is overriding your TransCategory and not resetting it back. When I changed the terminal code to the following it started working for me:

Code:
void panel_OnGui(const tString&in asEntityName, float afTimeStep)
{
    cLux_AddDebugMessage("screen");
    cImGuiLabelData labelText;
        
    labelText.mFont.mvSize = cVector2f(50, 50);

    ImGui_SetTransCategory("");
    ImGui_DoLabelExt("test", labelText, cVector3f(160, 180, 0));
}
Hey it works! Thanks so much for your help!