Is there a way to only allow a unit/soldier to only carry a particular type of weapon?
For example, Say I wanted a new soldier type I'm creating to only be able to carry a pistol. If I tried to assign a rifle at the beginning of a battlescape or try to pick up a plasma weapon, I couldn't.
Nord was able to prevent an item from operating via scripting.
But it could still be used (Without effect) which spent TU and it also could be equipped to the slots in inventory.
See the end of this thread:
Restricting weapon use by Stats/Armor/Unit Type?Alternatively maybe you could use
fixedWeapon: to graft the pistol/rifle/etc to that soldier type so it couldn't drop it?
I've been using several scripts in my project and it really does open up new options... however creating them can be difficult compared to YAML in a .rul file.
If you want to give it a try here is some useful information:
Scripting BasicsNo, such feature doesn't exist and is also not planned.
If you did implement a feature in OXCE to be able to prevent certain weapons firing with specific armors it would be very welcome.
Perhaps something like this:
armors:
- type: STR_ARMOR_THAT_CANNOT_USE_SOME_ITEMS_UC
forbiddenWeapons:
- STR_RIFLE
- STR_PISTOL
This armor with
forbiddenWeapons: could not use any items on the above list.
armors:
- type: STR_ARMOR_THAT_CAN_USE_SPECIAL_ITEM_UC
allowedWeapons:
- STR_ARMOR_CONNECTED_FLAMETHROWER
This armor with
allowedWeapons: acts as if all items have been added to the
forbiddenWeapons: list, except for those in the
allowedWeapons: list.
Or would it be easier to keep track of lists of
forbiddenArmors: allowedArmors: on the item itself?
There are usually less armors than items so maybe that would be better if this was attempted?
items:
- type: STR_SPECIAL_GUN_THAT_CAN_ONLY_BE_USED_BY_SPECIAL_ARMOR
allowedArmors:
- STR_SPECIAL_ARMOR_UC
- STR_OTHER_SPECIAL_ARMOR_UC
Although you are not planning to make it, what would you want if it was present
Meridian?
(I'm just curious about how you would phrase the code.)
personally speaking, that was one of the features i liked the least about xcom 2012
I think the problem with xcom 2012 was that there wasn't much you could actually equip each soldier with, so it became more of a 'this soldier is this class and thus has this gun'.
Many OpenXcom mods have a large enough item selection that this should not be a problem.
Of course it would depend on how the person writing the mod implemented the restrictions.
Something like Memmaker's '
Vigilo Confido' would probably deliberately mirror xcom 2012 using this ability.