Thanks for the answer. I don't think 20 as such is not enough, it's more about designing a system with dynamic spot - so units with better observation skill will spot enemies who are further, and units with better stealth can get closer without being spotted. Much like in UFO: Aftershock. I remember that Dioxine explained it somewhere.
Frankly it was more of a thought experiment than anything else, but I also have a real problem. For the X-Com Files mod I'm working on, I would like to add "undercover" missions where you can only use certain equipment (only concealable weapons like pistols and only selected armours, meaning no armour). I plan to use the "underwater only" mechanics, which won't allow you to use normal weapons.
My question boils down to: is it possible to make such a category of weapons? I think it would require changing the boolean for underwater only/everywhere into an integer, so we could have different environments for different stuff. Plus everything regarding armour behaviour that was already discussed to death in hybrid game threads.
Categorizing weapons and armor in any imaginable way is easy.
The hard part is what to do with that information.
There are many ways how to interpret this categorization, some of which are easy to implement, some are harder and some are probably even impossible.
Example of "easy" is the under-water categorization (and anything similar).
You flag a weapon to be usable under water only and check whether you are under water... if yes, give error.
I.e. checks are done only when you actually try doing something, not before.
If you however needed functionality that these weapons cannot even be equipped on the craft at all... that would be considerably harder...
...which brings us to armor.
Since the soldiers are wearing armor already before the mission, I cannot just produce an error "Armor is not allowed"... because I don't know what kind of mission will the player decide to go for.
What I could do is make them undress the armor (either all armor; or armor which has the same (new) flag as the (also new) flag on the mission type).
The armor would then be retrieved after the mission as "recovered items" so that you don't lose it.
Would that cover your need?
PS: I could also un-equip all disallowed weapons (i.e. put them on the ground before mission), and disable the ability to equip them... probably better than to find out during battle that you can't use any of your weapons
Problem will arise if the player doesn't bring any usable weapons at all
Does maxDarknessToSeeUnits means how much lighting the target must have to be detected? I never saw such mechanics in action.
I am thinking about how stealth could work in OXC. Catgirl "sneaking" is very gamey, acting almost as a chess piece right now.
"maxDarknessToSeeUnits" means how dark it must be so that game treats the dusk/dawn as night.
0 = day
15 = night
1-14 are dusk/dawn... but for visibility purposes they need to be treated either as day or night;
"maxDarknessToSeeUnits: 9" defines that 10-14 is night and 1-9 is day
"maxDarknessToSeeUnits: 4" would mean that 5-14 is night and 1-4 is day.... etc.