Mac-Specific
OSX adds a junk to .zip files.
These commands will address that:
zip -d mymod.zip __MACOSX/\*
zip -d mymod.zip \*.DS_Store
Encoding!?
Text ultimately boils down to 1's and 0's. There are numerous standards
for encoding that information. If an app reads the 1's and 0's assuming
the wrong standard, it can come out as gibberish.
ANSI - A family of related standards, often incompatible because each has
language-specific characters and lacks others. They can at least agree on
certain characters, called ASCII. When only ASCII characters are present,
it doesn't matter which ANSI encoding was used.
ASCII - abcdefghijklmnopqrstuvwxyz0123456789 (and uppercase)
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Windows-1252 - The most popular flavor of ANSI.
Unicode - A series of standards, all capable of handling the same huge
pool of characters, each successively less optimized for common
characters in favor of consistency. Sometimes they come with a BOM
header, a distinctive binary blob, that indicates what encoding was
used.
UTF-8 - A flavor of Unicode. For ASCII characters, it is identical
with all the ANSI encodings. The BOM is optional. Apps often fairly
safely assume all text is UTF-8 without a BOM. However, some apps may
not know what to do when they see BOM bytes (eek weird binary), and if
the document WERE written in ANSI with characters beyond ASCII, they
may get garbled.
UTF-16 - Windows uses this sometimes. Ideally always has a BOM. It is not
identical with any other encodings. The whole thing looks like a mess
when decoded incorrectly. Apps have to deliberately support it - usually
by including tests to determine when they're dealing with UTF-16 or
something else.
Advanced XML
Since v1.2, Slipstream supports special tags to not only append, but
insert and edit existing XML. You can practice using them with the
"XML Sandbox", under the File menu.
They take the form:
<mod:find... reverse="false" start="0" limit="-1" panic="false">
<mod:holderForExtraFindArgs />
<mod:someCommand />
<mod:someCommand />
</mod:find...>
Some identify existing tags, using each result as context for commands.
<mod:removeTag />
Removes the context tag entirely.
<mod-append:XYZ>
</mod-append:XYZ>
Appends a new <XYZ> child to the context tag. Aside from the prefix,
the tag's type and content will appear as-is. It can be self-closing.
<mod-overwrite:XYZ>
</mod-overwrite:XYZ>
If possible, the first <XYZ> child under the context tag will be
removed, and this <XYZ> will be inserted in its place. Otherwise,
this has the same effect as <mod-append:XYZ>.
Special tags and normal append content are processed in the order they
occur in your mod. And when patching several mods at once, later mods
edit in the wake of earlier ones.
Raw XML
FTL is quirky. Occasionally you may need to include non-standard XML in a
mod without elaborate parsing. For instance, "misc.xml" defines phrases
for localization, which may begin/end with a space. Normally, this
whitespace would be trimmed away, leading to ugly results in-game.
If your mod has a file named "misc.xml.rawappend", the content of that
file will be tacked onto the end of "misc.xml". Line-endings and encoding
will be standardized, but Slipstream will make no attempt to
(mis)understand the tags of either file.
You can still override existing tags by adding your own with the same
name attribute, since FTL honors the last it sees.
Similarly a file named "misc.xml.rawclobber" will entirely replace the
original "misc.xml".
Any other mods patched afterward must either avoid that file or also treat
it as raw themselves. Hence this should be used as a last resort.
Commandline
Running Slipstream from a prompt can speed up development...
--patch Abc.ftl Def "Ghi 1.0.ftl"
Patches named mod files. Dirs can also be named, so you won't have to
re-zip for every test.
--global-panic
While patching, reveals typoed <find...> tags. Any find that yields no
matches will cause an error, as if it had panic='true'.
--runftl
Runs the game. If used with "--patch", runs afterward if successful.
--validate Abc