aliens

Author Topic: OXCE Support Customizing / Controlling Inventory Layout  (Read 987 times)

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
OXCE Support Customizing / Controlling Inventory Layout
« on: December 16, 2023, 08:16:03 pm »
[Issues]:
I have 2 issues that I suspect need code changes?

1.) For builtInWeapons items placed in the defaultInventorySlot of an armor, they are always placed starting at position [0,0]. Even if they don't fit there, i.e. a 2x2 item in a 2x1 space. Also, even if there are other places where a 2x2 item can fit, the builtInWeapons still gets placed at position [0,0].

2.) If I add a second NULL item to the builtInWeapons for the BELT I suspect it also wants to go to position [0,0] and since that position is already taken, instead of finding another place that it fits in the belt, it gets placed in a different inventory slot, i.e. in the right hand.




[Goal]:
Customize an inventory layout for different armors / suits similar to how X-Com Files does it by disabling specific inventory slots using NULL items.

[Desired Solution]:
1.) Set the location of the builtInWeapons item in the defaultInventorySlot. Like [2,0] vs always [0,0]

2.) Be able to define builtInWeapons that only get place in the default defaultInventorySlot and if there is no room in that inventory slot then don't put them anywhere else.


Example Solution for .rul file:

Code: [Select]
items:
    ...
    defaultInventorySlot: STR_BELT
    defaultInventorySlotPosition: [2,0]
    defaultInventorySlotRestricted: true




#---------------------------------------------

Example I'm dealing with:
Spoiler:
1.) I'd like to place 2 items in the belt with defaultInventorySlot: STR_BELT

2.) I'd like to place a NULL_1x2 item at the position starting at [-2,0] in the belt.

3.) I'd like to place a second item, INV_NULL_2X2_BELT at the position of the starting at [2,0].

4.) If an item has a defaultInventorySlot: STR_BELT and it can not fit there, then I would like it 'NOT' placed in the inventory at all.


I have an inventory defined for 'BELT'

Code: [Select]
invs:
  - id: STR_BELT
    x: 197
    y: 106
    slots:
      - [-2, 0]
      - [-1, 0]
      - [0, 0]
      - [1, 0]
      - [2, 0]
      - [3, 0]
      - [-2, 1]
      - [2, 1]
      - [3, 1]


then I defined the NULL items.

Code: [Select]
items:
  - type: INV_NULL_2X2_BELT
    categories: [STR_BLANKS]
    weight: 0
    bigSprite: 1540
    invWidth: 2
    invHeight: 2
    fixedWeapon: true
    defaultInventorySlot: STR_BELT
    recover: false
  - type: INV_NULL_1X2_BELT
    categories: [STR_BLANKS]
    weight: 0
    bigSprite: 1541
    invWidth: 1
    invHeight: 2
    fixedWeapon: true
    defaultInventorySlot: STR_BELT
    recover: false
  - type: INV_NULL_3X1_BELT
    categories: [STR_BLANKS]
    weight: 0
    bigSprite: 1542
    invWidth: 3
    invHeight: 1
    fixedWeapon: true
    defaultInventorySlot: STR_BELT
    recover: false

now I'm testing with the X-Com Files Suit

Code: [Select]
armors:
  - override: STR_SUIT_UC 
    builtInWeapons:
      - INV_NULL_2X2_BELT
      - INV_NULL_1X2_BELT
      - INV_NULL_3X1_BELT


Pictures attached for the example in the spoiler.
1.) Picture of STR_BELT with no items.
2.) Picture of STR_BELT with INV_NULL_2X2_BELT placed at position[0,0]

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects