list of environment variables

From Wiki

Jump to: navigation, search
Line 27: Line 27:
  
 
==Information==
 
==Information==
These variables are not variables as such as assigning values to them accomplishes nothing special. Though it is likely possible to do so. They are simply informational. If you do not substitute them into other variables by way of surrounding them in percent signs they will not be otherwise used for any other purpose.
+
These variables are not variables as such as assigning values to them accomplishes nothing special. In other words these are simply informational variables. If you do not substitute them into other variables by way of surrounding them in percent signs they will not be otherwise used for any other purpose.
  
 
===PLAYER===
 
===PLAYER===

Revision as of 21:58, 22 August 2013

Note that while this article is divided into sections, the SOM file itself is not. It is essentially an INI file but were it actually such it would be an INI file without sections. It is best to think of it as a radically simplified BAT file where environment variable assignment eschews the SET command and nothing else works. Refer back to SOM file.

It should be possible to spread variables across multiple lines by recognizing an = followed by nothing as the beginning of a multiple line assignment. Assignment should continue until a line comprised of nothing or all spaces is encountered. Many variables that accept file system addresses should support multiple addresses separated by ; or the end of a line. An address should not be allowed to spread itself across multiple lines, however multiple addresses may be spread across multiple lines.

Care should be taken to leave the first line after an = in a multiple line assignment blank, or else it should be interpreted as a single line assignment.

;An example SOM file should appear in this space.


Identification

GAME and DISC are unique in representing the original content of the .SOM file. If the first or second line does not begin with a ; or contain an = then they should be interpreted as assignment to GAME and DISC respectively.

GAME

GAME is a label used to identify a physical or virtual media, such as a compact disc. It does not have to be a legal file name, but if it is to be used elsewhere, it ought to be.

If #CD is used to change to a physical or virtual drive with SOM files, then the first file should be checked to ensure that GAME and #DISC match. If they do not then the user will be advised that the incorrect media may be inserted into CD. It is acceptable to not look beyond the first two lines of the SOM file that is being checked against.

DISC

DISC is used for an additional level of virtual disc identification. It could be changed for every variant of a disc. Or even made unique for ever printing of a disc. Refer to #GAME.

Information

These variables are not variables as such as assigning values to them accomplishes nothing special. In other words these are simply informational variables. If you do not substitute them into other variables by way of surrounding them in percent signs they will not be otherwise used for any other purpose.

PLAYER

PLAYER communicates the player's folder. This may be a setting or a default folder, for example the Saved Games folder of Window's Vista. Note that the folder itself is not specific to the game or project. Neither is it the literal save folder:

;on Windows Vista the save folder will be Saved Games/King's Field/save
GAME=King's Field
USER=%PLAYER%/%GAME%


Work & play

These variables establish from where the project or game draws its profiles: eg. PRF and PRT files. Where no profile exists or no profile is discovered files should be searched for according to the classical Sword of Moonlight data directory layout.

Data should be searched for in the following order: #USER/data, #CD/data, #DATA. Generally speaking CD is the top-level game folder. DATA is additional data folders, chiefly of utility to project developers. USER/data should be reserved for use by players and solely for the purpose of customizing the profiles of a game that they are busy playing.

Profiles should be discovered within each and every folder below the data folders including the data folders themselves. If #DATASET exists then only profiles mentioned by SET files should be included.

CD

CD should initially be assigned to the folder of the SOM file. If it is assigned to the game's top-level folder changes. In this way a game's files are not required to be in the same folder as the SOM file. The file may be anywhere that is convenient, for example, near the player's save game files. If the game is stored on a read-only media, for instance, a CD-ROM, then it's SOM file and other files could not be modified. By copying the SOM file to another folder it can then be modified. A read-only game may do so automatically when creating its save game folder.

Technically you should be able to assign multiple addresses to CD, however only the last one should be used as the game's final resting place. If there is a SOM file located in the final address of CD, the first two lines of one of them should be matched against the #GAME and #DISC variables. If there is a mismatch the player should be prompted to confirm this. It may be that the wrong CD-ROM is inserted, or a simple clerical error.

USER

USER does not exist initially. If it is not assigned to a folder then #CD should be used unless it is a read-only folder, in which case a default folder that is suitable for save games and customization should be used in its stead.

DATA

DATA should initially be assigned to the system wide Sword of Moonlight data folder where Sword of Moonlight is installed. Except for standalone retail games which should initially assign DATA to an empty yet not nonexistent value, such that K%DATA%F becomes simply KF nothing in between.

DATASET

This is in need of a rewrite

Sets allow lines beginning with + or - or | include individual profiles and or sets of profiles:

;include short swords found within the Cemetery
+Cemetery 
|short swords

A | line continues a + or - line. It is equivalent to appending each | line to the end of the + or - line. In other words the example above is equivalent to:

;include short swords found within the Cemetery
+Cemetery short swords

A - line is an exclusion statement. Comment lines can appear above or below | lines without terminating a + or - statement spread over multiple lines.

The words of a + or - statement are found among SET files taken from the data folders. If a single + or - statement appears then only profiles named by SET files can be included in the project.

In place of the name of a set, a single profile can be indicated by its file name. This name must include a file extension. If a name has a period it is considered to be a profile and not a set. If two profiles have the same name but are different file formats, then a set must be indicated in addition to the profile in order to differentiate the files.

Finally, instead of an empty space, a / may be used to separate sets. Where a space yields an intersection of two sets, a / yields a union:

;include both short and long swords found within the Cemetery
+Cemetery short/long swords

All / separates are considered before empty space separators. Just as 3*3+4*4 is usually interpreted to mean (9)+(16) and not ((9)+4)*4. (Note that the grouping parentheses are for illustration purposes only.)

Translation

SCRIPT

FONT

Playtesting

TRIAL

Extending

Ex.ini