45
« on: April 20, 2023, 02:00:47 am »
here's some notes and code in Mv2 ...
remember that notes are merely notes ... might not be accurate.
// Rules on nodes and node-links (OxC)
//
// - unittype is used for spawning and patrolling only; it is not used by
// links
// - noderank affects both spawning and patrolling, but note that noderank
// has a fallback mechanic for spawning such that if no node with an
// aLien's rank is found, a succession of (all) other ranks will be
// investigated (but not XCOM rank ofc)
// - re. unittypes: small units are allowed to use large nodes but not vice
// versa and flying units are allowed to use non-flying nodes but not vice
// versa. Thus 'Large' nodes are effectively identical to 'Any' nodes.
// - link distance is not used
// - spawnweight 0 disallows spawning at a node, but patrolpriority 0 is
// valid for patrolling to a node if a unit is flagged, by OxC, to "scout"
// (details tbd) else patrolpriority 0 disallows patrolling the node: the
// OxC "scout" flag appears to be, at least in part, another fallback
// mechanic - that is, an aLien will check for valid non-scout nodes first
// but if none are found, the routine then checks for valid "scout" nodes.
// But don't quote me on that; there's more going on between (a)
// patrolpriority, (b) noderank, and (c) the "scout" flag ...
// - it appears that if the OxC "scout" flag is not set, then the aLien to
// which it's being applied will not leave the block it's currently in.
// More investigation req'd
// - quote from the OxC code:
// "scouts roam all over while all others shuffle around to adjacent
// nodes at most"
// I believe, at a guess, that this is designed to keep Commanders in the
// command module, eg, or at least increase the chance of aLiens sticking
// around their non-CivScout patrol nodes. Long story short: OxC has
// hardcoded patrolling behavior beyond what can be determined by the
// Route files. (I didn't look at OxCe)
//
// 0 = Any, 1 = Flying, 2 = Flying Large, 3 = Large, 4 = Small <- UfoPaedia.Org BZZZT.
public enum UnitType
: byte // ca1028 - use Int32
{
Any, // 0
FlyingSmall, // 1
Small, // 2
FlyingLarge, // 3
Large // 4 - aka. 'Any'
};
public enum NodeRankUfo
: byte // ca1028 - use Int32
{
CivScout, // 0
XCOM, // 1
Soldier, // 2
Navigator, // 3
LeaderCommander, // 4
Engineer, // 5
Misc1, // 6
Medic, // 7
Misc2, // 8
invalid // 9 - WORKAROUND.
};
public enum NodeRankTftd
: byte // ca1028 - use Int32
{
CivScout, // 0
XCOM, // 1
Soldier, // 2
SquadLeader, // 3
LeaderCommander, // 4
Medic, // 5
Misc1, // 6
Technician, // 7
Misc2, // 8
invalid // 9 - WORKAROUND.
};
I think i just need to change NodeRankTftd.LeaderCommander to NodeRankTftd.NavigatorCommander ...