OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Support => Topic started by: The Martian on April 29, 2020, 12:54:21 pm
-
Could someone please give me an example of the syntax for categories: for use with the items: section.
My understanding is that it is possible to allow one item to be in multiple categories, example:
A laser weapon could be in both the categories "Laser Weapons" and "Alien made Laser Weapons" to differentiate it from other weapons found in the category of "X-Com made Laser Weapons".
How do I phrase this on the item?
Is it done like the compatibleAmmo: variable?
items:
- type: STR_EXAMPLE_LASER_RIFLE
categories:
- STR_CAT_LASER_WEAPONS
- STR_CAT_ALIEN_LASER_WEAPONS
Or is it more like this?
items:
- type: STR_EXAMPLE_LASER_RIFLE
categories: [ STR_CAT_LASER_WEAPONS, STR_CAT_ALIEN_LASER_WEAPONS ]
I'm assuming that the categories themselves are defined just like an item by placing them after the items: variable like this:
items:
# Category for all Laser Weapons
- type: STR_CAT_LASER_WEAPONS
hidden: false
# category for only Alien Laser Weapons
- type: STR_CAT_ALIEN_LASER_WEAPONS
hidden: true
Is that correct?
-
items:
- type: STR_EXAMPLE_LASER_RIFLE
categories: { STR_CAT_LASER_WEAPONS, STR_CAT_ALIEN_LASER_WEAPONS }
I believe that is the proper syntax.
-
Is it done like the compatibleAmmo: variable?
items:
- type: STR_EXAMPLE_LASER_RIFLE
categories:
- STR_CAT_LASER_WEAPONS
- STR_CAT_ALIEN_LASER_WEAPONS
Or is it more like this?
items:
- type: STR_EXAMPLE_LASER_RIFLE
categories: [ STR_CAT_LASER_WEAPONS, STR_CAT_ALIEN_LASER_WEAPONS ]
Both. It is the two ways to define sets in ruleset files.
I'm assuming that the categories themselves are defined just like an item by placing them after the items: variable like this:
items:
# Category for all Laser Weapons
- type: STR_CAT_LASER_WEAPONS
hidden: false
# category for only Alien Laser Weapons
- type: STR_CAT_ALIEN_LASER_WEAPONS
hidden: true
Is that correct?
No, you need another .rul file
itemCategories:
- type: STR_CAT_LASER_WEAPONS
listOrder: 2
- type: STR_CAT_ALIEN_LASER_WEAPONS
listOrder: 4
-
That makes things much easier.
Thank you for the help.