I found the function I needed. It is UnitCargoGroup(unit: Unit): UnitGroup
And this is the iteration I use to accumulate the army value of the units inside Nydus Networks:
------- Units inside nydus networks are not included in the `Entire Map` region. So their upkeep is treated sepparately here.
ForEachUnitInGroup(nydusNetwork,(UnitGroup("NydusNetwork",player,(RegionEntireMap()),Excluded: Dead,1)))
actions
ForEachUnitInGroup(armyUnit,(UnitCargoGroup(nydusNetwork)))
actions
addUnitCost(armyUnit,costAccums[player])
Now the mod calculates the army value correctly.
Thank you MaskedImposer for mentioning the word "cargo". It helped me to find the function I needed.
0.952897916301874
I found the function I needed. It is UnitCargoGroup(unit: Unit): UnitGroup
And this is the iteration I use to accumulate the army value of the units inside Nydus Networks:
Now the mod calculates the army value correctly.
Thank you MaskedImposer for mentioning the word "cargo". It helped me to find the function I needed.