Solarwake

eine dual universe organisation

Hover Höhe eures Schiffes verändern


Nav.axisCommandManager:updateTargetGroundAltitudeFromActionLoop(30.0)
              


Die Fallgeschwindigkeit anzeigen


-- unit.start() methode: 
unit.setTimer("display", 1)

-- In die tick(display) Methode:
function round(num, numDecimalPlaces)
     local mult = 10^(numDecimalPlaces or 0)
    return math.floor(num * mult + 0.5) / mult
end
if height == nil then
    height = 0
end
downspeed = (core.getAltitude() - height) * 3600 / 1000
height = core.getAltitude()
text = "<h1>" .. round(downspeed, 0) .. " km/h</h1>"
system.showScreen(1)
system.setScreen(text)
              


Zeigt beschädigte Elemente eures Schiffes mit ihren Hitpoints an


function round(num, numDecimalPlaces)
    local mult = 10^(numDecimalPlaces or 0)
    return math.floor(num * mult + 0.5) / mult
end

html = "<h1>Damaged elements: <br />"
for e in pairs(core.getElementIdList()) do
  if (core.getElementMaxHitPointsById(e) > core.getElementHitPointsById(e)) then    
        html = html .. core.getElementNameById(e) .. 
        " (" ..
        round(core.getElementHitPointsById(e), 0) ..
        "/" ..
        round(core.getElementMaxHitPointsById(e), 0) ..
        ")<br/>"
  end
end
html = html .. "</h1>"
screen.setHTML(html)