Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Can't put waits in group or force callbacks; the thread crashes when it encounters a wait in either of these, so the actions after the wait are not executed.
The 'Do Nothing' command is (unsurprisingly) useless and never needs to be used; simply don't put any actions there.
You are leaking a few points, a unit group, and a force (player group) which you should avoid. Here's a good resource to explain what leaking is and how to fix it: Things That Leak
Wait has a minimum duration of ~0.27 seconds, so it won't actually wait 0.01 here.
The method you're doing is kind of silly. No need to compare the distance to all AI controlled units, just look in a 96 radius around the structure and see if there are any. This means you don't have to do the distance comparison yourself, the unit group getting is doing that internally for you.
AntiBuild
Events
Unit - A unit Begins construction
Conditions
Actions
Set TempP = (Position of (Constructing Structure)) //point variable
Set Count = 0 //integer variable
Custom script: set bj_wantDestroyGroup = true //this cleans the group leak in the next line automatically
Unit Group - Pick every unit in (Units within 96.00 of TempP matching ((Owner of (Matching Unit)) controller equal to Computer) and do (Actions)
Loop - Actions
Set Count = (Count + 1)
Custom script: call RemoveLocation(udg_TempP) //cleaning point leak
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Count greater than 0
Then - Actions
Set TempF = (Player group((Owner of (Constructing structure)))) //Player Group variable
Game - Display to TempF the text: |c0000cdf9Possible ...
Custom script: call DestroyForce(udg_TempF) //cleaning force leak
It's not useless in single-line if actions, as the GUI needs something in the "else" field to be able to close the dialog.
It's entirely pointless in a multi-line though.
It's not useless in single-line if actions, as the GUI needs something in the "else" field to be able to close the dialog.
It's entirely pointless in a multi-line though.
I know that you're aware, I'm just stating it for readers of the thread.
Single lines are neat for short things, as it remains readable, whereas a collapsed multiline does not. Granted it isn't terribly useful, but it has its moments.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.