This trigger works fine in that it assigns the all 4 custom values to each building it selects. As far as I know the pick each unit trigger always starts from the bottom-most unit and then works its way up. The problem with this trigger is that it doesn't apply the actions to any units besides or above the building called "1 Building - Capital". I added a ping action for each building it selected and saw that it simply stops. Any unit below the Capital has all 4 custom values filled out when probed for its custom values. Any unit besides or above the capital will have no custom values. The centralization ended message that should appear on completion of the trigger also fails to appear.
think the problem might have something to do with the nested loops but removing the 2nd unit loop didn't fix the problem and one of them is a for loop (so there shouldn't be a problem with the nested loops to begin with). I have cut up this script is many various ways and still cannot isolate the problem. I hope that you guys can help.
All units are the same exact type of units which fits the required Structure condition of the pick each unit loop.
Trigger is probably hitting the op limit as it appears to have an inherit complexity of O(n^2). Use the trigger debugger for more detail, it should log errors as well as allowing you to inspect what is exactly going on at any given time in the trigger.
Units are picked based on internal ordering within data structures. This will probably be biased in some direction based on how quad trees or other internal data structures are travelled.
I managed to produce a divide by zero error by copy pasting a fresh version of this trigger and the trigger to probe for custom values of buildings to a clean map. For some reason, this error would not show on my main map. I managed to then fix the problem by adding an if command that makes sure the value of "capitaldistance" and "colonydistance" is always greater than 0. Thank you for your help.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Here is how my trigger looks like
This trigger works fine in that it assigns the all 4 custom values to each building it selects. As far as I know the pick each unit trigger always starts from the bottom-most unit and then works its way up. The problem with this trigger is that it doesn't apply the actions to any units besides or above the building called "1 Building - Capital". I added a ping action for each building it selected and saw that it simply stops. Any unit below the Capital has all 4 custom values filled out when probed for its custom values. Any unit besides or above the capital will have no custom values. The centralization ended message that should appear on completion of the trigger also fails to appear.
think the problem might have something to do with the nested loops but removing the 2nd unit loop didn't fix the problem and one of them is a for loop (so there shouldn't be a problem with the nested loops to begin with). I have cut up this script is many various ways and still cannot isolate the problem. I hope that you guys can help.
All units are the same exact type of units which fits the required Structure condition of the pick each unit loop.
Sorry just to doublecheck, the units you are looking for have the structure attribute checked (not just given a footprint and assumed to be one).
series of questions.
If that's the case could you post the above trigger with the ping action in it?
Is the owner of the buildings not being pinged in the correct user group?
The subtitle chat area works for other messages? sometimes it may not work.
Does it finish for just one player? How many players does it manage to get through before dying?
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Trigger is probably hitting the op limit as it appears to have an inherit complexity of O(n^2). Use the trigger debugger for more detail, it should log errors as well as allowing you to inspect what is exactly going on at any given time in the trigger.
Units are picked based on internal ordering within data structures. This will probably be biased in some direction based on how quad trees or other internal data structures are travelled.
Yep 100% sure that I'm using the exact same type of units.
Trigger With Ping, also added wait 2 seconds so I can keep up with pings:
Everyone is in the "user" user group, and I am only testing this single player, I'm not sure how to multiplayer test.
Subtitle chat works perfectly fine for other messages, just not this one.
Again I'm only testing this on singleplayer and it doesn't complete the script. Here is a picture of the problem to help:
Large, central building is the Capital and buildings to the side are structure tags.
I managed to produce a divide by zero error by copy pasting a fresh version of this trigger and the trigger to probe for custom values of buildings to a clean map. For some reason, this error would not show on my main map. I managed to then fix the problem by adding an if command that makes sure the value of "capitaldistance" and "colonydistance" is always greater than 0. Thank you for your help.