OPENXCOM MODS
  • Home
  • How To
    • Apocalypse Modding >
      • First Steps
      • sprites from 3D files >
        • Downloads
        • Useful Videos for Noobs
        • Old Blender Files
    • OpenXcom Modding >
      • XCom soldier sprites
      • MCDADD
      • weapon sprites
      • BB_Tools
      • Modding Links
      • OLD MOD FILES >
        • Old Tutorials
        • Raw image Dump
        • TFTD SOUND DUMP
        • Videos >
          • Showcase
        • Members Mods >
          • Hobbes Mods >
            • Downloads
          • Moriarty's mods >
            • Downloads
            • Special Thanks
            • Feedback
          • Lukes Mods >
            • Fantasy OpenXcom >
              • Fantasy OpenXcom Data
            • Downloads >
              • Lukes Data
            • Special Thanks
            • Lukes Pictures >
              • Urban Images
              • Inventory images
              • Battle Sprites
              • UFOs
          • Kains Mods >
            • Downloads
          • Ryskeliini's Mods >
            • Downloads
          • Leflair Mods >
            • Downloads
          • Warboy1982 >
            • Download
          • Amiga's Mods >
            • Downloads
          • tyran_nick Mods >
            • Downloads
          • 54X MODS >
            • Downloads
          • Gifty's Mods >
            • Downloads
          • glokk2's Mods >
            • Downloads
          • Mercy's Mods >
            • Mercy's Downloads
          • Svanh >
            • Svanh's Downloads
          • Shoes Mods >
            • Shoes Downloads
          • Solarius Scorch's Mods
          • Meridian's Mods
          • NoirSuccubus Mods
          • Others Mods - Long term storage
      • General Map Creation >
        • Mapview 2 >
          • OLD MAPVIEW Videos
          • DaiShivas MapView >
            • Mapview 1 issues
        • MCDEDIT >
          • MCDVIEW
          • Koralts MCDEDIT
      • OXCE Code Templates
      • Irfanview - fixing colour pallets
      • MISSION ZONES
      • PCKVIEW >
        • PCKVIEW_OLD
  • I.D.T
  • Xcom LINKS

modifying weapon sprites

All weapon sprites are stored in .pck files. There's three files you need:
  • handob.pck - contains the actual weapons as seen in the hands of the soldiers in the battlescape (obviously)
  • floorob.pck - contains the sprites used for stuff that's on the ground (who'd have thought, right?), or currently flying through the air (after being thrown)
  • bigobs.pck - contains the sprites used in the soldier equip screen, in the battlescape menu (showing the stuff in your hands), and in the UFOpaedia


While the images for bigobs.pck and floorob.pck are quite straightforward, the difficult part is the handob.pck sprites. because they have to match the soldier sprites (or aliens, for that matter) each weapon exists with eight different facings, again starting with "being held by a unit facing away and to the right" and then rotating clockwise.

In order to match the wielding unit's hands, some of the weapon sprites have no handles (all the pistols, and several others).

You should also be aware that the "attack" animation changes three things:
  • for two-handed weapons, the weapon sprite is changed to the one facing two steps in a clockwise direction. two-handed weapons are carried pointing to the left of the unit, and are in this manner rotated 90 degrees clockwise to point in the direction the unit is looking.
  • the right arm of the firing unit is changed to the "attack" sprite. (while there are different arm sprites for carrying a one-handed versus a two-handed weapon, all weapons are apparently fired single-handedly :)
  • the weapon sprite position is shifted to match the new hand position... this is a bit complicated :) apparently, the code used is this: 
const int offX[8] = { 8, 10, 7, 4, -9, -11, -7, -3 }; // for the weapons 
const int offY[8] = { -6, -3, 0, 2, 0, -4, -7, -9 }; // for the weapons  
As I understand it, the offsets are X positive = "to the right" and Y positive = "down", and the offset notations are in the same order as the sprites, so a unit facing to the right (position #2, or actually "01", because it starts with "00") would have a weapon sprite position shift of 10 pixels to the right and 3 pixels up.
Powered by Create your own unique website with customizable templates.
  • Home
  • How To
    • Apocalypse Modding >
      • First Steps
      • sprites from 3D files >
        • Downloads
        • Useful Videos for Noobs
        • Old Blender Files
    • OpenXcom Modding >
      • XCom soldier sprites
      • MCDADD
      • weapon sprites
      • BB_Tools
      • Modding Links
      • OLD MOD FILES >
        • Old Tutorials
        • Raw image Dump
        • TFTD SOUND DUMP
        • Videos >
          • Showcase
        • Members Mods >
          • Hobbes Mods >
            • Downloads
          • Moriarty's mods >
            • Downloads
            • Special Thanks
            • Feedback
          • Lukes Mods >
            • Fantasy OpenXcom >
              • Fantasy OpenXcom Data
            • Downloads >
              • Lukes Data
            • Special Thanks
            • Lukes Pictures >
              • Urban Images
              • Inventory images
              • Battle Sprites
              • UFOs
          • Kains Mods >
            • Downloads
          • Ryskeliini's Mods >
            • Downloads
          • Leflair Mods >
            • Downloads
          • Warboy1982 >
            • Download
          • Amiga's Mods >
            • Downloads
          • tyran_nick Mods >
            • Downloads
          • 54X MODS >
            • Downloads
          • Gifty's Mods >
            • Downloads
          • glokk2's Mods >
            • Downloads
          • Mercy's Mods >
            • Mercy's Downloads
          • Svanh >
            • Svanh's Downloads
          • Shoes Mods >
            • Shoes Downloads
          • Solarius Scorch's Mods
          • Meridian's Mods
          • NoirSuccubus Mods
          • Others Mods - Long term storage
      • General Map Creation >
        • Mapview 2 >
          • OLD MAPVIEW Videos
          • DaiShivas MapView >
            • Mapview 1 issues
        • MCDEDIT >
          • MCDVIEW
          • Koralts MCDEDIT
      • OXCE Code Templates
      • Irfanview - fixing colour pallets
      • MISSION ZONES
      • PCKVIEW >
        • PCKVIEW_OLD
  • I.D.T
  • Xcom LINKS