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
Script Help Is it possible to set a message through a string variable?
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#9
RE: Is it possible to set a message through a string variable?

PHP Code: (Select All)
// lang file
<CATEGORY Name="Messages">
        <
Entry Name="CatMessage">I have a cat</Entry>
</
CATEGORY>

// script
SetLocalVarString("StringVar""CatMessage")
SetMessage("Messages"GetLocalVarString("StringVar"), 0); 

...would work. As long as the 2nd parameter is a string that points to a lang file entry, not the content itself.


Edit - Mr Mudbill beat me to it, but we're pretty much saying the same thing.


Edit Edit:

There's nothing stopping you from doing something like this:
PHP Code: (Select All)
// lang file
<CATEGORY Name="Messages">
        <
Entry Name="CatYes">I have a cat</Entry>
        <
Entry Name="CatNo">I dont have a cat</Entry>
</
CATEGORY>

// script
string GotCat "No";
SetMessage("Messages""Cat"+GotCat0); 

(This post was last modified: 08-30-2014, 06:09 PM by MrBehemoth.)
08-30-2014, 06:02 PM
Find


Messages In This Thread
RE: Is it possible to set a message through a string variable? - by MrBehemoth - 08-30-2014, 06:02 PM



Users browsing this thread: 1 Guest(s)