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
Display Var?
kalama
Unregistered

 
#1
Display Var?

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
06-18-2016, 02:52 PM
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Display Var?

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.

<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
<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: (Select All)
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);


Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 06-18-2016, 03:34 PM by Romulator.)
06-18-2016, 03:26 PM
Find
kalama
Unregistered

 
#3
Thänks

Ok. thank you very much Smile
06-18-2016, 03:36 PM
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#4
RE: Display Var?

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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
06-18-2016, 04:02 PM
Find




Users browsing this thread: 1 Guest(s)