• 0

    posted a message on How to get the interceptors of a carrier

    I need to iterate the interceptors of a carrier and I can't find the function which gives them. I tried with UnitCargoGroup and UnitInventoryGroup with no avail.

    UnitCargoGroup gives an invalid group, and UnitInventoryGroup gives an empty one.

     

    A screen capture of the debugger is attached.

    Posted in: Triggers
  • 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
  • 0

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

    In reply to MaskedImposter:

    This is the iterator I use and it doesn't filter hidden units out.

     

            Unit Group -For each unit armyUnit in (Any units in (Entire map) owned by player Any Player matching Excluded: Structure, Worker, Resource (Raw), Resource (Harvestable), Missile, Item, Dead, Hallucination, Summoned, Map Boss, with at most Any Amount) do (Actions)
                Actions
                    addUnitCost(armyUnit,costAccums[(Owner of armyUnit)])
    

     Thank you anyway MaskedImposter

    Posted in: Triggers
  • 0

    posted a message on Mod with triggers

    Which type is your mod? Extension or dependent mod? Which events are supposed to fire your script?

    Posted in: Triggers
  • 0

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

    I did a extension mod that adds army upkeep based on unit value that is implemented iterating all the units in the map.

    It would works fine if the units inside nydus networks were part of the region "entire map", but they aren't.

    So, how can I get the group of units inside the nydus channels? 

     

    The mod's name is "upkeep" and is already published for those who want to see it.

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