Project X/Weapon file block
From Worms Knowledge Base
A weapon block describes of what kind a weapon is, how it reacts, its physical parameters, how much initial ammunition is available and much more. Because of the many different weapon types, different sub-blocks have to be read depending on the type. However, the "header" is always the same, being explained at first, and following the other sub-blocks. If not further explained, data at offsets not listed is empty (0-bytes).
Header
Each weapon block has a small header and a checksum (which isn't actually checked, so it can be anything).
Offset | Size | Type | Description | Default value | Remarks |
---|---|---|---|---|---|
0 | 4 | int | Identification | 0x5ABBDD06 | Magic bytes identifying the weapon block, thus they are always the same. |
4 | 8 | long | Checksum | Generation unknown, can be anything, not checked by Project X. |
General Settings
Following the header are some general settings (mostly configured in the first window of the Project X Weapon Editor). Additional settings follow at the byte at offset 500, and before this are weapon type specific sub-blocks found (so there's space between the first group of settings and the second group, used differently for each weapon type).
Offset | Size | Type | Description | Default value | Remarks |
---|---|---|---|---|---|
12 | 1 | byte | Table Row | Row of the weapon table in which the weapon will appear. 0 = Utility row, max. is 12. | |
13 | 4 | bool | Remembered | If true, the weapon will be automatically selected for the next shot after the first one. | |
17 | 4 | bool | Usable in cavern | Useful to disable airstrikes on cavern maps. | |
21 | 4 | int | Shoots | The number of shoots which can be done before the turn ends. | |
25 | 4 | bool | Shoot ends turn | If true, retreat time is started after the weapon has been fired. | |
29 | 4 | int | Retreat time | The retreat time in millseconds after the weapon has been fired (and shoot ends turn is true). | |
33 | 4 | int | "Unknown" | ||
37 | 4 | int | Crate Chance | The chance that this weapon will appear in crates. This is shared between all weapons, so using a percentage value from 0-100 is a good idea rather than using any value up to 2^16. | |
41 | 4 | int | Count in Crate | The additonal ammunition a team will get when collecting a crate with this weapon in it, normally 1. | |
45 | 4 | bool | Unknown Setting | This boolean is randomly set by Project X, but the meaning has not yet been discovered. | |
49 | 4 | int | Activation by | Sets the activation type this weapon has. The following values are valid:
| |
53 | 4 | int | Activation flag |
| |
57 | 4 | int | Weapon Style |
| |
500 | 4 | bool | Custom count | If true, the start ammunition overrides the ones defined in the used WSC scheme. This is only required for the first table as the weapons in the second table always use the following count. | |
504 | 4 | int | Count | The start ammunition of this weapon. | |
508 | 4 | int | Unknown setting | Probably has to do with the appearance. | |
512 | 4 | int | Weapon sprite | ||
516 | diff. | string | Long weapon name | None | |
520 | diff. | string | Short weapon name | None | |
diff. | diff. | string | Grid IMG | hi/bazooka.img | The image of the weapon to be displayed in its table cell. hi/... references images in the sprite directory of Worms. Otherwise, a filename in the scheme or any attached library can be used, like "omgwtfbbq.png". |
diff. | 24 | byte[] | Unused bytes | ||
diff. | 4 | bool | Custom delay | True to override the WSC delay of weapons in the first weapon table. Not required for any additional table. | |
diff. | 4 | int | Delay | The number of turns which have to be completed by each team before this weapon becomes available. | |
diff. | 1 | bool | Use from library | True to use the weapon block as specified in the library with the following name. Renders other settings of this weapon block useless. The following two strings "Library name" and "Library weapon name" do not exist if this bool is false. | |
diff. | diff. | string | Library name | The name of the library from which the weapon block with the following name should be used. This string does not exist if "Use from library" is false. | |
diff. | diff. | string | Library weapon name | The name of the weapon in the library with the name specified above. This string does not exist if "Use from library" is false. | |
diff. | diff. | string | Aim sprite name even | ||
diff. | diff. | string | Aim sprite name uphill | ||
diff. | diff. | string | Aim sprite name downhill | ||
diff. | diff. | string | Pick sprite name even | ||
diff. | diff. | string | Pick sprite name uphill | ||
diff. | diff. | string | Pick sprite name downhill | ||
diff. | diff. | string | Fire sprite name even | ||
diff. | diff. | string | Fire sprite name uphill | ||
diff. | diff. | string | Fire sprite name downhill | ||
diff. | 1 | bool | Custom aim sprite | True to use the custom aim sprite names. | |
diff. | 1 | bool | Custom pick sprite | True to use the custom pick sprite names. | |
diff. | 1 | bool | Custom fire sprite | True to use the custom fire sprite names. | |
diff. | 1 | bool | Utility | True if this weapon appears at the bottom right above the wind indicator if activated. |