Loading...
  OR  Zero-K Name:    Password:   
Title: [A] Pro 1v1 Host
Host: Nobody
Game version: Zero-K v1.9.4.3
Engine version: 104.0.1-1544-ge1f249f
Battle ID: 1110785
Started: 2 years ago
Duration: 5 minutes
Players: 2
Bots: False
Mission: False
Rating: Competitive
Watch Replay Now
Manual download

Team 1
Chance of victory: 51.1%

BErankMSPR
Team 2
Chance of victory: 48.9%

USrankDave[tB]

Show winners



Preview
Filter:    Player:  
sort


2 years ago
Nasty rover cons just sitting in the factory and repairing, reclaiming and assisting construction!
+2 / -0
For some reason unitnostuckinfactory.lua does not help in the case of an attack move order.

This annoyed me enough I wrote a local widget. If a mobile builder is given an attack move order, this will insert a move order before. Here is the meat of it:
function widget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders)
---Order unit to move away from factory's build yard---
if ( UnitDefs[unitDefID].isMobileBuilder ) then
local cmdID, , , cmdX, cmdY, cmdZ = Spring.GetUnitCurrentCommand(factID)
-- Fight command is cmdID 16
if ( cmdID == 16 ) then
local dx,_,dz = Spring.GetUnitDirection(unitID)
local x,y,z = Spring.GetUnitPosition(unitID)
dx = dx*100 --Note: don't need trigonometry here because factory direction is either {0+-,1+-} or {1+-,0+-} (1 or 0), so multiply both with 100 elmo is enough
dz = dz*100
Spring.GiveOrderArrayToUnitArray( {unitID},{
{CMD.INSERT, {0, CMD_RAW_MOVE, CMD.OPT_INTERNAL, x+dx, y, z+dz}, CMD.OPT_ALT},
{CMD.INSERT, {1, cmdID, CMD.OPT_INTERNAL, cmdX, cmdY, cmdZ}, CMD.OPT_ALT},
})--insert move command before current fight command
end
end
end
+1 / -0