• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

catching acolyte starting building summon

Status
Not open for further replies.
Level 12
Joined
Jun 15, 2016
Messages
472
In that case you could check for worker unit that are standing idle around it and make one of them disappear. It might not always make the one who summoned it disappear but I think that's a close approximation.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
It requires a very complex trigger system to detect what builder starts building the foundation of a building.

Firstly all active building foundation orders (building type, target location, ordered unit) must be kept track of. When the building construction starts all active foundation orders must be searched for the one corresponding to the building. This is done by checking owner of building and ordered units are the same, checking the foundation and building types match, and seeing if the target ordered location is approximately the same as the building location (non-pathing buildings can be offset +/- ~32 units). If multiple matches are found then the ordered unit closest to the foundation/building location can be assumed the responsible builder.

The accuracy of this technique is very good, but not perfect. If a player orders 2 separate workers to build the same building type at the same location and they arrive at approximately the same time then it may return the wrong builder. Seeing how specific this failure case is, and that usually it makes little difference, one can say the technique is reliable.
 
Level 23
Joined
Oct 18, 2008
Messages
936
It requires a very complex trigger system to detect what builder starts building the foundation of a building.

Firstly all active building foundation orders (building type, target location, ordered unit) must be kept track of. When the building construction starts all active foundation orders must be searched for the one corresponding to the building. This is done by checking owner of building and ordered units are the same, checking the foundation and building types match, and seeing if the target ordered location is approximately the same as the building location (non-pathing buildings can be offset +/- ~32 units). If multiple matches are found then the ordered unit closest to the foundation/building location can be assumed the responsible builder.

The accuracy of this technique is very good, but not perfect. If a player orders 2 separate workers to build the same building type at the same location and they arrive at approximately the same time then it may return the wrong builder. Seeing how specific this failure case is, and that usually it makes little difference, one can say the technique is reliable.

this is pretty close to what I was thinking, too. I'll need to test which happens first but picking an acolyte whose current order changes near the point in time when the building starts might improve/simplify it.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
I'll need to test which happens first but picking an acolyte whose current order changes near the point in time when the building starts might improve/simplify it.
There are no issued orders when the foundation turns into a unit (building). Only Human builder gets issued an order and that is because human build requires repair.

Current order polling would be very inefficient for this. Although maybe combining that with the system I described could give 100% accurate results if the current order of the actual builder changes and not of the error causing builders.
 
Level 23
Joined
Oct 18, 2008
Messages
936
it appears their order continues to be to build the building for about a whole second after it's been built... no luck there.

I think I should rather look for a workaround to let non-undead workers use haunted gold mines since that's all I made them undead for anyway. I could probably force them to morph to undead when given orders targeting a gold mine and reissue the order as gather.
 
Status
Not open for further replies.
Top