aliens

Author Topic: [SOLVED] How do I show alternate images for armor in UFOPedia?  (Read 3074 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
[SOLVED] How do I show alternate images for armor in UFOPedia?
« on: January 04, 2018, 10:57:25 am »
I've got several "armors" in the UFOPedia which represent my various soldier classes. It was easy to get them to look like an unarmored soldier, but how do I make each class look like a different soldier? They all look like Guile.


Here's some of the code I am using:
Code: [Select]
armors:
  - type: STR_BREACHER_UP
    spriteSheet: XCOM_0.PCK
    spriteInv: MAN_0
    stats:
      stamina: 10
      health: 8
      reactions: 20
      melee: 20
  - type: STR_RANGER_UP
    spriteSheet: XCOM_0.PCK
    spriteInv: MAN_0
    stats:
      tu: 5
      stamina: 15
      firing: 10
      throwing: 10
      strength: 5
  - type: STR_SNIPER_UP
    spriteSheet: XCOM_0.PCK
    spriteInv: MAN_0
    stats:
      reactions: 10
      firing: 20
« Last Edit: January 05, 2018, 02:28:02 am by The Reaver of Darkness »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: How do I show alternate images for armor in UFOPedia?
« Reply #1 on: January 04, 2018, 10:37:26 pm »
A practical example:

Code: [Select]
armors:
  - type: STR_ALLOY_VEST_UC
    spriteInv: MAN_4

extraSprites:
  - type: MAN_4
    width: 320
    height: 200
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4.PNG

This assumes that you only have 1 inventory image available, like Power Suit. However, if you have the 8 different versions (4 male, 4 female) like the vanilla starting armor, then you'll need to define extraSprites differently:

Code: [Select]
  - type: MAN_4F0.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4F0.GIF
  - type: MAN_4F1.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4F1.GIF
  - type: MAN_4F2.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4F2.GIF
  - type: MAN_4F3.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4F3.GIF
  - type: MAN_4M0.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4M0.GIF
  - type: MAN_4M1.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4M1.GIF
  - type: MAN_4M2.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4M2.GIF
  - type: MAN_4M3.SPK
    singleImage: true
    files:
      0: Resources/Units/Inventory/INV_MAN_4M3.GIF

And by default the game will use INV_MAN_4M0.GIF for the UFOPedia entry, IIRC
« Last Edit: January 04, 2018, 10:40:42 pm by Hobbes »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: How do I show alternate images for armor in UFOPedia?
« Reply #2 on: January 05, 2018, 02:27:45 am »
Ah, thanks!

It was as simple as doing this:
Code: [Select]
armors:
  - type: STR_BREACHER_UP
    spriteSheet: XCOM_0.PCK
    spriteInv: MAN_0M2
    stats:
      stamina: 10
      health: 8
      reactions: 20
      melee: 20
  - type: STR_RANGER_UP
    spriteSheet: XCOM_0.PCK
    spriteInv: MAN_0M1
    stats:
      tu: 5
      stamina: 15
      firing: 10
      throwing: 10
      strength: 5