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
Save data
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#5
RE: Save data

As in, where it appears in Frictional Games' code? Of course! Most are probably located in OnStart(); however some change later on in the map. Here's an example from theta_exit.hps, where they have two instances of changing the SetText.

PHP Code: (Select All)
void OnStart()
    {
    
//Unrelated Code Here
    //
        //////Level Audio and Preloads    
        
Sound_PreloadProject("02_07_theta_exit_a");
        
Sound_PreloadGroup("Flashback/Level/02_07"true);
        
        
LastOnSoma_SetText("02_07_theta_exit_1");
    }

    
void SequenceWakeup(const tStringin asName)
    {
    
//There is lots of code here for this sequence. Good job FG! o.0
    //This particular part seems to be when you detach from the wall.
    
Player_SetFlashlightDisabled(false);    
        
    
LastOnSoma_SetText("02_07_theta_exit_2");
    } 

As we can see here, in the first instance, the LastOnSoma_SetText(); string is changed to become an entry called "02_07_theta_exit_1" when entering the map. Which would be located in the config/english.lang file. And sure enough, it is. (Spoilered and removing other entries for obvious reasons).

Spoiler below!
<CATEGORY Name="LastOnSOMAText">
    <Entry Name="02_07_theta_exit_1">Simon is lost somewhere inside Theta, looking for a way out.</Entry>
    <Entry Name="02_07_theta_exit_2">Simon is lost somewhere inside Theta, hunted by strange creatures.</Entry>
</CATEGORY>


I've included the second instance it changes also because it appears that you can change it at any time. Handy!

In a way, it is a global variable, since such text is stored in memory within the save. It is setting the string to display when you hit continue or load game. Here's another example from earlier on in the game (pardon the twitch chat. Sourced from Kreekakon's stream).

Spoiler below!
[Image: f336ef1318.jpg]

This particular string appears in the english.lang file, with this entry.
Spoiler below!
<Entry Name="01_04_transport_station_2">Simon's shuttle has crashed and he now has to find another way to get to Lambda, the place where Catherine, the woman on the radio, is waiting for him.</Entry>


And... well, that's how that particular thing works. The value is saved in memory whenever the game autosaves or the player presses Save and Exit, and is then set for when the Player returns to the game should they need a reminder of where they are.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-19-2015, 11:29 AM
Find


Messages In This Thread
Save data - by Kanthos - 10-18-2015, 01:54 PM
RE: Save data - by Romulator - 10-18-2015, 02:01 PM
RE: Save data - by Kanthos - 10-18-2015, 02:13 PM
RE: Save data - by Kanthos - 10-19-2015, 11:05 AM
RE: Save data - by Romulator - 10-19-2015, 11:29 AM
RE: Save data - by Kanthos - 10-19-2015, 11:53 AM
RE: Save data - by jens - 10-19-2015, 11:58 AM
RE: Save data - by Kanthos - 10-19-2015, 12:32 PM
RE: Save data - by Mudbill - 10-19-2015, 12:37 PM
RE: Save data - by Kanthos - 10-19-2015, 12:40 PM
RE: Save data - by Mudbill - 10-19-2015, 12:41 PM
RE: Save data - by Kanthos - 10-19-2015, 02:24 PM
RE: Save data - by Mudbill - 10-19-2015, 02:35 PM
RE: Save data - by Kanthos - 10-19-2015, 02:45 PM
RE: Save data - by jens - 10-19-2015, 05:22 PM
RE: Save data - by Kanthos - 10-19-2015, 07:44 PM
RE: Save data - by Mudbill - 10-19-2015, 09:31 PM
RE: Save data - by Kanthos - 10-20-2015, 12:41 AM
RE: Save data - by Mudbill - 10-20-2015, 02:20 AM
RE: Save data - by Kanthos - 10-20-2015, 02:39 PM



Users browsing this thread: 4 Guest(s)