Frictional Games Forum (read-only)
Display Var? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Display Var? (/thread-49870.html)



Display Var? - kalama - 06-18-2016

Is there a way to display a variable. i tried to go to extra english.lang file and write
String("MY VAR") put nö wörk


RE: Display Var? - Romulator - 06-18-2016

You need to set individual values in your lang file for each possible String, and use a String Variable to keep track of it. You can modify the variable using SetLocalVarString();, and use GetLocalVarString(); to call the value to pass into SetMessage();.

Keep in mind, you cannot, in the lang file, do something like this. If you did, it would display that message exactly.

Code:
<Entry Name="check_bottle">I still need to find the GetLocalVarString("bottle"); before I can progress.</Entry>

Here's a basic example of what you can do using Set's and Gets, along with Timers to display the message.

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

extra_english.lang
Code:
<CATEGORY Name="Messages">
<Entry Name="value">This is your message.</Entry>
<Entry Name="value_2">This is another message.</Entry>
</CATEGORY>

level.hps
PHP Code:
void OnStart()
{
    
SetLocalVarString("StringVar""value");
    
AddTimer(""5.0f"DisplayMsg1");
    
AddTimer(""10.0f"DisplayMsg2");
}

void DisplayMsg1(string &in asTimer)
{
    
SetMessage("Messages"GetLocalVarString("StringVar"), 2.0f);
    
SetLocalVarString("StringVar""value_2");
}

void DisplayMsg2(string &in asTimer)
{
    
SetMessage("Messages"GetLocalVarString("StringVar"), 2.0f);




Thänks - kalama - 06-18-2016

Ok. thank you very much Smile


RE: Display Var? - Romulator - 06-18-2016

No problem! I also recommend making an account and posting in the Amnesia Development Support subforum in future, since Technical Support is for problems with the unmodified game.

Moving. Smile