| 01-04-2006, 02:18 AM | #1 |
What i want to try and do is have quite a few units on a map that spawn items at for them then what i want to happen is that when a Peon class (current order Move equal to false)units comes within range of 10000 of the unit with the item thats within range the peon walks over to the unit with the item and then the unit with the item gives him the item and then the peon goes back to the townhall and sell the item |
| 01-04-2006, 02:51 AM | #2 |
Good use of punctuation.... now, sarcasm aside, you'll want to use one of the Unit - Issue order to unit targetting a <something> |
| 01-05-2006, 02:02 PM | #3 |
JASS:native IssueInstantTargetOrder takes unit whichUnit, string order, widget targetWidget, widget instantTargetWidget returns boolean native IssueInstantTargetOrderById takes unit whichUnit, integer order, widget targetWidget, widget instantTargetWidget returns boolean Will order whichUnit to hand the instantTargetWidget (item) over to the targetWidget (unit). The order string would be "move" or "smart" i suppose. |
| 01-05-2006, 02:22 PM | #4 |
What about this? No orderstrings/ids that you need to look for: JASS:native UnitDropItemTarget takes unit whichUnit, item whichItem, widget target returns boolean |
| 01-07-2006, 11:56 PM | #5 |
Code:
EVENTS every X seconds of the game CONDITIONS ACTIONS pick every unit in playable map area matching conditions <matching unit is a worker is equal to true> and <matching unit is idle>(?) set variable <temp item unit> = random unit from unit group "item generators" order picked unit to move to position of <temp item unit> unit group - remove <temp item unit> from "item generators" then you just need another code so that everytime an item is made for the item generator units, the unit is added to unit group "item generators" and a then Code:
EVENTS unit comes within XXX of unit CONDITIONS triggering unit is a worker is equal to true other unit(?) has an item of type <item> is equal to true ACTIONS order other unit(?) to give item of type <item> to triggering unit there are only two possible problems with what i've said (hopefully), first, if there isn't an "is idle" boolean you'll have to find another way of doing that. also i don't know if theres an identifier for "other unit" in the second code. Hope this helps |
