Author Topic: [DONE] [Suggestion] Display soldier armor in the craft equipment screen  (Read 13517 times)

Offline Bloax

  • Colonel
  • ****
  • Posts: 322
  • do you want to be any of those things
    • View Profile
mockup images are useful (tm)
It might be useful for making people not forget to equip armor on their soldiers, which I imagine happens at times for the more forgetful players.
Mostly a feature for the mods with larger assortments of armor though, I guess.


These will probably need to have the proper palette applied to them, since I don't have anything but the tactical palette easily available.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11783
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Display soldier armor in the craft equipment screen
« Reply #1 on: January 03, 2016, 05:56:06 pm »
A very nice feature, but it would making armours even harder. :P

Offline Bloax

  • Colonel
  • ****
  • Posts: 322
  • do you want to be any of those things
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #2 on: January 03, 2016, 06:14:39 pm »
The default fallback should just be the current situation.

And I'm pretty sure that as the difficulty of making armors goes, a vague 11x19 representation of the armor would be the least of your concerns.
Especially since Tasteful Recolors (tm) would do an alright job at such a low resolution.

Offline XOps

  • Colonel
  • ****
  • Posts: 193
  • Guy who drowns first
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #3 on: January 03, 2016, 06:51:41 pm »
Yes please. :) I could very much use this. Also, it could come in handy if/when we start seeing some different soldier types.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #4 on: January 24, 2016, 10:27:14 am »
Should they be "sorted" like on the example screenshot or should they be displayed in actual order in craft?

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Display soldier armor in the craft equipment screen
« Reply #5 on: January 24, 2016, 12:25:40 pm »
By craft's crew deployment order, definitely!

Offline mrxian

  • Colonel
  • ****
  • Posts: 109
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #6 on: January 24, 2016, 12:49:41 pm »
A very nice feature, but it would making armours even harder. :P
If you can make all the other sprites required for making armot, this tiny figurine shouldn't really be an issue.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11783
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Display soldier armor in the craft equipment screen
« Reply #7 on: January 24, 2016, 03:29:17 pm »
If you can make all the other sprites required for making armot, this tiny figurine shouldn't really be an issue.

Agreed, hence the ':P'. making armours is such a pain though :)

Offline Bloax

  • Colonel
  • ****
  • Posts: 322
  • do you want to be any of those things
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #8 on: January 24, 2016, 08:43:31 pm »
Should they be "sorted" like on the example screenshot or should they be displayed in actual order in craft?
The actual order of the crew. It's "conveniently" sorted like that for clarity's sake.

Agreed, hence the ':P'. making armours is such a pain though :)
That depends on how stupendously detailed you're trying to make them. :^D
« Last Edit: January 24, 2016, 08:46:53 pm by Bloax »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #9 on: February 02, 2016, 11:02:42 pm »
Done.

How it works:
1. if you add sprite sheet called "CustomArmorPreviews" you will override vanilla behaviour (use basescape palette!); otherwise business as usual
2. the sprites are 12x20 pixels (but only 10x18 pixels are used, topleft)
3. you can specify the index from the spritesheet to use by new armor attribute called "customArmorPreviewIndex", default is 0
4. preview shows soldiers in the order of deployment, maximum 22 though... sorry no more space on the screen

Sample screenshot and sample mod for experimentation is attached.
Download will be available soon in my main thread for OXCE+.

Ruleset example:

Code: [Select]
extraSprites:
  - type: CustomArmorPreviews
    width: 48
    height: 20
    subX: 12
    subY: 20
    files:
      0: Resources/UI/custom-armor-previews.png
armors:
  - type: STR_PIR_NONE_UC
    customArmorPreviewIndex: 0
  - type: STR_BASIC_ARMOR_UC
    customArmorPreviewIndex: 1
  - type: STR_TAC_VEST_UC
    customArmorPreviewIndex: 2
  - type: STR_PERSONAL_ARMOR_UC
    customArmorPreviewIndex: 3

PS: @Dioxine, your custom graphics seems to be misaligned (doesn't start at [0,0])... that's why also the screenshot has alignment issue with crew vs equipment
« Last Edit: September 26, 2019, 12:51:02 pm by Meridian »

Offline Bloax

  • Colonel
  • ****
  • Posts: 322
  • do you want to be any of those things
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #10 on: February 03, 2016, 12:46:24 am »
Cool, not sure what's up with the lack of black outlines though. :o

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #11 on: February 03, 2016, 10:35:40 am »
Cool, not sure what's up with the lack of black outlines though. :o

Black is the color with index = 0 in basescape palette (and probably all other palettes as well), which is at the same time the transparent color in xcom.

So either:
1. the outlines should be in different color... i.e. very dark grey
2. or background should be in another color (i.e. bright green) and set to transparent

BUT, according to standard, I think only option 1 is the proper and recommended solution.
(https://openxcom.org/forum/index.php/topic,4221.0.html)

Anyway, I am a total graphics noob, I just did the first thing that worked... and I leave the graphics to artists... my part (support for this feature) is done.

Offline R1dO

  • Colonel
  • ****
  • Posts: 442
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #12 on: February 03, 2016, 02:26:20 pm »
Black is the color with index = 0 in basescape palette (and probably all other palettes as well), which is at the same time the transparent color in xcom.

So either:
1. the outlines should be in different color... i.e. very dark grey
2. or background should be in another color (i.e. bright green) and set to transparent

BUT, according to standard, I think only option 1 is the proper and recommended solution.
(https://openxcom.org/forum/index.php/topic,4221.0.html)

If the engine works as supposed there should be no reason not to use a black color, as long as it's index != 0. For instance index 15 looks like a good candidate.
Point 2 is like a smart thing to do .. it makes it more clear which pixels are supposed to be transparent. Or even mark index 0 as the transparent pixel, although this gives troubles with 'advanced' editors doing fancy stuff.

Anyhow, just tried it on your attached file, based on the dolls from the first post (please keep in mind i am no pixel artist myself).
Does this work for you?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11783
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Display soldier armor in the craft equipment screen
« Reply #13 on: February 03, 2016, 02:29:28 pm »
I think using non-black colours is safest after all. Sure, there are other ways, but it's not a problem to do and the artwork doesn't suffer.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: Display soldier armor in the craft equipment screen
« Reply #14 on: February 03, 2016, 02:43:07 pm »
Anyhow, just tried it on your attached file, based on the dolls from the first post (please keep in mind i am no pixel artist myself).
Does this work for you?

It does work.
The question is if it will still work with the newest nightly?

SupSuper said (see link above):

Graphics:
- Use 8-bit PNG (recommended: Photoshop, Aseprite).
- Use vanilla palettes.
- Don't optimize palettes.
- Transparent color must always be palette index 0 (first color).

So, if we cannot change the palette AND transparent must always be the first color... then it must always be black, which is transparent... or am I wrong?