| 10-05-2009, 04:43 PM | #1 |
Hi. Is there a way to 1) detect when a worker drops off gold/lumber at a town hall and 2) when a wisp latches itself to a tree to begin harvesting lumber? For 2), I want to change the Wisp's lumber harvest anim to work anim. Changing the basic animations in the spell itself doesn't work, so I'm guessing triggers would. |
| 10-05-2009, 04:53 PM | #2 |
probably by orderids. there was a handy debug script someone here posted that displayed the relevant debug orders.I may post a simpler (or not) script for it. |
| 10-06-2009, 08:16 AM | #3 |
Well there's no order id to deposit gold or latching to a tree :( Unless I'm doing it wrong that is: JASS:call BJDebugMsg("OrderId is: "+I2S(GetIssuedOrderId())) |
| 10-06-2009, 11:00 AM | #4 |
workers are issued harvest orders whenever they drop their resources. they are also issued orders to return their resources when they reach their carrying capacities as they harvest. |
| 10-06-2009, 03:48 PM | #5 | |
Quote:
In fact unless you trigger all the thing you can't know when an unit drop a resource. |
| 10-07-2009, 03:57 AM | #6 |
i did forget about queuing. |
| 10-07-2009, 05:57 AM | #7 |
Well currently I am using the harvest order to kill specific workers whenever they deposite gold, but the problem is, what happens when the gold mine is destroyed when it gets depleted? There will be no harvest orders for the last workers that are spawned then. |
| 10-07-2009, 10:12 AM | #8 | |
Quote:
check if they enter a specific area around the drop point and kill them when they enter (needs own harvest trigger to work properly) |
| 10-07-2009, 10:29 AM | #9 |
I cant exactly use regions... unless you're suggesting a 'pick every unit in range' type of trigger that executes every X seconds??? |
| 10-07-2009, 10:40 AM | #10 | ||
Quote:
Quote:
|
| 10-07-2009, 01:48 PM | #11 |
Interesting... Well, I guess that's what I'll go for then. |
| 10-07-2009, 02:04 PM | #12 |
Pick every unit isn't a well idea, however, I suggest creating a trigger, add the Event: A unit comes into range of UNIT for all your halls, and then check whether unit has resources or not. |
| 10-07-2009, 04:53 PM | #13 |
You can detect if a unit has resources? |
| 10-07-2009, 04:53 PM | #14 | |
Quote:
Again if you don't trigger all the thing you can't really know if an unit has some resources and how much. |
| 10-07-2009, 05:15 PM | #15 |
make your own harvest trigger, storing the amount of ressources in the unit's userdata (gold and lumber, like RGB/(HTML color) values) |
