OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Support => Topic started by: Admiral Naismith on February 26, 2018, 02:53:26 am
-
I found a mod that adds a new weapon and tried loading it in OXCE+. Unfortunately, the transparency did not seem to work correctly, resulting in black boxes around all of the sprites, including handobs. I first assumed that this must be an issue with the images, though the only oddity with those is that they seem to be in gif format rather than png. I then tried loading the mod in vanilla OXC, and found that there it actually worked correctly.
Could it be that I have something misconfigured in OXCE+? Or is this purely a bug?
Does anyone have suggestions for fixing this, other than reformatting the images? I've attached screenshots of what it looks like in both OXC and OXCE+, as well as the mod itself.
Thanks!
-
I had the same problem with an added Mod in OXCE+!
The only solution I found was to change the' HandOb' images.
https://openxcom.org/forum/index.php/topic,5982.0.html
-
The images have a completely broken palette, see attached.
The fact that it works in OXC is either a lucky coincidence, or some additional guesswork that has been either not implemented or removed in OXCE.
-
I had the same problem with an added Mod in OXCE+!
The only solution I found was to change the' HandOb' images.
https://openxcom.org/forum/index.php/topic,5982.0.html
The images have a completely broken palette, see attached.
The fact that it works in OXC is either a lucky coincidence, or some additional guesswork that has been either not implemented or removed in OXCE.
Ahh, I see - I didn't know quite enough about image manipulation to recognize that, and messing around in Photoshop trying to convert the original images made it even worse, even though the files looked fine in Photoshop and as Windows thumbnails.
I did actually work out a fix though:
- Open a PNG file of appropriate size from a different mod that is confirmed to work.
- Open the corresponding broken GIF file.
- Select all on the broken file and copy.
- Select all on the working file and delete, then paste and adjust sprite location to match source.
- If the background is not transparent, select background with magic wand: point sample, 0 tolerance, no anti-alias; then delete.
- Save resulting file as a new PNG with the appropriate name.
- Profit!
I used images from Nord's TWoTS mod as a base, and combined the broken handobs into one image with this tool (https://falkooxc2.pythonanywhere.com/spritecomb) before fixing them.
I'm thinking I should post the fixed mod, though I'm not entirely sure on the etiquette/procedure for editing someone else's mod or incorporating their work into a larger mod (other than, obviously, giving credit).
Since this would be a fix for an existing mod, I'm thinking I should just increment the version number, but then this might cause confusion if the original author updates their mod in some other way. Should I also change the mod ID then? Or something else?
Any advice on that?
Thanks!
-
I think it would be perfectly fine to post your fixed files in the original mod thread.
As for using assets from other mods in general, I'm sure nobody would mind... But it's always best to ask.
-
- If the background is not transparent, select background with magic wand: point sample, 0 tolerance, no anti-alias; then delete.
This just creates the same issue, but with PNGs.
Might work, might not.
The best way (and the only correct and official way) is NOT using transparency at all.
Instead whatever should be transparent in game should have color index 0... the game will interpret that as transparent.
-
Photoshop is as likely to "break" an image as fix it, because you have no way of seeing what you're actually doing.
-
Photoshop is as likely to "break" an image as fix it, because you have no way of seeing what you're actually doing.
I've edited probably tens of thousands of pics with PS, and it has never failed me. Not even once. :)
-
I think it would be perfectly fine to post your fixed files in the original mod thread.
As for using assets from other mods in general, I'm sure nobody would mind... But it's always best to ask.
Sadly (or surprisingly?) the mod currently does not have a forum page, instead a [mod portal page (http://www.openxcom.com/mod/disruptor-cannon) which is broken, but is still downliadable from here (http://www.openxcom.com/mod/disruptor-cannon/download/rNDIU7uu).
-
Today I've tried OXCE+ and indeed I lost all my transparency on items. OXC has no problem with it....So far my main graphic program was PS CC and I've just removed background. Unfortunatelly it doesn't work with OXCE+.
Strange thing is that crafts in base has correct transparency - only items has issues. Any workaround for PS to make it work again?
-
Today I've tried OXCE+ and indeed I lost all my transparency on items. OXC has no problem with it....So far my main graphic program was PS CC and I've just removed background. Unfortunatelly it doesn't work with OXCE+.
Strange thing is that crafts in base has correct transparency - only items has issues. Any workaround for PS to make it work again?
It's not all that strange that only items have broken transparency in OXCE+ - the reason has to do with the scripts Yankes added to be able to recolor/select item sprites based on pretty much anything you want - for example I use them to recolor energy weapons based on the type of ammo they have loaded. As for how to fix this, Meridian already answered above:
The best way (and the only correct and official way) is NOT using transparency at all.
Instead whatever should be transparent in game should have color index 0... the game will interpret that as transparent.
Take all your images and replace the transparent portions with color index 0 from the palette. An easy way to do this would be to add a layer below your sprite filled with color index 0 and then exporting both layers as visible. The fact that OXC allows for transparency via other methods should not be treated as the correct way of doing things, it's more a side effect of not enforcing proper formatting for your images to be read by the engine.
-
Thanks for reply. I was aware that Meridian gave an answer but my color index 0 isn't white. I think my pallette in little mixed up.
Anybody has correct set of swatch colors to PS which I can import?
-
Thanks for reply. I was aware that Meridian gave an answer but my color index 0 isn't white. I think my pallette in little mixed up.
Anybody has correct set of swatch colors to PS which I can import?
It doesn't matter what color you have on index 0... it can be black, white, yellow, green... whatever.
The game will ALWAYS ignore this color and interpret it as "transparent".
PS: btw. same goes for every other color... the game doesn't care what color you put in your palette... when the images are loaded, your palettes are ripped off from the images, discarded and replaced by the palettes that the game wants. The GIF transparency is more or less the only exception... but it is definitely not a feature, it is a side-effect, and should not be used.
-
It doesn't matter what color you have on index 0... it can be black, white, yellow, green... whatever.
The game will ALWAYS ignore this color and interpret it as "transparent".
PS: btw. same goes for every other color... the game doesn't care what color you put in your palette... when the images are loaded, your palettes are ripped off from the images, discarded and replaced by the palettes that the game wants. The GIF transparency is more or less the only exception... but it is definitely not a feature, it is a side-effect, and should not be used.
I was thinking about it that index 0 could be anything. Thank you for confirmation. So now what is the limitation of items/weapons color? 256, 8 bit?
-
Anything that isn't ufopaedia images are limited to index 1-255 (0 being transparent) of the defined battlescape palette.
-
Problem fixed. Thank you all!