aliens

Author Topic: [DONE][Suggestion] Inventory auto-placement priorities/rules  (Read 6450 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8629
    • View Profile
Re: [DONE][Suggestion] Inventory auto-placement priorities/rules
« Reply #15 on: February 13, 2024, 09:15:32 pm »
Description of the current OXC algorithm for CTRL+click an item on the ground:

1. (A1) - first try a slot depending on the battle type of the item
2. (A2) - if not possible to place the item, try every other slot in alphabetical order

Details on A1:
- place firearms (battle type = 1) into right hand
- place mind probes, psiamps, melee and corpses (battle types = 8, 9, 3, 11) into left hand
- place everything else into the back pack if vertical size > 2, otherwise place into the belt

Details on A2:
- place into the first available slot in the following (alphabetical) order:
 STR_BACK_PACK, STR_BELT, STR_LEFT_HAND, STR_LEFT_LEG, STR_LEFT_SHOULDER, STR_RIGHT_HAND, STR_RIGHT_LEG, STR_RIGHT_SHOULDER

--

Description of the current OXC algorithm for auto-equip:
a/ happens when player inventory is opened and option is not disabled
b/ happens when you press the Z hotkey (option disabled or enabled doesn't matter)
c/ happens when aliens (and civilians) are equipped before mission

1. (C1) - place firearms and melee into right/left hand, don't try any where else
2. (C2) - place psiamp into left hand for aliens, don't try anywhere else
3. (C3) - place everything else into free slots based on listOrder

Details on C1:
- firearms and melee (battle type = 1, 3) are equipped into the right hand
- a second firearm and melee (battle type = 1, 3) are equipped into the left hand for aliens and civilians (in OXCE also for player units with a corresponding armor attribute enabled)

Details on C2:
- a psiamp (battle type = 9) is equipped into the right or left hand for aliens only

Details on C3:
- every other item (which is not firearm or melee) is equipped into a free slot based on listOrder of inventory slots (i.e. NOT alphabetically!)
- default listOrder in OXC/OXCE is:
 STR_RIGHT_HAND, STR_LEFT_HAND, STR_BELT, STR_RIGHT_LEG, STR_LEFT_LEG, STR_RIGHT_SHOULDER, STR_LEFT_SHOULDER, STR_BACK_PACK
- listOrder can be overridden by modders (already for a long time)
« Last Edit: February 13, 2024, 09:17:39 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8629
    • View Profile
Re: [DONE][Suggestion] Inventory auto-placement priorities/rules
« Reply #16 on: February 13, 2024, 09:15:56 pm »
New features in OXCE (since v7.11.8 ):

CTRL+click extended to:

1. (B1) - first try the default slot per item
2. (B2) - second try slot based on the item category, in the order defined by the modder

3. (A1) - third try a slot depending on the battle type of the item
4. (B3) or (A2) - fourth every other slot in alphabetical order (A2) or listOrder (B3) -- modder can globally choose between (B3) and (A2)

Auto-equip extended to:

1. (C1) - place firearms and melee into right/left hand, don't try anywhere else
2. (C2) - place psiamp into left hand for aliens, don't try anywhere else
for everything else:
3. (D1) - (standard player units only!) try the default slot per item
4. (D2) - (standard player units only!) then try slot based on the item category, in the order defined by the modder -- the first item category that actually contains any inventory order will be used

5. (C3) - lastly try all free slots based on listOrder
« Last Edit: February 17, 2024, 05:53:23 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8629
    • View Profile
Re: [DONE][Suggestion] Inventory auto-placement priorities/rules
« Reply #17 on: February 13, 2024, 09:16:27 pm »
Examples of all new attributes and options can be found in the new standard mods for UFO and TFTD called "Smarter Equip", which are distributed together with OXCE.

Disclaimer:
These two mods are based on my personal preferences.
I am aware that other people have other preferences.
Feel free to tinker with the mods to adjust them to your needs.

Disclaimer 2:
The mods work with vanilla UFO and vanilla TFTD items... any other items added in mods and megamods may need to be updated by the respective modders.
(even though rule (B3) will already do quite a good job even for uncategorized items)
(mods changing inventory slots should probably redefine also (B3) ruleset)

If you're really crazy, you can define a different custom equip order for every single item in the game, but I'd recommend grouping similar items into categories to preserve sanity.
If you don't want any/some/all categories to be visible in the game, you can mark them as hidden.

--

UFO version copypasted below (for forum keyword search purposes):

Code: [Select]
# 1. Use inventory slots defined by individual items
items:
  - type: STR_HIGH_EXPLOSIVE
    defaultInventorySlot: STR_RIGHT_LEG
  - type: STR_MOTION_SCANNER
    defaultInventorySlot: STR_BELT
  - type: STR_MEDI_KIT
    defaultInventorySlot: STR_BELT
  - type: STR_BLASTER_BOMB
    defaultInventorySlot: STR_LEFT_HAND

Code: [Select]
# 2. Use inventory slots defined by item categories
displayCustomCategories: 1

itemCategories:
  - type: OXCE_CRAFT_WEAPONS
  - type: OXCE_HWPS
  - type: OXCE_MAIN_WEAPONS
    invOrder: [STR_RIGHT_HAND, STR_LEFT_HAND, STR_BACK_PACK]
  - type: OXCE_SIDE_WEAPONS
    invOrder: [STR_LEFT_HAND, STR_BELT, STR_BACK_PACK, STR_RIGHT_HAND]
  - type: OXCE_AMMO
    invOrder: [STR_BELT, STR_LEFT_LEG, STR_RIGHT_LEG]
  - type: OXCE_GRENADES
    invOrder: [STR_RIGHT_SHOULDER, STR_LEFT_SHOULDER, STR_BELT, STR_LEFT_LEG, STR_RIGHT_LEG, STR_LEFT_HAND, STR_RIGHT_HAND, STR_BACK_PACK]
  - type: OXCE_ARMORS_AND_CORPSES
    invOrder: [STR_LEFT_HAND, STR_RIGHT_HAND, STR_BACK_PACK]
  - type: OXCE_PRISONERS
    invOrder: [STR_LEFT_HAND, STR_RIGHT_HAND, STR_BACK_PACK]
  - type: OXCE_COMPONENTS
    invOrder: [STR_LEFT_HAND, STR_BELT, STR_BACK_PACK]

Code: [Select]
# 3. Use inventory slots ordered by listOrder (instead of alphabetical order)
constants:
  extendedInventorySlotSorting: true

invs:
  - id: STR_RIGHT_SHOULDER
    listOrder: 10
  - id: STR_LEFT_SHOULDER
    listOrder: 20
  - id: STR_BELT
    listOrder: 30
  - id: STR_LEFT_LEG
    listOrder: 40
  - id: STR_RIGHT_LEG
    listOrder: 50
  - id: STR_BACK_PACK
    listOrder: 60
# let's keep the hands low (or at least after the backpack, so that aliens don't auto-equip things like mind probes in hands)
  - id: STR_RIGHT_HAND
    listOrder: 70
  - id: STR_LEFT_HAND
    listOrder: 80
  - id: STR_GROUND
    listOrder: 90

And a few examples of the item categorization (file shortened):

Code: [Select]
items:
  - type: STR_PISTOL
    categories: [OXCE_SIDE_WEAPONS]
  - type: STR_PISTOL_CLIP
    categories: [OXCE_AMMO, OXCE_SIDE_WEAPONS]
  - type: STR_RIFLE
    categories: [OXCE_MAIN_WEAPONS]
  - type: STR_RIFLE_CLIP
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_HEAVY_CANNON
    categories: [OXCE_MAIN_WEAPONS]
  - type: STR_HC_AP_AMMO
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_HC_HE_AMMO
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_HC_I_AMMO
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_AUTO_CANNON
    categories: [OXCE_MAIN_WEAPONS]
  - type: STR_AC_AP_AMMO
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_AC_HE_AMMO
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_AC_I_AMMO
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_ROCKET_LAUNCHER
    categories: [OXCE_MAIN_WEAPONS]
  - type: STR_SMALL_ROCKET
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_LARGE_ROCKET
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_INCENDIARY_ROCKET
    categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
  - type: STR_LASER_PISTOL
    categories: [OXCE_SIDE_WEAPONS]
  - type: STR_LASER_RIFLE
    categories: [OXCE_MAIN_WEAPONS]
  - type: STR_HEAVY_LASER
    categories: [OXCE_MAIN_WEAPONS]
  - type: STR_GRENADE
    categories: [OXCE_GRENADES]
  - type: STR_SMOKE_GRENADE
    categories: [OXCE_GRENADES]
  - type: STR_PROXIMITY_GRENADE
    categories: [OXCE_GRENADES]
  - type: STR_HIGH_EXPLOSIVE
    categories: [OXCE_GRENADES]
  - type: STR_MOTION_SCANNER
    categories: [OXCE_SIDE_WEAPONS]
  - type: STR_MEDI_KIT
    categories: [OXCE_SIDE_WEAPONS]
  - type: STR_PSI_AMP
    categories: [OXCE_SIDE_WEAPONS]
  - type: STR_STUN_ROD
    categories: [OXCE_SIDE_WEAPONS]
  - type: STR_ELECTRO_FLARE
    categories: [OXCE_GRENADES]

« Last Edit: February 13, 2024, 09:21:40 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8629
    • View Profile
Re: [DONE][Suggestion] Inventory auto-placement priorities/rules
« Reply #18 on: February 13, 2024, 09:16:46 pm »
Lastly, since there are new item categories and thus new translations needed, I'd like to ask for help with translations for the following strings:

Code: [Select]
en-US:
  OXCE_CRAFT_WEAPONS: "Craft weapons"
  OXCE_HWPS: "HWPs"
  OXCE_MAIN_WEAPONS: "Main weapons"
  OXCE_SIDE_WEAPONS: "Side weapons"
  OXCE_AMMO: "Ammo"
  OXCE_GRENADES: "Grenades"
  OXCE_ARMORS_AND_CORPSES: "Armors & Corpses"
  OXCE_PRISONERS: "Prisoners"
  OXCE_COMPONENTS: "Components"

Code: [Select]
en-US:
  OXCE_HWPS: "SWSs"    # TFTD version of HWPs (heavy weapon platforms) is SWSs (submersible weapon systems)

I'm interested mainly in the following languages:
- Finnish, Hungarian, Italian, Japanese, Korean, Polish, Portuguese, Spanish, Russian

Other languages are of course welcome too.
« Last Edit: February 13, 2024, 09:23:28 pm by Meridian »

Offline Kozinsky

  • Captain
  • ***
  • Posts: 91
  • Sorry for my bEd English
    • View Profile
Re: [DONE][Suggestion] Inventory auto-placement priorities/rules
« Reply #19 on: February 14, 2024, 10:08:07 am »
Russian:
Code: [Select]
ru:
#xcom1:
  OXCE_CRAFT_WEAPONS: "Бортовое вооружение"
  OXCE_HWPS: "ТБП"
  OXCE_MAIN_WEAPONS: "Основное оружие"
  OXCE_SIDE_WEAPONS: "Вспомогательное оружие" # or shorter version: "Вспом. оружие"
  OXCE_AMMO: "Боеприпасы"
  OXCE_GRENADES: "Гранаты"
  OXCE_ARMORS_AND_CORPSES: "Броня и трупы"
  OXCE_PRISONERS: "Заключённые"
  OXCE_COMPONENTS: "Компоненты"
#xcom2:
  OXCE_HWPS: "ПБС"

Ukrainian:
Code: [Select]
uk:
#xcom1:
  OXCE_CRAFT_WEAPONS: "Бортове озброєння"
  OXCE_HWPS: "ВБП"
  OXCE_MAIN_WEAPONS: "Основна зброя"
  OXCE_SIDE_WEAPONS: "Допоміжна зброя"
  OXCE_AMMO: "Набої"
  OXCE_GRENADES: "Гранати"
  OXCE_ARMORS_AND_CORPSES: "Броня та трупи"
  OXCE_PRISONERS: "В'язні"
  OXCE_COMPONENTS: "Компоненти"
#xcom2:
  OXCE_HWPS: "ПБС"

Offline ontherun

  • Colonel
  • ****
  • Posts: 299
  • Lazy-ass captain
    • View Profile
Re: [DONE][Suggestion] Inventory auto-placement priorities/rules
« Reply #20 on: February 14, 2024, 11:13:43 am »
Italian (of course felle free to modify/improve!)

Code: [Select]
en-IT:
  OXCE_CRAFT_WEAPONS: "Armi da vascello"
  OXCE_HWPS: "Piattaforma per armi pesanti"
  OXCE_MAIN_WEAPONS: "Armi principali"
  OXCE_SIDE_WEAPONS: "Armi secondarie"
  OXCE_AMMO: "Munizioni"
  OXCE_GRENADES: "Granate"
  OXCE_ARMORS_AND_CORPSES: "Armature & Cadaveri"
  OXCE_PRISONERS: "Progionieri"
  OXCE_COMPONENTS: "Componenti"

Code: [Select]
en-IT:
  OXCE_HWPS: "Sistemi armi sommergibili"    # Le versioni TFTD HWP (piattaforma armi pesanti) sono le SWS (sistemi d'arma sommergibili)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8629
    • View Profile
Re: [DONE][Suggestion] Inventory auto-placement priorities/rules
« Reply #21 on: February 17, 2024, 05:54:34 pm »
Added cs, de, it, pl, ru and uk translations.
« Last Edit: February 24, 2024, 01:59:52 pm by Meridian »