• 0.952897916301874

    posted a message on [Solved] How to get the units inside a nydus network?

    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.

    Posted in: Triggers
  • To post a comment, please or register a new account.