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.
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.
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.
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.
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.