HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Order queue

02-06-2006, 06:50 AM#1
Panto
Greetings.

While playing a game of Warcraft 3, a player is capable of queuing multiple orders for any unit by holding shift.

Can you queue orders by trigger?
02-06-2006, 08:06 AM#2
Anitarf
Not as far as I know...
02-14-2006, 09:10 AM#3
Moss
Best you can do is
Trigger:
Wait until ((Current order of (Triggering unit)) Not equal to (Order(move))), checking every 1.00 seconds
where move is whatever the order is that you last gave the unit by trigger.
02-14-2006, 09:47 AM#4
qwertyui
This is the basic step in what can later become the brand new "Panto's Ordering Queue System" ;)

No seriously. I mean, you can use attached variables to attach, say, a string to a unit. Make that string contain all orders, given to the unit. And then make a function which consecutively executes orders in this string until the string becomes empty. Make sure this funciton allows every order to complete, and you're good to go.

Of course, the devil is in the details, but from where i sit i can see that this is possible.

Hmmm
Checklist of things to do:

1) Use attached variables.
2) Attach a string to unit you want to queue orders with.
3) Record order queue in that string (orders, with coordinates and H2S of target handles if necessary).
<Hard Part>
4) Make a function which retrieves and executes orders one after each other, making sure each order is completed before it moves on.
</Hard Part>
02-14-2006, 10:36 AM#5
Ant
If there was a simple way, panto would probably know t.t

A way I use to queue move orders is to use items. I use an item as a waypoint and order the unit to pick up item to item. Of course, this is very limited since the unit needs item slots and range of picking up items has to be altered.

I imagine though, that different item types could be used to represent different orders. Attack wouldn't be too hard, simply store the units in an array and attack the next one when the current one is dead.

As far as I know, every order needs a new system, can't think of any general way. Triggering in general for all spells would be difficult.
02-17-2006, 06:04 AM#6
Moss
True, every situation will probably be different, but the conditional wait I mentioned will probably be usefull in most circumstances. If a unit is told to do something then that will be their order until the action is complete (the unit they are attacking is dead, they have reached the point they are supposed to move to, they have harvested all the resources from a mine or forest) then their order becomes blank. If the user, or other triggers can interupt the unit then of course you will have to have other scripting to deal with those contingencies.

If you want to keep a unit on track you can put it in a unit group or attach a variable and have a periodic trigger to continually tell them to do what they are supposed to be doing and check if they are done, and if so, move them to a diff unit group or change the attached variable and then have them repeatedly do do the next action.