OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Support => Topic started by: Delian on September 11, 2024, 01:45:44 am
-
In ground battles, unit's rank is represented by a single number, rankInt. For friendly units, this rank starts with 0 for rookies, and goes up to 5 for commander. However, for the enemies, this number does not represent a unit's military rank, but is instead the unit's race member index (limited to 7), which usually has the opposite order. So this number has two different meanings, depending on which faction the unit belongs to.
This creates a problem with formulae which contain rank. Some mods have items where damage scales with rank. If you put such an item in the hands of a common enemy soldier, the item will suddenly do very high damage, because the race member index of such a soldier has a high rankInt number.
So, I think that for better consistency, the number used for rank in formulae should always come only from unit's military rank:
STR_LIVE_SOLDIER = STR_LIVE_TERRORIST = STR_ROOKIE = 0
STR_LIVE_NAVIGATOR = STR_SQUADDIE = 1
STR_LIVE_MEDIC = STR_SERGEANT = 2
STR_LIVE_ENGINEER = STR_CAPTAIN = 3
STR_LIVE_LEADER = STR_COLONEL = 4
STR_LIVE_COMMANDER = STR_COMMANDER = 5
-
This will break vanilla game.
Use unit faction check instead(unit.getFaction). This will make script longer, but will work.
-
I'm not saying that the behavior of the existing rankInt should be changed, it cannot be changed because AI depends on it (how patrol paths are determined). I'm saying that when rank is used in formulae, rankInt should not be read, and instead a new number that comes from the rank string should be generated and used. Or is there some other solution?
-
keyword is "normalized", I think I can add some thing like this
-
The term normalized in this game has a specific meaning, as a value between 0 and 1. I don't think it makes sense for ranks to be 0.0, 0.2, 0.4, 0.6, 0.8 and 1.0. And even if you added a rankNormalized formula term, that wouldn't solve the problem with the original rank term.
-
I mean "normalized" in more general term, like both will grown in same direction too, like 1.0 will be always for top alien and solder.