HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Transfer a build order

02-10-2008, 01:39 AM#1
ShadowDestroyer
Here is the issue:

I have an immobile unit with the ability to build structures. However, when it gives a build command, I want a builder to spawn at that location and begin building the building. How would I go about doing this?
02-10-2008, 01:49 AM#2
TaintedReality
?? You've basically said how to do it in your post.

Quote:
I want a builder to spawn at that location and begin building the building.

So, create a builder at that location and order him to build the building (the order id will be the same as the one issued to the immobile unit), then order the immobile unit to stop.
02-10-2008, 07:34 AM#3
ShadowDestroyer
Yes, but not exactly. How do I detect when a build order is given, but hasn't actually started constructing? How do I detect which building this is?
02-10-2008, 01:31 PM#4
Themerion
I don't know how much you know about rawcodes and JASS, but well, here goes:

Trigger:
Untitled Trigger 001
Collapse Events
Unit - Peasant 0000 <gen> Is issued an order targeting a point
Conditions
Collapse Actions
Custom script: if GetIssuedOrderId()=='hhou' then
Set stopunit = (Ordered unit)
Countdown Timer - Start Stoptimer as a One-shot timer that will expire in 0.00 seconds
Wait 0.00 seconds
Unit - Create 1 Peasant for Player 1 (Red) at (Target point of issued order) facing Default building facing degrees
Custom script: call IssuePointOrderByIdLoc(GetLastCreatedUnit(),'hhou',GetOrderPointLoc())
Custom script: endif

Trigger:
Stop
Collapse Events
Time - Stoptimer expires
Conditions
Collapse Actions
Unit - Order stopunit to Stop

'hhou' is the rawcode for the unit being built (in this case, I tested with farm). Press Ctrl+D in the Object Editor to view a rawcode.

This code is leaking a location, so you might want to clean that up.
02-10-2008, 03:04 PM#5
ShadowDestroyer
Thanks! I think that is what I needed. I will let you know if it works! +rep