Frictional Games Forum (read-only)

Full Version: Display Var?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

kalama

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
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);

kalama

Ok. thank you very much Smile
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