Anyone know how I can select the worker who most recently dumped minerals or gas at my nexus? I don't see a way natively. Do I create an actor out of all my probes or something?
I think there is a trigger event for when a worker drops off a resource. What you could do is create a trigger of this, and set a global unit variable to the delivering unit every time this happens, and whenever you need to find the worker who most recently dropped off a resource, just use this variable.
@Honz:
There's Unit Loads/Unloads Cargo and there's Unit Manipulates Inventory Item. The cargo option doesn't take any arguments other than load/unload and I don't think it refers to minerals/gas, and the inventory item only accepts individual units as the inventory items, and I don't know how to make that work or if it's appropriate...
The cargo one was the one that I was referring to, and I feel like there is a "Trigger ..." function you can use to get what kind/amount of the resource that was dropped off, but I am not at home right now, so I can't really verify or give you exact details.
I've been playing around with it and I still can't quite seem to get it to work...
The hotfix I've been using is selecting the unit closest to my base when my minerals/gas change, but this sadly is often incorrect as certain direction are considered closer than others so simultaneous dropoff screws things up.
One of the problems is, I don't see any way to identify either "minerals" or "gas" as an item or cargo unit. It only lets me specify units that have already been specifically placed on the map (such as individual mineral chunks or vespene geysers)
I'm really just trying to replicate the effect in wc3 where I display text over a unit's head when it drops off a resource at the town hall. I have the text all working properly, but my hotfix doesn't always pick the right unit to display it over
With the help of another thread on this, and some playing around, I figured out what to do for anyone who wants to replicate this effect.
Events
Unit - Any Unit uses Probe - Return Cargo at Harvest7 - Drop Off stage (Ignore shared abilities)
Conditions
Resource Count[(Triggering player)][Minerals] < (Player (Triggering player) Minerals)
Actions
Variable - Modify Resource Count[(Triggering player)][Minerals]: + 5
etc etc.
You use a global array that you update whenever a specific resource for a specific player is collected in that player's hash for that resource.
You use that to check which resource has been most recently dropped off. The Unit event will give you Triggering Unit which gives you the unit who dropped the resource off.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Anyone know how I can select the worker who most recently dumped minerals or gas at my nexus? I don't see a way natively. Do I create an actor out of all my probes or something?
Thanks!
@Sprigint: Go
I think there is a trigger event for when a worker drops off a resource. What you could do is create a trigger of this, and set a global unit variable to the delivering unit every time this happens, and whenever you need to find the worker who most recently dropped off a resource, just use this variable.
@Sprigint: Go
The cargo one was the one that I was referring to, and I feel like there is a "Trigger ..." function you can use to get what kind/amount of the resource that was dropped off, but I am not at home right now, so I can't really verify or give you exact details.
I've been playing around with it and I still can't quite seem to get it to work...
The hotfix I've been using is selecting the unit closest to my base when my minerals/gas change, but this sadly is often incorrect as certain direction are considered closer than others so simultaneous dropoff screws things up.
One of the problems is, I don't see any way to identify either "minerals" or "gas" as an item or cargo unit. It only lets me specify units that have already been specifically placed on the map (such as individual mineral chunks or vespene geysers)
I'm really just trying to replicate the effect in wc3 where I display text over a unit's head when it drops off a resource at the town hall. I have the text all working properly, but my hotfix doesn't always pick the right unit to display it over
Found the solution!
With the help of another thread on this, and some playing around, I figured out what to do for anyone who wants to replicate this effect.
Events
Unit - Any Unit uses Probe - Return Cargo at Harvest7 - Drop Off stage (Ignore shared abilities)
Conditions
Resource Count[(Triggering player)][Minerals] < (Player (Triggering player) Minerals)
Actions
Variable - Modify Resource Count[(Triggering player)][Minerals]: + 5
etc etc.
You use a global array that you update whenever a specific resource for a specific player is collected in that player's hash for that resource.
You use that to check which resource has been most recently dropped off. The Unit event will give you Triggering Unit which gives you the unit who dropped the resource off.