<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.hard-light.net/index.php?action=history&amp;feed=atom&amp;title=Version-specific_commenting</id>
	<title>Version-specific commenting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hard-light.net/index.php?action=history&amp;feed=atom&amp;title=Version-specific_commenting"/>
	<link rel="alternate" type="text/html" href="https://wiki.hard-light.net/index.php?title=Version-specific_commenting&amp;action=history"/>
	<updated>2026-04-17T15:41:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>https://wiki.hard-light.net/index.php?title=Version-specific_commenting&amp;diff=64343&amp;oldid=prev</id>
		<title>Goober5000: /* Important Note */</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.net/index.php?title=Version-specific_commenting&amp;diff=64343&amp;oldid=prev"/>
		<updated>2022-12-15T02:08:54Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Important Note&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 02:08, 15 December 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l41&quot; &gt;Line 41:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Important Note==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Important Note==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;FRED's support for version-specific comments is limited to what it specifically knows about.&amp;#160; If version-specific comments are used in any place other than the Here Be Dragons lines, the mission will be scrambled if it is loaded in FRED and saved again.&amp;#160; The feature can be useful to enable or disable events depending on the FSO version -- &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;for an &lt;/del&gt;example &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;of this&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;see &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ported &lt;/del&gt;version of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sm2-08, &lt;/del&gt;Playing Judas -- but this requires the version-specific comments to be added in a text editor, and any future mission edits must also be done in a text editor.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;FRED's support for version-specific comments is limited to what it specifically knows about.&amp;#160; If version-specific comments are used in any place other than the Here Be Dragons lines, the mission will be scrambled if it is loaded in FRED and saved again.&amp;#160; The feature can be useful to enable or disable events depending on the FSO version -- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;see the &amp;quot;Expedition&amp;quot; &lt;/ins&gt;example &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;above&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;or &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;FreeSpace Port &lt;/ins&gt;version of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&lt;/ins&gt;Playing Judas&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot; &lt;/ins&gt;-- but this requires the version-specific comments to be added in a text editor, and any future mission edits must also be done in a text editor.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Related Links==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Related Links==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Goober5000</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.hard-light.net/index.php?title=Version-specific_commenting&amp;diff=64341&amp;oldid=prev</id>
		<title>Goober5000: Created page with &quot;'''Version-specific commenting''' is a FSO feature, added in version 3.6.8, that can be used in missions and tables.  This feature allows text data to be enabled or disabled d...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.net/index.php?title=Version-specific_commenting&amp;diff=64341&amp;oldid=prev"/>
		<updated>2022-12-15T02:05:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Version-specific commenting&amp;#039;&amp;#039;&amp;#039; is a FSO feature, added in version 3.6.8, that can be used in missions and tables.  This feature allows text data to be enabled or disabled d...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Version-specific commenting''' is a FSO feature, added in version 3.6.8, that can be used in missions and tables.  This feature allows text data to be enabled or disabled depending on the version of FSO being run.&lt;br /&gt;
&lt;br /&gt;
==Standard Usage==&lt;br /&gt;
Standard comments in text files parsed by FSO are prefixed with a semicolon &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; or two slashes &amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;, and multiline comments are surrounded by C-style tokens &amp;lt;code&amp;gt;/* */&amp;lt;/code&amp;gt; or a similar &amp;lt;code&amp;gt;!* *!&amp;lt;/code&amp;gt;.  But comments adhering to the version-specific format are handled differently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A comment with the format &amp;lt;code&amp;gt;;;FSO 3.6.8;;&amp;lt;/code&amp;gt;, where 3.6.8 is any version number, will cause the rest of the line to be ignored in versions below the specified one, but allowed in versions above the specified one.  Also, since a single semicolon is a regular comment in retail FS2, version-specific comments will automatically be ignored in retail.&lt;br /&gt;
&lt;br /&gt;
Here is an example from Axem's PromptBox script:&lt;br /&gt;
&amp;lt;pre&amp;gt;;;FSO 3.8.0;; self.SDL2 = true&amp;lt;/pre&amp;gt;&lt;br /&gt;
In version 3.8.0 and later, this line will be treated as if it said&lt;br /&gt;
&amp;lt;pre&amp;gt;self.SDL2 = true&amp;lt;/pre&amp;gt;&lt;br /&gt;
while in versions prior to 3.8.0, this line will be treated as if it were a comment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The version string can accept from one to four numbers.  Here is another example from PromptBox with all four:&lt;br /&gt;
&amp;lt;pre&amp;gt;;;FSO 3.8.1.20180119;; mn.LuaSEXPs[&amp;quot;lua-clear-prompt&amp;quot;].Action = function(reference) PromptBox:ResetRef(reference) end&amp;lt;/pre&amp;gt;&lt;br /&gt;
Scripted SEXPs were added in the 20180119 nightly build, so this line connects the &amp;lt;code&amp;gt;PromptBox:ResetRef&amp;lt;/code&amp;gt; function to the scripted SEXP starting with that build.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any number of lines can be prefixed with a version-specific comment to enable features only available in certain builds.  This example from &amp;quot;Eve of Destruction&amp;quot; in the FreeSpace Port enables a ship nameplate in versions starting with 3.6.8:&lt;br /&gt;
&amp;lt;pre&amp;gt;;;FSO 3.6.8;; $Texture Replace:&lt;br /&gt;
;;FSO 3.6.8;; +old: nameplate&lt;br /&gt;
;;FSO 3.6.8;; +new: GTC_Orff&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Usage==&lt;br /&gt;
As of version 3.7.2 RC1, version-specific comments can be used in combination with &amp;lt;code&amp;gt;!* *!&amp;lt;/code&amp;gt; block comments to ''disable'' a feature starting from a certain version.  This works because the regular block comment is enabled or ignored depending on the preceding standard version-specific comment.&lt;br /&gt;
&lt;br /&gt;
Here is an example from &amp;quot;Expedition&amp;quot; in ''The Scroll of Atankharzim'' that uses the newer &amp;lt;code&amp;gt;jettison-cargo&amp;lt;/code&amp;gt; SEXP operator on builds that support it and the original &amp;lt;code&amp;gt;jettison-cargo-delay&amp;lt;/code&amp;gt; operator on builds that don't:&lt;br /&gt;
&amp;lt;pre&amp;gt;;;FSO 3.8.0;;   ( jettison-cargo &amp;quot;Molech&amp;quot; ) &lt;br /&gt;
;;FSO 3.8.0;;   ( jettison-cargo &amp;quot;Ba'al&amp;quot; ) &lt;br /&gt;
;;FSO 3.8.0;; !*&lt;br /&gt;
   ( jettison-cargo-delay &amp;quot;Molech&amp;quot; 0 ) &lt;br /&gt;
   ( jettison-cargo-delay &amp;quot;Ba'al&amp;quot; 0 ) &lt;br /&gt;
;;FSO 3.8.0;; *!&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Here Be Dragons==&lt;br /&gt;
The &amp;quot;Here Be Dragons&amp;quot; save format in FRED will save a mission in a format that can be loaded by retail'''*''', with the FSO-specific features guarded by version-specific comments.  The FreeSpace Port makes extensive use of this technique to allow missions to be loaded by retail FS2, while still retaining features (such as FS1 music and wing-specific squadron logos) that require FSO.&lt;br /&gt;
&lt;br /&gt;
'''*''' Approximately.  Lines in the mission file that are unambiguously written by FRED_Open but not written by retail FRED will be controlled as expected; but more subtle differences will not.  For example, SEXP operators that are only available in FSO will still be written, because the general SEXP format is compatible with retail FS2, even though specific SEXP operators are not.&lt;br /&gt;
&lt;br /&gt;
==Important Note==&lt;br /&gt;
FRED's support for version-specific comments is limited to what it specifically knows about.  If version-specific comments are used in any place other than the Here Be Dragons lines, the mission will be scrambled if it is loaded in FRED and saved again.  The feature can be useful to enable or disable events depending on the FSO version -- for an example of this, see the ported version of sm2-08, Playing Judas -- but this requires the version-specific comments to be added in a text editor, and any future mission edits must also be done in a text editor.&lt;br /&gt;
&lt;br /&gt;
==Related Links==&lt;br /&gt;
*'''Forum thread: [https://www.hard-light.net/forums/index.php?topic=38294.0 New mini-feature: Version-specific commenting]'''&lt;br /&gt;
&lt;br /&gt;
[[Category:Tables]]&lt;/div&gt;</summary>
		<author><name>Goober5000</name></author>
		
	</entry>
</feed>