HWPFormat: simplify headers
Mon, 09 Jul 2018 20:20:22 +0100
changeset 1433 19945dc3944e
parent 1432 549afbe978a8
child 1434 83da47a13028
HWPFormat: simplify headers
--- a/HWPFormat.wiki	Mon Jul 09 20:18:19 2018 +0100
+++ b/HWPFormat.wiki	Mon Jul 09 20:20:22 2018 +0100
@@ -20,13 +20,12 @@
 To install a HWP file manually, just put it in the `Data/` subdirectory of your [https://www.hedgewars.org/node/6761 user directory].
-== Creating HWPs ==
-=== The short description ===
+== Creating simple HWPs ==
 Creating a HWP is easy.
 A HWP file is just a Zip file, but with the file name suffix “.hwp” instead of “.zip”. They reflect the content of the `Data/` directory of Hedgewars. Any file in a HWP will be treated as if it were in the `Data` directory.
-==== Example ====
+=== Example ===
 Suppose you have made a theme with the name “!MyTheme_v1” (!MyTheme, version 1). If you want to package it in a HWP, you just create a Zip file (e.g. “MyTheme.zip”) with the following directory structure:
@@ -44,15 +43,17 @@
 If you're done, you probably want to test it as well. Just put your fresh HWP into the `Data/` directory, restart Hedgewars and check if the theme shows up.
-=== The long description ===
-HWPs have a couple additional features which allow you to do more sophisticated things. This section explains the HWP files in greater detail.
+== Full description of HWPs ==
+The section above explained all things you need to know about HWPs to get started.
-==== Format specification ====
+HWPs have a couple additional features which allow you to do more sophisticated things, but are not alway needed. This section explains the HWP files in greater detail.
+=== Format specification ===
 Technically, a HWP file is actually just a Zip file with an unusual file name suffix. The specification of HWP files itself is thus identical to the specification of Zip files.
 The complete Zip file format specification can be found at [http://www.pkware.com/documents/casestudies/APPNOTE.TXT].
-==== How Hedgewars uses HWPs ====
+=== How Hedgewars uses HWPs ===
 All HWPs must have the file name suffix “.hwp” for Hedgewars to recognize it as such. This is a bit unusual, since the usual file name suffix for .ZIP files (which HWP files actually are) is “.zip”. Don’t worry about that, Hedgewars can cope with that.
 HWP files reflect the content of the `Data/` directory of Hedgewars. Therefore, the structure of the HWP file must be as if it were inside the `Data/` directory of Hedgewars and using the same directory tree.
@@ -61,27 +62,27 @@
 It is a special case when you have multiple HWPs activated, when some of them try to include a file with identical name. This is a conflict, see the conflict section for more information about this.
-===== Custom sprites and sounds =====
+==== Custom sprites and sounds ====
 For Lua scripts you can add a few custom sounds and sprites without actually replacing any useful resources. For this, Hedgewars offers a 8 dummy sprites and 8 dummy sounds which only exist so they can be added in a HWP.
 The custom sprites are named `Graphics/custom1.png` to `Graphics/custom8.png` and are accessed in Lua with `sprCustom1` to `sprCustom8`.
 The custom sounds are named `Sounds/custom1.ogg` to `Sounds/custom8.ogg` and are accessed in Lua with `sndCustom1` to `sndCustom8`.
-===== Custom ammo icons =====
+==== Custom ammo icons ====
 Overwriting ammo icons is a special case. If `Graphics/AmmoMenu/Ammos.png` or `Graphics/AmmoMenu/Ammos_bw.png` is found in the HWP, it will be overlayed over the original images `Graphics/AmmoMenu/Ammos_base.png` and `Graphics/AmmoMenu/Ammos_bw_base.png`, respectively. This is useful if you only need to replace a few certain ammo icons, and not the entire set of ammo icons. This is especially important to ensure forwards-compability of your sidecar HWPs for your scripts (see below).
 For example, if you want to replace the “Air Attack” icon with a crosshair icon, but leave everything else alone, just draw the cross hair icon on the correct position and make all other frames fully transparent.
-=== Possible locations for HWPs ===
+== Possible locations for HWPs ==
-==== HWPs in `Data/` ====
+=== HWPs in `Data/` ===
 The most common HWPs will be stored in the `Data/` directory of Hedgewars. Note that there are two `Data/` directories for Hedgewars, one is system-wide and one is intended for the current user. In case of conflicts between both, the user directory will take precendence.
 Storing HWPs in the user `Data/` directory is the most common form of installing a HWP to Hedgewars. This is what happens when you use DLCs. HWPs distributed in webforums are usually intended to be installed into the user `Data/` directory.
-==== Sidecar HWPs ====
+=== Sidecar HWPs ===
 Sidecar HWPs are HWPs installed in the same directory as a Lua script. Sidecar HWPs always serve as a companion for one single Lua script. Sidecar HWPs will be activated only if the script in question is run by Hedgewars. Otherwise, the HWP remains inactive and its resources are unavailable.
 The name of a sidecar HWP equals the name of the Lua script it serves as a “sidecar”, with the file name suffix replaced by “.hwp”. Sidecar HWPs must be in the same directory as the script.
@@ -92,12 +93,12 @@
 Please remember how Hedgewars uses ammo icons in HWPs (see above).
-==== Limitations ====
+=== Limitations ===
 Important: HWPs are not recursive! This means if you put a HWP inside another HWP, Hedgewars will only load the actual contents of the outermost HWP. The contents of the inner HWP are not loaded. This implies that there is currently no way (via HWP) to distribute a script with custom data. You have to ask users to just extract a normal Zip file with your script data instead.
 This is considered a bug, see https://issues.hedgewars.org/show_bug.cgi?id=174.
-==== Order of precedence ====
+=== Order of precedence ===
   # Sidecar HWPs
   # All HWPs