Author Topic: How do I add artwork?  (Read 4137 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
How do I add artwork?
« on: August 02, 2016, 08:26:04 am »
I'm a little confused when it comes to adding new artwork for OpenXcom mods. I know I can use .gif images and place them in the appropriate subfolders within the mod folder, but the rulesets use simple numbers to determine which images or sounds to use. How do I know which number to choose, and how does the game sort between one mod and another which may have allocated the same number for separate images?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: How do I add artwork?
« Reply #1 on: August 02, 2016, 11:20:53 am »
it uses indexing, each mod can add up to 1000 images or sounds to each resource file, without worrying about any conflicts with other mods.
you can be fairly arbitrary with your numbers, they only need to make sense within the context of your own rulesets.
don't use pre-existing numbers (from the default ruleset) unless you intend to replace the original sprite rather than make a new weapon.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: How do I add artwork?
« Reply #2 on: August 02, 2016, 12:47:30 pm »
I still don't understand. How do I choose the numbers?


I am looking at a working mod with artwork added and it doesn't make any sense to me. I see numbers selected, but I don't see where they came from. For example:

In the items ruleset it says

  - type: STR_HEAVY_PLASMA_TERRAN
    bigSprite: 61
    floorSprite: 29
    handSprite: 40
    bulletSprite: 11

The extraSprites ruleset has the following info:
  - type: BIGOBS.PCK
    width: 384
    height: 48
    subX: 32
    subY: 48
    files:
      57: Resources/TerranPlasmaWeapons/alienterranplasma.gif
  - type: FLOOROB.PCK
    width: 32
    height: 40
    files:
      29: Resources/TerranPlasmaWeapons/heavyplasma_floorob.gif
  - type: HANDOB.PCK
    width: 256
    height: 40
    subX: 32
    subY: 40
    files:
      40: Resources/TerranPlasmaWeapons/heavyplasma_handob.gif
  - type: Projectiles
    width: 105
    height: 3
    subX: 3
    subY: 3
    files:
      385: Resources/TerranPlasmaWeapons/terranplasma_bullet.gif
  - type: SMOKE.PCK
    width: 320
    height: 40
    subX: 32
    subY: 40
    files:
      56: Resources/TerranPlasmaWeapons/terranplasma_hit.gif

The hand and floor sprites seem simple enough, but I can't figure out where the other two numbers come from. There aren't any files that discuss the artwork other than extraSprites. All four are edited from the original artwork--in particular it is the bigobs and bullet sprites that are most notably different.

--- posts merged - Solarius Scorch ---

Never mind, I figured out how it works. It's like adding parts onto the existing image to make it larger, and the numbers are counting sections in the image.

--- posts merged by Solarius Scorch. Please stop doing this without a good reason, I don't feel like merging other people's posts all the time ---

don't use pre-existing numbers (from the default ruleset) unless you intend to replace the original sprite rather than make a new weapon.
How do I know which numbers are used and which are not? I've been picking some pretty high numbers but it doesn't seem to get past all the sprites that already exist.
« Last Edit: August 02, 2016, 04:06:28 pm by Solarius Scorch »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: How do I add artwork?
« Reply #3 on: August 02, 2016, 03:24:03 pm »
How do I know which numbers are used and which are not? I've been picking some pretty high numbers but it doesn't seem to get past all the sprites that already exist.

Start your numbering after 255. Most of the data fields on the original game couldn't go higher than that number, so bigger than 255 will not conflict with any already used numbers.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: How do I add artwork?
« Reply #4 on: August 03, 2016, 11:59:33 am »
So I got the numbering to work. I can add images made by others.


But something is very wrong with the images I made:



I'm guessing it has something to do with the number of colors used on the palette, but I don't know how to change that. I used GIMP to edit the images because I can't get MS Paint to cooperate and I don't have any pixel editors except for MS Paint. Also MS Paint no longer understands how to give me a limited color palette. I don't think it's had that feature since back when it was called Paintbrush.

edit: I found a pixel editor that respects the palettes that OpenXcom uses, it's called mtPaint. Now I'm just wondering how I get my hands on the images? mtPaint won't load .PCX files. I was getting my images from screenshots initially, but that yields completely wrong palettes.
« Last Edit: August 03, 2016, 12:20:02 pm by The Reaver of Darkness »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How do I add artwork?
« Reply #5 on: August 03, 2016, 01:43:08 pm »
Don't even think of using .pcx, stick to .png or .gif.

There are several separate palettes used by X-Com: General (for bigobs), Battlescape, Geoscape, Basescape, Interception Ufopaedia and the monochrome palette for backgrounds. The easiest way is to use another modder's work of the same type and modify it, preserving the palette, but you need a program that allows it. I know GIMP generally doesn't.
I use Photoshop, but some other people recommended Aseprite.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: How do I add artwork?
« Reply #6 on: August 03, 2016, 02:29:23 pm »
I figured it out.





mtPaint works great and is easy to use.
I was finally able to edit images when I stumbled across XcomExtractor.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: How do I add artwork?
« Reply #7 on: August 03, 2016, 05:21:06 pm »
This thread https://openxcom.org/forum/index.php/topic,3709.0.html covers how to fix palette issues

When I'm editing I basically use 2 open source tools: GIMP and Graf2X

GIMP is better to edit the sprites, but it can be tricky with the XCom palettes (you need to know exactly how to deal with them) while Graf2X is awesome regarding palettes but doesn't have the same ease of editing as GIMP