The binaries are built for Linux, but to run Stalker CoP on your PC, we need to modify a file. To start, CD into the game directory and delete the existing “fsgame.ltx” file. Cd /.wine/drivec/GOG Games/Stalker-CoP rm fsgame.ltx. Next, copy the newly created fsgame.ltx file into the Stalker CoP directory. I have tried making a.cmd file with 'start bin/xrEngine.exe' in it, still crashed. I have tried copying my bin folder's contents to the CoC directory, still crashes when I run both xrEngine.exe and Stalker-CoC.exe. CoC directory is not the same as my CoP directory, and I checked fsgame.ltx.
From Mod Wiki
Instead of creating more and more variables in scripts, you can use ltx files to store your variables (actually constants to be exact) and then load them in a convenient way. This article is about creating/editing ltx files and reading its contents via script.
Ltx file structure
Stalker Call Of Pripyat Cannot Open File Fsgame.ltx Fix
Ltx files are actually simple text files with an INI file structure. Each file is divided into sections (unique name), sections contains pairs variables (each variable name inside one section must be unique) and values. To read certain value, you need to know which variable holds it and in which section such a variable is defined. Inheritance between sections is allowed which means you can define one base section and then derive from it. Here is a simple example of ltx file we will use in this article:
As you can see our ltx file defines 5 sections, 2 of them inherits from section artefacts (trivial example for the sake of clarity). Also values of variables inside sections are using basic data types: numbers, boolean values, strings, however by default values are treated as string variables.
Reading ltx file from script
To read variables and values from ltx file Stalker provides class (exported to lua) called ini_file. Here are the methods of this class:
Most of methods has two strings arguments. In that case the first argument is a section name, the second - variable name. Constructor of the ini_file class takes only one argument - path to the ltx file. The main folder where Stalker looks for ltx files is gamedataconfig as it is defined in fsgame.ltx file (variable $game_config$). To read the ltx file, we need to create an object of ini_file class providing the path to our ltx file:
Now we can access our variables using methods from ini_file class:
Above examples are useful if you only want to read one or two variables. If you want to read all the variables from certain section, you can use loop, for instance:
Open File Software
Reading more complex data
read_section() function reads the given section line by line, each line is read as a string value. Our ltx file contains section spawn_vectors. As the name implies, this section holds vectors to spawn objects, for example mutants or npcs. For such objects we need the position to spawn (vector) but also level vertex id and game vertex id. We can read the section using method r_vector, but this function will return only spawn position (vector - first 3 values). However we can read the whole section using function read_section() and then parse the values: