Project X/Weapon file block

From Worms Knowledge Base

Revision as of 11:38, 12 January 2014 by Pac-Man (Talk | contribs) (Created page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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:
  • 0x00: None
  • 0x01: Crosshair
  • 0x02: Throw
  • 0x03: Airstrike
  • 0x04: Spacebar
53 4 int Activation flag
  • If the activation type is "Throw", this tells how many weapons are released as herding.
  • If the activation type is "Airstrike", this specifies the subtype (whatever that is).
  • If the activation type is "Space", this specifies the action caused (more information about the parameters of these actions is found below):
    • 0x00: None
    • 0x01: Fire punch
    • 0x02: Baseball bat
    • 0x03: Dragon ball
    • 0x04: Kamikaze
    • 0x05: Suicide bomber
    • 0x06: Ninja rope
    • 0x07: Bungee
    • 0x08: Pneumatic drill
    • 0x09: Prod
    • 0x0A: Teleport
    • 0x0B: Blowtorch
    • 0x0C: Parachute
    • 0x0D: Surrender
    • 0x0E: Skip go
    • 0x0F: Select worm
    • 0x10: Nuclear test
    • 0x11: Girder
    • 0x12: Battle axe
    • 0x13: Utility
    • 0x14: Freeze
    • 0x15: Earthquake
    • 0x16: Scales of justice
    • 0x17: Jet pack
    • 0x18: Armageddon
  • Otherwise, it has no meaning.
57 4 int Weapon Style
  • If the activation type is "None", this int has no meaning.
  • If the activation type is "Crosshair", the following styles are available:
    • 0x00: None
    • 0x01: Flamethrower
    • 0x02: Gun
    • 0x03: Launcher
    • 0x04: Bow
  • If the activation type is "Throw", the following styles are available:
    • 0x00: None
    • 0x01: Mine
    • 0x02: Launcher
    • 0x03: Canister
  • If the activation type is "Airstrike" or "Space", this int does not exist and the offset is already used for other information (s. below).
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.
Personal tools