Project X/Weapon file block

From Worms Knowledge Base

Revision as of 12:31, 12 January 2014 by Pac-Man (Talk | contribs) (Fire explosion target)

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 (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).
468 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.
472 4 int Count The start ammunition of this weapon.
476 4 int Unknown setting Probably has to do with the appearance.
480 4 int Weapon sprite
484 diff. string Long weapon name None
diff. 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.

Weapon Style Blocks

Depending on the Weapon style setting, the following blocks appear in the file.

Flamethrower

This block is not configurable in the Project X editors as its editing window has not been implemented, but loaded correctly in-game.

Offset Size Type Description Default value Remarks
64 4 int Amount of fuel
68 4 int Fire intensity
72 4 int Amount of fire
76 4 int Burn time In millseconds.
80 4 bool Remain on terrain If true, fire stays between turns, as introduced with the Petrol Bomb in WA.

Gun

Offset Size Type Description Default value Remarks
64 4 int Bullet count
68 4 int Reload time
72 4 int Bullet spread
76 4 int Burst
80 4 int Burst spread
84 4 CollisionFlags Collision flags S. below for the enumeration of collision flags.
88 4 int Bias
92 4 int Power
96 4 int Max. damage
100 4 int Damage spread
104 4 int Exp. effect
108 4 int Range 1
112 4 int Range 2
116 4 int Range 3

Launcher

The complex launcher structure is reused not only for the weapon style, but also for the bomb parameters of an airstrike, with the corresponding offsets then. The offsets here are the same as if the weapon style is "Launcher".

Depending on the actions and explosion targets the weapons are subclassed in, child blocks are possible, explained afterwards.

Offset Size Type Description Default value Remarks
64 4 int Sprite size
68 4 int Fixed speed
72 4 bool Run away!
76 4 CollisionFlags Explosion collision flags
80 4 int Explosion bias
84 4 int Explosion push power
88 4 int Explosion damage
92 4 int Explosion damage variation
96 4 int Explosion "Unknown"
100 24 Animation Animation S. below for the animation structure.
124 4 int Variable speed
128 4 int Wind factor
132 4 int Randomness of motion
136 4 int Gravity factor
140 4 int Explosion countdown from In milliseconds.
144 4 int Explosion timer In milliseconds.
148 16 Sound Sound S. below for the sound structure
164 4 bool Explosion on spacebar
168 4 int Explosion action Can be one of the following values, providing information about the following action block:
  • 0x00: None
  • 0x01: Home
  • 0x02: Bounce
  • 0x03: Roam
  • 0x04: Dig
308 4 int Explosion into Offset is at 308, before this byte, the action blocks are placed. Can be one of the following values, providing information about the following explosion target block:
  • 0x00: Nothing
  • 0x01: Clusters
  • 0x02: Fire

Homing action

Offset Size Type Description Default value Remarks
172 4 int Unused This byte is never used by Project X and can be handled as a placeholder.
176 24 Sprite Sprite
200 4 int Homing style Can be one of the following values:
  • 0x00: Don't home
  • 0x01: Like homing missile
  • 0x02: Like pigeon
204 4 int Homing after In milliseconds.
208 4 int Homing duration In milliseconds.

Bounce action

Offset Size Type Description Default value Remarks
172 4 CollisionFlags Bounce off
176 4 int Bounciness
180 4 int Acceleration
184 4 int Bounce sound
188 4 int "Unknown" 1
192 4 int "Unknown" 2
196 4 int Explosion bias
200 4 int Explosion power
204 4 int Explosion damage
208 4 int Randomness of damage
212 4 int Number of bounces

Roam action

Offset Size Type Description Default value Remarks
172 4 CollisionFlags Roam off
176 4 CollisionFlags Exploding on
180 4 int Walk speed
184 4 int "Unknown"
188 4 int Jump angle at edge
192 4 int Jump velocity at edge
196 4 int Jump sound at edge
200 4 int Jump angle
204 4 int Jump velocity
208 4 int Jump sound
212 4 int Terrain offset
216 4 bool Fart
220 4 int Disease power
224 4 int Sprite when farting
228 4 int Sprite when flying
232 4 int Sprite when flying 2
236 4 int Sprite when taking off
240 4 int Sprite during flight

Dig action

Offset Size Type Description Default value Remarks
172 4 int "Unknown" 1
176 4 int "Unknown" 2
180 4 int Digging sound
184 4 int Sprite while jumping
188 4 int Sprite 1
192 4 int Sprite 2
196 4 int Sprite 3

Cluster explosion target

Offset Size Type Description Default value Remarks
172 4 int Number of clustlets
176 4 int Dispersion power
180 4 int Speed
184 4 int Ejection angle
188 4 int Dispersion angle
192 4 CollisionFlags Explosion flags
196 4 int Explosion bias
200 4 int Explosion push power
204 4 int Explosion damage
208 4 int Explosion damage variation
212 4 int Number of used sprites
216 24 Sprite Animation
240 4 int Acceleration
244 4 int Wind response
248 4 int Randomness of motion
252 4 int Gravity factor
256 4 int Unused
260 4 int Unused
264 16 Sound Sound
280 4 bool Explode on spacebar
284 4 int Action Can be one of the following values, providing information about the following action block:
  • 0x00: None
  • 0x01: Home
  • 0x02: Bounce
  • 0x03: Roam
  • 0x04: Dig

Fire explosion target

Offset Size Type Description Default value Remarks
172 4 int Fire power
176 4 int Fire spread
180 4 int Fire time
184 4 bool Stay between turns
Personal tools