SOM file

From Wiki

Jump to: navigation, search
(SET file link→‎Anatomy)
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
A [[SOM file]] is recognized by it's .som [[Wikipedia:filename extension|filename extension]]. It is the most iconic of files related to [[Sword of Moonlight: King's Field Making Tool]] owing it's initials to '''S'''word '''o'''f '''M'''oonlight itself.  
+
A [[SOM file]] is recognized by it's .som [[Wikipedia:filename extension|filename extension]]. It is the most iconic of files unique to [[Sword of Moonlight: King's Field Making Tool]] owing its initials to '''S'''word '''o'''f '''M'''oonlight itself.  
  
 
==History==
 
==History==
'''SOM''' originated as a two line [[Wikipedia:text file|text file]] associated with a Sword of Moonlight project folder. The programs [[SOM_MAIN]] and [[SOM_RUN]] prompt the user to open the SOM file in order to work with a project. Beyond its obvious utility as a media file. since 2013 software that extends Sword of Moonlight had begun to prescribe additional meaning to the file's text, and a day may yet come when a Sword of Moonlight game may be rolled up into a single compressed SOM file that could be as ubiquitous as [[Wikipedia:MP3|MP3]]s.
+
'''SOM''' originated as a two line [[Wikipedia:text file|text file]] associated with a Sword of Moonlight project folder. The programs [[SOM_MAIN]] and [[SOM_RUN]] prompt the user to open the SOM file in order to work with a project. Beyond its obvious utility as a media file, since 2013 software that extends Sword of Moonlight had begun to prescribe additional meaning to the file's text, and a day may yet come when a Sword of Moonlight game can be rolled up into a single compressed SOM that could even become as ubiquitous as [[Wikipedia:MP3|MP3]]s.
  
 
==Anatomy==
 
==Anatomy==
When a new Sword of Moonlight project is made by [[SOM_MAIN]] a '''SOM file''' is created inside the project [[Wikipedia:File directory|folder]]. You can open this file up with any [[Wikipedia:Text editor|Text editor]]. The first line of the newly created file will name the folder it was created in. The second line is a single 0.
+
When a new Sword of Moonlight project is made by [[SOM_MAIN]] a '''SOM file''' is created inside the project [[Wikipedia:File directory|folder]]. You can open this file up with any [[Wikipedia:Text editor|text editor]]. The first line of the newly created file will name the folder it was created in. The second line is a single 0:
 +
 
 +
King's Field
 +
0
  
  
Line 20: Line 23:
 
|CD||changes directories in cases where the SOM file is located outside of its game's folder.
 
|CD||changes directories in cases where the SOM file is located outside of its game's folder.
 
|-
 
|-
|DATA||specifies multiple data folders.  
+
|DATA||specifies multiple data folders. In addition to USER/data and CD/data.
 
|-
 
|-
|USER||Data is looked for first in USER/data, then CD/data, and only then DATA.
+
|DATASET||specifies a [[SET file|set]] of profiles (eg. [[PRF]] and [[PRT file]]s) to be included by the project.
 
|-
 
|-
|TRIAL||specifies the name of a map file where a new game takes place. Ostensibly for testing purposes.
+
|USER||overrides the [[Wikipedia:computer file|computer file]]s of CD. Games save their files to USER.
 
|-
 
|-
 
|SCRIPT||specifies either a .mo [[Wikipedia:Gettext|Gettext]] file or a folder housing a [[lang]] and or [[font]] folder.
 
|SCRIPT||specifies either a .mo [[Wikipedia:Gettext|Gettext]] file or a folder housing a [[lang]] and or [[font]] folder.
Line 30: Line 33:
 
|FONT||specifies a list of font files and or font folders.
 
|FONT||specifies a list of font files and or font folders.
 
|-
 
|-
|Ex.ini||specifies a list of Ex.ini configuration files.
+
|INI||specifies a single in-game options [[INI file|INI]] configuration file.
 +
|-
 +
|TRIAL||specifies the name of a map file where a new game takes place. Ostensibly for testing purposes.
 +
|-
 +
|SETUP||selects from the player setup menu. Historically either 1 or 2 of [[SOM_SYS]].
 +
|-
 +
|EX||specifies a list of [[SomEx]] [[INI file|INI]] extension configuration files.
 +
|-
 +
|ICON||specifies a game window and [[SOM]] [[Wikipedia:computer icon|computer icon]].
 +
|-
 +
|TEXT||specifies a list of language/theme pack folders for use by the editing tools.
 +
|-
 +
!Environment Constant||these "variables" are mainly for substitution<div style="font-weight:100">(care should be taken before overriding)</div>
 +
|-
 +
|PLAYER||the player's save folder. For example, the Saved Games folder on Windows Vista.
 +
|-
 +
|TITLE||the title part of the file used to initiate the current game.
 +
|-
 +
|SOM||the full file system path to the [[SOM]] file.
 
|}
 
|}
  
  
Each variable is written on its own line, including an equal sign, and the text value to be assigned to the variable to the right of the equal sign. All written on a single line, not unlike an [[Wikipedia:INI file|INI file]]. Like so:  
+
Each variable is written on its own line, including an equal sign, and the text value to be assigned to the variable to the right of the equal sign. All written on a single line, not unlike an [[Wikipedia:INI file|INI file]]:
  
 
  TRIAL=00
 
  TRIAL=00
  
  
As with an [[Wikipedia:batch file|MS-DOS batch file]], variables should be able to be substituted inside of other variables by surrounding them by percent signs. Like so:
+
As with an [[Wikipedia:batch file|MS-DOS batch file]], variables should be able to be substituted inside of other variables by surrounding them by percent signs:
  
 
  DATA=%USERPROFILE%\data; %DATA%
 
  DATA=%USERPROFILE%\data; %DATA%
Line 46: Line 67:
 
However, this is where the similarity to MS-DOS batch files end.
 
However, this is where the similarity to MS-DOS batch files end.
  
Lines beginning with semicolons are ignored like so:
+
Lines beginning with semicolons are ignored:
  
 
  ;This is a comment demonstrating comments
 
  ;This is a comment demonstrating comments
 +
<br/>
  
 
+
==Subpages==
<fieldset><legend>
+
{{sublist}}
===Sets===
 
</legend>A nonstandard extension allows lines beginning with + or - or | include individual profiles (eg. [[PRF]] and [[PRT file]]s) and or sets of profiles. Like so:
 
 
 
;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 file]]s taken from the data folders. If a single + or - statement appears then <u>only</u> 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 it's 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. Like so:
 
 
 
;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 grouping parentheses are not recognized, only + - | / and ;.</fieldset>
 
  
 
[[Category:Sword of Moonlight]]
 
[[Category:Sword of Moonlight]]

Latest revision as of 23:04, 23 July 2023

A SOM file is recognized by it's .som filename extension. It is the most iconic of files unique to Sword of Moonlight: King's Field Making Tool owing its initials to Sword of Moonlight itself.

History[edit]

SOM originated as a two line text file associated with a Sword of Moonlight project folder. The programs SOM_MAIN and SOM_RUN prompt the user to open the SOM file in order to work with a project. Beyond its obvious utility as a media file, since 2013 software that extends Sword of Moonlight had begun to prescribe additional meaning to the file's text, and a day may yet come when a Sword of Moonlight game can be rolled up into a single compressed SOM that could even become as ubiquitous as MP3s.

Anatomy[edit]

When a new Sword of Moonlight project is made by SOM_MAIN a SOM file is created inside the project folder. You can open this file up with any text editor. The first line of the newly created file will name the folder it was created in. The second line is a single 0:

King's Field
0


In 2013, as part of the SomEx project effort to extend Sword of Moonlight's tools to be able to work out of more than one data folder—not unlike the som_db game testing program—it was concluded that the SOM file should be able to define some environment variables for the project. The following variables were initially decided upon:

Environment Variable Overview
GAME equivalent to the first line of the classical SOM file.
DISC equivalent to the second line of the classical SOM file.
CD changes directories in cases where the SOM file is located outside of its game's folder.
DATA specifies multiple data folders. In addition to USER/data and CD/data.
DATASET specifies a set of profiles (eg. PRF and PRT files) to be included by the project.
USER overrides the computer files of CD. Games save their files to USER.
SCRIPT specifies either a .mo Gettext file or a folder housing a lang and or font folder.
FONT specifies a list of font files and or font folders.
INI specifies a single in-game options INI configuration file.
TRIAL specifies the name of a map file where a new game takes place. Ostensibly for testing purposes.
SETUP selects from the player setup menu. Historically either 1 or 2 of SOM_SYS.
EX specifies a list of SomEx INI extension configuration files.
ICON specifies a game window and SOM computer icon.
TEXT specifies a list of language/theme pack folders for use by the editing tools.
Environment Constant these "variables" are mainly for substitution
(care should be taken before overriding)
PLAYER the player's save folder. For example, the Saved Games folder on Windows Vista.
TITLE the title part of the file used to initiate the current game.
SOM the full file system path to the SOM file.


Each variable is written on its own line, including an equal sign, and the text value to be assigned to the variable to the right of the equal sign. All written on a single line, not unlike an INI file:

TRIAL=00


As with an MS-DOS batch file, variables should be able to be substituted inside of other variables by surrounding them by percent signs:

DATA=%USERPROFILE%\data; %DATA%


However, this is where the similarity to MS-DOS batch files end.

Lines beginning with semicolons are ignored:

;This is a comment demonstrating comments


Subpages[edit]