The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Passing Code into a lang entry?
DanielRand47 Away
Member

Posts: 109
Threads: 16
Joined: Mar 2012
Reputation: 3
#1
Passing Code into a lang entry?

Hey guys. I'm looking at possibly having a situation where the player has to make it through a section where the lights are slowly being dimmed due to say a lack of power supply. You have 100% power and slowly drain 1% at intervals of 5 seconds. My question is, to know if there is a way to pass data from the hps file into the lang file which is written in XML.

HPS file code example
PHP Code: (Select All)
int Percentage 100//Class level variable
void OnStart()
{
  
AddTimer("Timer1"5.0f"DimLights");
}

void DimLights(string &in asTimer)
{
  
int PercentageLost 1;
  
Percentage Percentage PercentageLost;

//Some how pass Percentage into lang file.
  
SetMessage("Messages""PowerPercent"3.0f);
  
AddTimer(asTimer5.0f"DimLights");


LANG example
PHP Code: (Select All)
<CATEGORY Name "Messages">
        <
Entry Name "PowerPercent">"Percentage"%</Entry> <!--Percentage would be passed in from the hps file into the lang xml file.-->
</
CATEGORY

Does anyone know how to do this. Pass data from a script file into a XML file (LANG file)

Custom story is TRIAD. https://www.frictionalgames.com/forum/thread-35504.html
(This post was last modified: 02-16-2016, 03:02 AM by Romulator.)
02-16-2016, 12:50 AM
Find


Messages In This Thread
Passing Code into a lang entry? - by DanielRand47 - 02-16-2016, 12:50 AM



Users browsing this thread: 1 Guest(s)