- Joined
- Nov 30, 2007
- Messages
- 1,202
Last edited:
I've done it in the past by having invisible dummy hero builders. They were accessible using the hero hotkeys/buttons, and were instantly moved to the target build location (using setunitx/y) when ordered to build.
You can use this to simulate an error message: http://www.wc3c.net/showthread.php?t=101260
Just call it as
- Custom script: call SimError (GetOwningPlayer(GetTriggerUnit()), "Construction location out of range.")
Two ideas:
- Loads of ubersplats along the circle. Downside is that it's visible to enemies, unless if that isn't an issue.
- Create a custom SFX. emitters along a circle, going up some height.
EDIT: Another simple solution to simply remove the health bar: if you look at neutral buildings, they don't have health bars. Take a look at their settings and copy that. I think you just need to add the Invulnerable (neutral) ability.
Can't you at least just grab the order from the building?
Have you tried using the item Ivory Tower ability as a base?
call IssueBuildOrderByIdLocBJ(udg_Builder[p_num], udg_BuildingType[i], Location(x2, y2))
function OrderConstructionMain takes nothing returns boolean
local trigger t = GetTriggeringTrigger()
local real x1 = GetLocationX(GetUnitLoc(GetTriggerUnit()))
local real y1 = GetLocationY(GetUnitLoc(GetTriggerUnit()))
local real x2 = GetLocationX(GetOrderPointLoc())
local real y2 = GetLocationY(GetOrderPointLoc())
local integer p_num = GetPlayerId(GetTriggerPlayer())
local unit u
local integer i = 0
loop
exitwhen udg_BuildingOrderID[i] == null
if (OrderId2StringBJ(GetIssuedOrderIdBJ()) == udg_BuildingOrderID[i]) then
call DisableTrigger(t)
if (DistanceBetweenPoints(Location(x1, y1), Location(x2, y2)) > udg_BuildRange) then
set u = CreateUnit(Player(12), 'n000', x2, y2, 0.0)
call UnitApplyTimedLifeBJ( 0.10, 'BTLF', u)
set u = null
endif
// Orders dummy to begin construction
call ShowUnitShow(udg_Builder[p_num])
call SetUnitPositionLoc(udg_Builder[p_num], Location(x2, y2))
call IssueBuildOrderByIdLocBJ(udg_Builder[p_num], udg_BuildingType[i], Location(x2, y2))
call EnableTrigger(t)
set t = null
endif
set i = i + 1
endloop
return false
endfunction
//===========================================================================
function InitTrig_Order_Construction takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition(t, Condition( function OrderConstructionMain ) )
set t = null
endfunction
function OrderConstructionMain takes nothing returns boolean
local real x1 = GetUnitX(GetTriggerUnit())
local real y1 = GetUnitY(GetTriggerUnit())
local real x2 = GetOrderPointX()
local real y2 = GetOrderPointY()
local real dx
local real dy
local integer p_num = GetPlayerId(GetTriggerPlayer())
local unit u
local integer i = 0
local integer order = GetIssuedOrderId()
loop
exitwhen udg_BuildingOrderID[i] == 0
if ( order == udg_BuildingOrderID[i] ) then
set dx = x2 - x1
set dy = y2 - y1
if (SquareRoot(dx*dx + dy*dy) > udg_BuildRange) then
set u = CreateUnit(Player(12), 'n000', x2, y2, 0)
call UnitApplyTimedLife(u, 'BTLF', 0.1)
endif
// Orders dummy to begin construction
call ShowUnit(udg_Builder[p_num], true)
call SetUnitPosition(udg_Builder[p_num], x2, y2)
call DisableTrigger(GetTriggeringTrigger())
call IssueBuildOrderById(udg_Builder[p_num], udg_BuildingType[i], x2, y2)
call EnableTrigger(GetTriggeringTrigger())
endif
set i = i + 1
endloop
set u = null
return false
endfunction
call IssueBuildOrderByIdLocBJ(udg_Builder[p_num], udg_BuildingType[i], Location(x2, y2))
should not cause any problems if used properly i.e not orderded outside playable-map bounds. exitwhen udg_BuildingOrderID[i] == 0
I completed the map now, should work for all players and cities now.
Only remaining issue is a bug with hiding the summoner. If you order to build a farm half on blight half on normal ground the summoner will try to build there and fail and not get hidden.
*Reposted link on OP
Then use a timer to check the current order of the unit.