• 🏆 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!

[Solved] Exact Harvest/Gather behaviour?

Status
Not open for further replies.
So I'm trying to figure out when peasants/peons search for the nearest resource/dropoff and when they go to the last used one.

I think they always go to the last used resource to gather, and (almost) always search for the nearest dropoff to return, but I'm not 100% sure and it's not entirely clear to me, especially the returning behaviour.

Any insights? Thanks.

Edit: after a little bit of testing I'm 99% sure it's like this:
Always go to last used resource if there is one (as I already knew/thought).
Always go to nearest dropoff as determined by the game's pathfinding, from the default building "exit" point if it is a goldmine. That's why in some cases it may seem like it's not going to the nearest one in absolute terms.
 
Last edited:
Level 18
Joined
Nov 21, 2012
Messages
835
from the default building "exit" point if it is a goldmine
interesting detail, I didn't know that.
While working on my "custom resources" I remember 2 diffrent orders for returning behaviour, it might be helpful for you. When player uses "return resources" button - immediate order is issued, but when peasant comes back without any actions from a player (auto-come back) target order is issued (closest building with ability 'Argl' (or similar) is targeted.
 
I'm not 100% sure about that, but in some cases the peasant/peon goes to a town hall below a gold mine even though there's a town hall above the gold mine that is actually closer, so I think it's because of that.

Interesting, I'm actually doing something similar. I have two channel abilities for "return" with the same order ID string, one visible without a target, one hidden with a unit target. When that order string is used without a target (i.e. player pushes the button), the script issues it again but targeting the nearest resource.
That way the button behaves like other "return" abilities and the visible button will show as "active" until the effect of the hidden one starts.
 
Status
Not open for further replies.
Top