Code: Select all
function gadget:GetInfo()
return {
name = "Point Placeer",
desc = "test for placement",
author = "Smoth",
date = "7/25/2015",
license = "PD",
layer = 0,
enabled = true
}
end
local pointSpacing = 128
local function LocationMarker(markerX, markerZ)
if markerX >= 0 and markerZ >= 0 then
local markerY = Spring.GetGroundHeight(markerX, markerZ)
local markerString = "( ".. markerX .. " , " .. markerZ .. " )"
Spring.MarkerAddPoint(markerX,0,markerZ, markerString, false)
Spring.Echo("adding point at: ", markerX,markerY,markerZ)
else
Spring.Echo(markerX, markerZ)
end
end
local function markerLines(distance, multiplier)
local spacing = 1 -- start 1x multiplier away from edge
while (spacing * multiplier) < distance do
LocationMarker(distance, spacing * multiplier)
LocationMarker(spacing * multiplier, distance)
spacing = spacing + 1
end
LocationMarker(distance, distance)
end
if (gadgetHandler:IsSyncedCode()) then
function gadget:Initialize()
local counter = 1
while counter < 100 do
markerLines(counter * pointSpacing, pointSpacing)
counter = counter + 1
end
end
end