Author Topic: [DONE][Suggestion] Background Image alternatives for Ufopaedia armor Pages  (Read 841 times)

Offline B1ackwolf

  • Colonel
  • ****
  • Posts: 178
  • im back...i guess
    • View Profile
Hi, sorry for reviving this thread, even if this was solved, i have some imputs related to this general idea. My current work on Xeno Operations can require some of what what Alex_D was asking for (it might be exactly what I need).

For context, in the XENOPS mod, every Ufopaedia image has an intricate background. Therefore, something needed to be done to avoid the plain black background you get when you assign a Ufopaedia page to the armor.

Currently, this is achieved by adding a "dummy" version of the armor with the suffix "DISPLAY," which uses a special custom spriteinv. This sprite is manually created.

This is the REAL ARMOR
Code: [Select]
  - type: STR_FLIGHT_JUMPSUIT
    ufopediaType: STR_PILOT_UFOPEDIA_DISPLAY
    spriteSheet: XOPS_XCOM_0.PCK
    layersDefaultPrefix: HUMAN
    layersSpecificPrefix:
      8: FLIGHT_JUMPSUIT
    layersDefinition:
      M999: [this repeated a bunch of times, dont need to add it in this post]
    spriteFaceGroup: 6
    spriteFaceColor: &SpriteFaceColorAgent [same as above for this post]
    spriteHairGroup: 9
    spriteHairColor: &SpriteHairColorAgent [same as above]
    customArmorPreviewIndex: 0
    storeItem: STR_NONE
    loftempsSet: [ 3 ]
    corpseBattle:
      - STR_CORPSE_FLIGHT_JUMPSUIT
    frontArmor: 6
    sideArmor: 2
    rearArmor: 2
    underArmor: 2
    stats: &StatsForJumpsuit [avoided, same as above]
    damageModifier: &damageModifierJumpsuit [same as above]
    builtInWeapons:
      - STR_NULL_POCKET_LS
      - STR_NULL_POCKET_RS
      - STR_NULL_BACKPACK
      - STR_NULL_BELT
    units: &CompatibilityWithPilotUnits
      - STR_PILOT
This is the DUMMY
Code: [Select]
  - type: STR_PILOT_UFOPEDIA_DISPLAY
    spriteSheet: XCOM_0.PCK
    spriteInv: PILOTUFOPEDIA
    weight: 2
    loftempsSet: [ 3 ]
    frontArmor: 6
    sideArmor: 2
    rearArmor: 2
    underArmor: 2
    corpseBattle:
      - STR_CORPSE_FLIGHT_JUMPSUIT
    stats: *StatsForJumpsuit
    damageModifier: *damageModifierJumpsuit

- If I use the dummy, it shows as expected in the rest of the Ufopaedia [1].
- If I directly add the armor in the ufopedia.rul, it has a black background [2].
- I tried modifying the interfaces.rul to put a custom background by adding the tag "backgroundimage:" hoping to have the Ufopaedia article include that background and then display the unit paperdoll as it usually does, but this was not successful.
Code: [Select]
  - type: articleArmor
    backgroundImage: BACK08.SCR #same as weapons?, for testing
    elements:
      - id: button
        color: 239    # Blueish gray
      - id: text
        color: 8   # chalky
        color2: 71  # green
      - id: list
        color: 6   # grey
        color2: 71  # green
I wish it would work[3] like in the same manner like facility or weapons screens [4], as I already have the "empty" background image ready[5].
(regardless I still use typeufopaedia to signal which article the MMB should open when clicked for all color variants of the same armor).

My issues with the current problem:
Spoiler:
Even though I'm taking advantage of the nodes "&" and "*" to simplify the process of updating stats, I'm now working on adding extra versions of the armors intended for pilots. This requires me to add another EXTRA dummy armor for each one I create, and also a custom image for the specific armor. Due to the compound nature of this images, every little change or tweak I make to the paperdoll requires the whole spriteinv image to be redone entirely.

Expected benefits:
Spoiler:
Simplifying the process of creating new Ufopaedia armor articles with custom-made backgrounds would save me from all the extra work on images and reduce the amount of clutter and unnecessary bloat. In this specific example, around 15 dummy armor definitions and the images related to them would be eliminated. As I mentioned before, every time I change even a single bit, the spriteinv file must be redone to match both versions.

TL;DR:
Spoiler:
1).To have custom background images for the Ufopaedia armor articles, a duplicate dummy armor with a custom spriteinv is currently required.
2).Trying to change the background image associated with "type_id: 5 (armor)" inside the interfaces.rul "articleArmor" doesn't seem to work.
3).Is there anything that can be done about this, or is it entirely hardcoded, forcing me to keep the current approach despite the bloat?

Thank you very much Meridian for any insight.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9076
    • View Profile
Re: [DONE][Suggestion] Background Image alternatives for Ufopaedia armor Pages
« Reply #1 on: September 29, 2024, 05:15:20 pm »
Done.

Code: [Select]
interfaces:
  - type: articleArmor
    backgroundImage: BACK08.SCR

Offline B1ackwolf

  • Colonel
  • ****
  • Posts: 178
  • im back...i guess
    • View Profile
Done.

Code: [Select]
interfaces:
  - type: articleArmor
    backgroundImage: BACK08.SCR


I haven't been able to test this feature yet, i guess is pending to be added into a future update, right?

sorry for the dumb question.

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Done.

Code: [Select]
interfaces:
  - type: articleArmor
    backgroundImage: BACK08.SCR


Thank you!

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9076
    • View Profile
I haven't been able to test this feature yet, i guess is pending to be added into a future update, right?

OXCE 7.14.4 or higher