Author Topic: Custom item categories  (Read 4257 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Custom item categories
« on: April 12, 2016, 10:47:54 pm »
So, I've added possibility to categorize items... each item can belong to zero, one or even multiple categories.

Currently, it is used only for filtering on the Craft Equipment screen, but it may be used also on other places in the future...

Example:

Code: [Select]
extraStrings:
  - type: en-US
    strings:
      STR_AUXILIARY: "Auxiliary"
      STR_MELEE: "Melee"
      STR_SHORT_RANGE: "Short range"
      STR_LONG_RANGE_ARC: "Long range (arc)"
      STR_LONG_RANGE_LINE: "Long range (line)"
      STR_GRENADES: "Grenades"
      STR_EQUIPMENT: "Equipment"
      STR_OTHER: "Other"
itemCategories:
  - type: STR_AUXILIARY
    listOrder: 10
  - type: STR_MELEE
    listOrder: 20
  - type: STR_SHORT_RANGE
    listOrder: 30
  - type: STR_LONG_RANGE_ARC
    listOrder: 40
  - type: STR_LONG_RANGE_LINE
    listOrder: 50
  - type: STR_GRENADES
    listOrder: 60
  - type: STR_EQUIPMENT
    listOrder: 70
  - type: STR_OTHER
    listOrder: 80
items:
  - type: STR_PARROT
    categories: [STR_AUXILIARY]
  - type: STR_DOGE
    categories: [STR_AUXILIARY, STR_MELEE]
  - type: STR_HAMMER
    categories: [STR_MELEE]
  - type: STR_CATTLE_PROD
    categories: [STR_MELEE]
  - type: STR_FUSO_KNIVES
    categories: [STR_SHORT_RANGE]
  - type: STR_JAVELINS
    categories: [STR_SHORT_RANGE]
  - type: STR_BOW
    categories: [STR_LONG_RANGE_ARC]
  - type: STR_LONGBOW
    categories: [STR_LONG_RANGE_ARC]
  - type: STR_SNIPER_RIFLE
    categories: [STR_LONG_RANGE_LINE]
  - type: STR_SNIPER_RIFLE_CLIP_PS
    categories: [STR_LONG_RANGE_LINE]
  - type: STR_GRENADE_FRAG
    categories: [STR_GRENADES]
  - type: STR_WP_GRENADE
    categories: [STR_GRENADES]
  - type: STR_BEER
    categories: [STR_EQUIPMENT]
  - type: STR_BANDAGE
    categories: [STR_EQUIPMENT]
  - type: STR_CREDIT_CHIP_D
    categories: [STR_OTHER]
  - type: STR_CREDIT_CHIP_M
    categories: [STR_OTHER]

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Custom item categories
« Reply #1 on: April 12, 2016, 11:45:59 pm »
Nice one! I really missed it.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Custom item categories
« Reply #2 on: April 15, 2016, 12:22:09 pm »
This will really help to tame that beast of a mod :)

EDIT: Works like a charm, and wonderfully helps with squad equipping. Thanks!
« Last Edit: April 16, 2016, 08:22:11 pm by Dioxine »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Custom item categories
« Reply #3 on: April 19, 2016, 10:20:12 pm »
Being a little overwhelmed by the number of default categories, I decided to add a few more option for players to organize their categories.
There are 2 new options:
1. ability to hide a category (hidden: true)
2. ability to replace a category with a different category, i.e. merge them together (replaceBy: STR_SOME_CATEGORY)

This is the cleanup I did for my needs, serves as example too, screenshot attached:

Code: [Select]
extraStrings:
  - type: en-US
    strings:
      STR_BAT_CAT_THROWN: "Bows & throwables"
      STR_BAT_CAT_PISTOL: "Pistols & other junk"
      STR_BAT_CAT_RIFLE: "Rifles & sniping"
      STR_BAT_CAT_CHAINGUN: "Heavy stuff"
      STR_BAT_CAT_GRENADE: "Grenades"
      STR_BAT_CAT_HEALING: "Equipment"
items:
  - type: STR_FIRE_EXT
    categories: [STR_BAT_CAT_HEALING]
  - type: STR_STUN_ROD
    categories: [STR_BAT_CAT_MELEE]
itemCategories:
  - type: STR_BAT_CAT_AUX
    hidden: true
  - type: STR_BAT_CAT_AUTO_MELEE
    replaceBy: STR_BAT_CAT_MELEE
  - type: STR_BAT_CAT_SHOTGUN
    replaceBy: STR_BAT_CAT_PISTOL
  - type: STR_BAT_CAT_CARBINE
    replaceBy: STR_BAT_CAT_PISTOL
  - type: STR_BAT_CAT_SNIPER
    replaceBy: STR_BAT_CAT_RIFLE
  - type: STR_BAT_CAT_CANNON
    replaceBy: STR_BAT_CAT_CHAINGUN
  - type: STR_BAT_CAT_GL
    replaceBy: STR_BAT_CAT_CHAINGUN
  - type: STR_BAT_CAT_RL
    replaceBy: STR_BAT_CAT_CHAINGUN
  - type: STR_BAT_CAT_GUIDED
    replaceBy: STR_BAT_CAT_CHAINGUN
  - type: STR_BAT_CAT_PROXY
    replaceBy: STR_BAT_CAT_GRENADE
  - type: STR_BAT_CAT_STIM
    replaceBy: STR_BAT_CAT_HEALING
  - type: STR_BAT_CAT_MORALE
    replaceBy: STR_BAT_CAT_HEALING
  - type: STR_BAT_CAT_INTELLIGENCE
    replaceBy: STR_BAT_CAT_HEALING
  - type: STR_BAT_CAT_PIERCING
    hidden: true
  - type: STR_BAT_CAT_FIRE
    hidden: true
  - type: STR_BAT_CAT_CONCUSSIVE
    hidden: true
  - type: STR_BAT_CAT_EXPLOSIVE
    hidden: true
  - type: STR_BAT_CAT_HEAT
    hidden: true
  - type: STR_BAT_CAT_LASER
    hidden: true
  - type: STR_BAT_CAT_PLASMA
    hidden: true
  - type: STR_BAT_CAT_PLASMA_BLAST
    hidden: true
  - type: STR_BAT_CAT_STUN
    hidden: true
  - type: STR_BAT_CAT_STUN_BLAST
    hidden: true
  - type: STR_BAT_CAT_CUTTING
    hidden: true
  - type: STR_BAT_CAT_SHRAPNEL
    hidden: true
  - type: STR_BAT_CAT_CHEM
    hidden: true
  - type: STR_BAT_CAT_ACID_BLAST
    hidden: true
  - type: STR_BAT_CAT_CHOKE
    hidden: true
  - type: STR_BAT_CAT_POISON_GAS
    hidden: true
  - type: STR_BAT_CAT_SMOKE
    hidden: true
  - type: STR_BAT_CAT_SPECIAL
    hidden: true
  - type: STR_BAT_CAT_FOREVER
    hidden: true
  - type: STR_BAT_CAT_PSI_ONLY
    hidden: true
  - type: STR_BAT_CAT_TREASURE
    hidden: true