Here's the code:
Code: Select all
local Empty = Spring.GetUnitsInSphere(X, 0, Z, 200)
if Empty[1] == nil then Do Stuff end
Moderator: Moderators
Code: Select all
local Empty = Spring.GetUnitsInSphere(X, 0, Z, 200)
if Empty[1] == nil then Do Stuff end
This...Wiki wrote: Spring.GetUnitsInSphere
( number x, number y, number z, number radius [,number teamID] )
-> nil | unitTable = { [1] = number unitID, etc... }
Code: Select all
if Empty[1] == nil
Code: Select all
Empty = Spring.GetUnitsInRectangle(MinX,MinZ,MaxX,MaxZ)
Empty2 = Empty[1]
if Empty ~= nil then
if Empty2 ~= nil then CanPlace = 0 end
if Empty2 == nil then CanPlace = 1 end
end
Code: Select all
local ok, f = Spring.TestBuildOrder(-cmd, c.x, c.y, c.z, c.heading)
if ok == 2 and not f then
Code: Select all
Spring.TestBuildOrder
( number unitDefID, number x, number y, number z, number facing)
-> number blocking [,number featureID]
blocking can be:
0 - blocked
1 - mobile unit in the way
2 - free (or if featureID is != 0 then with a blocking feature that can be reclaimed)
Meh, if you're just looking for a callout the Wiki has a nice list that's often sufficient.FLOZi wrote:As much as I often disagree with Argh's methods, 9 times out of 10 asking someone in the know is far more productive than looking thorugh the wiki (Very unfortunately)