aliens

Author Topic: UFOPAEDIA Images [Solved]  (Read 1803 times)

Offline pjlasl

  • Captain
  • ***
  • Posts: 54
    • View Profile
UFOPAEDIA Images [Solved]
« on: December 26, 2021, 09:46:11 pm »
I am curious if the images used in the UFOPEADia are cached...


I added an image to my game and it loaded fine. So I went back to it and made some changes to the image (colors, etc) but when I load the game, it is still showing the original image.

I tried to rename the file and it still didn't work
« Last Edit: December 27, 2021, 12:13:16 am by pjlasl »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: UFOPAEDIA Images
« Reply #1 on: December 26, 2021, 09:50:09 pm »
It's cached while OpenXcom is running.

As soon as OpenXcom restarts (e.g. by selecting a different mod) or if you quit OpenXcom and start it again, the image will be reloaded.


Offline pjlasl

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: UFOPAEDIA Images
« Reply #2 on: December 26, 2021, 10:49:38 pm »
Ok. I did all of the suggestions you listed:
1. Closed the game, reopened it
2. Disabled the mod, re-enabled the mod

So something is wrong somewhere and I don't know where to go from here:

If you need access to the entire mod, I can provide that.

Here is my .rul code:

Spoiler:
- type: UFOPAEDIA_PINK_SECTOID_AUTOPSY1.SPK
    width: 320
    height: 200
    singleImage: true
    files:
      0: Resources/UNITS/Pink_Sectoid/ufopaedia_pink_sectoid_autopsy1.gif

- id: STR_PINK_SECTOID_AUTOPSY
    type_id: 7
    section: STR_ALIEN_LIFE_FORMS
    requires:
      - STR_PINK_SECTOID_CORPSE
    image_id: UFOPAEDIA_PINK_SECTOID_AUTOPSY1.SPK
    text: STR_PINK_SECTOID_AUTOPSY_UFOPAEDIA
    text_width: 158

Here is the .gif that the code is referencing

Spoiler:


Here is what the game actually loads

Spoiler:

« Last Edit: December 26, 2021, 11:03:36 pm by pjlasl »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: UFOPAEDIA Images
« Reply #3 on: December 26, 2021, 11:25:12 pm »
Your GIF is not using the correct OpenXcom palette.

When the game loads images, it completely ignores the palette attached to the image.
And instead uses one of the global palettes hardcoded in the game when rendering those images (for Alien Life Forms pedia articles, it uses PAL_UFOPAEDIA).

Or in other words... your attempt to recolor an image by using a custom palette is not going to work, becuse the game will completely ignore your custom palette.

Offline pjlasl

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: UFOPAEDIA Images
« Reply #4 on: December 26, 2021, 11:43:15 pm »
So what should I do? Use the Falko tool to Set the appropriate palette and colorize it then?

Where can I find the appropriate palette to colorize the image?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: UFOPAEDIA Images
« Reply #5 on: December 26, 2021, 11:49:50 pm »
First, maybe you can upload the image you have used directly here, instead of uploading it to imgur.
You have either uploaded a wrong image; or imgur has processed it too... because when I use your image, I get a very different result:

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: UFOPAEDIA Images
« Reply #6 on: December 26, 2021, 11:53:35 pm »
So what should I do? Use the Falko tool to Set the appropriate palette and colorize it then?

Every modder probably uses a slightly different approach... as a dev, I can only tell you that you need to use the correct palettes.

I have never used Falko's tool, I just use Photoshop... but I heard that people are using Falko's tool, so it's probably not bad.

Where can I find the appropriate palette to colorize the image?

If you use OXCE, then you can find all palettes in 3 different formats under /common/Palettes/

If you don't use OXCE, you can download the palettes from here: https://github.com/MeridianOXC/OpenXcom/tree/oxce-plus/bin/common/Palettes
« Last Edit: December 26, 2021, 11:56:23 pm by Meridian »

Offline pjlasl

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: UFOPAEDIA Images
« Reply #7 on: December 27, 2021, 12:12:38 am »
Thank you so much for your help! I found the palettes and here are the steps I took:

1. Ran the image against Falko's tool and set the palette using set-palette (ufo-research)
2. Imported the appropriate palette into GIMP
3. Texturized using the appropriate palette
4. Ran the new image against Falko's tool and used fix-palette (ufo_research) to set the background transparent

It worked great and now looks like I expected in game: