Hey. Tried searching this issue on the forums and google, but after around 30 minuets of tinkering around, I couldn't find anything really relevant.
So I'm making this macro map, and I am trying to detect if a building becomes idle. The whole thing is based upon measuring the idle time of a few buildings.
I go about everything the usual way:
Event > Any Unit becomes Idle
Condition > IsTownHall(Triggering Unit)
Actions > add unit to a stack
It wouldn't trigger at all. So, After a while I did some debugging to see when something becomes idle. Tried making several buildings, and all I could get from "Any Unit becomes Idle", were units. No building would become idle, not even after a very long set period of time. (idle, as in, not making units)
However, the buildings are also classified as "units" in the editor.
Perhaps I'm missing something here? Any help or workaround would be awesome. One work around I could think of, is see if the unit has stopped production. It would be much easier however, if I could just detect or fire an event when ever a building on the map becomes idle.
I haven't seen you before so let me first welcome you to sc2mapster. :D
Anyways....By chance are you making a nexus wars style map? Do you want the building to just train 1 unit for infinity by ordering it to train every time it finishes training something? It thats the case, then you should use a different event. I believe there is one called " unit is created" or something along those lines. If you aren't doing a map of that style... I honesty dont know what to tell you. If that is the case, send me a PM and I will look into it further for you.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
I haven't seen you before so let me first welcome you to sc2mapster. :D
Anyways....By chance are you making a nexus wars style map? Do you want the building to just train 1 unit for infinity by ordering it to train every time it finishes training something? It thats the case, then you should use a different event. I believe there is one called " unit is created" or something along those lines. If you aren't doing a map of that style... I honesty dont know what to tell you. If that is the case, send me a PM and I will look into it further for you.
Thanks :D. PM'ed.
The map is basically a melee map trainer, to help players develop higher efficiency of their buildings and what not.
Really I tested this myself and cant figure it out. I'm sure somebody knows about this though...
I think I figured a way out of this. There is a condition which checks to see if the building (or unit)'s progress bar is active, empty, or paused. It should be just as simple, to run a check to see if its empty, then run the check again after a given (short) period of time, and if the result is the same, then its idle. I should be able to just run the check on every building, and add up the time to different counters depending on the building.
This is just a work around solution to the problem, not addressing the problem itself. But it works for my application, So i'm pretty happy.
Thanks for your help though zelda. It took me a while to figure out something new, as I would have tried to fix the old broken thing.
I was curious if you have by chance figured out a better solution since. This is highly relevant to my interests and will soon be a problem I need to solve this week. ;)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey. Tried searching this issue on the forums and google, but after around 30 minuets of tinkering around, I couldn't find anything really relevant.
So I'm making this macro map, and I am trying to detect if a building becomes idle. The whole thing is based upon measuring the idle time of a few buildings.
I go about everything the usual way:
Event > Any Unit becomes Idle
Condition > IsTownHall(Triggering Unit)
Actions > add unit to a stack
It wouldn't trigger at all. So, After a while I did some debugging to see when something becomes idle. Tried making several buildings, and all I could get from "Any Unit becomes Idle", were units. No building would become idle, not even after a very long set period of time. (idle, as in, not making units)
However, the buildings are also classified as "units" in the editor.
Perhaps I'm missing something here? Any help or workaround would be awesome. One work around I could think of, is see if the unit has stopped production. It would be much easier however, if I could just detect or fire an event when ever a building on the map becomes idle.
I haven't seen you before so let me first welcome you to sc2mapster. :D
Anyways....By chance are you making a nexus wars style map? Do you want the building to just train 1 unit for infinity by ordering it to train every time it finishes training something? It thats the case, then you should use a different event. I believe there is one called " unit is created" or something along those lines. If you aren't doing a map of that style... I honesty dont know what to tell you. If that is the case, send me a PM and I will look into it further for you.
Thanks :D. PM'ed.
The map is basically a melee map trainer, to help players develop higher efficiency of their buildings and what not.
>.< This is annoying.....youre right. I dont see why the trigger wont work. Grr...Maybe somebody else knows?
*shameless bump*
Another shameless bump.
Really I tested this myself and cant figure it out. I'm sure somebody knows about this though...
I think I figured a way out of this. There is a condition which checks to see if the building (or unit)'s progress bar is active, empty, or paused. It should be just as simple, to run a check to see if its empty, then run the check again after a given (short) period of time, and if the result is the same, then its idle. I should be able to just run the check on every building, and add up the time to different counters depending on the building.
This is just a work around solution to the problem, not addressing the problem itself. But it works for my application, So i'm pretty happy.
Thanks for your help though zelda. It took me a while to figure out something new, as I would have tried to fix the old broken thing.
Glad to see you figured it out :D
@HellsAn631: Go
I was curious if you have by chance figured out a better solution since. This is highly relevant to my interests and will soon be a problem I need to solve this week. ;)