Problem Invisible Hud

johnnymanly

Donator
Donator
Joined
Mar 17, 2008
Messages
179
Reaction score
116
Points
43
Location
Southwest Pennsylginia
Website
sites.google.com
I'm starting a VC in a new project but I can't get the Hud to render. MFDs are fine but the HUD is blank.
Code:
function clbk_loadVC(id)

  local mfds_left = {nmesh=1, ngroup=4}
  local mfds_right = {nmesh=1, ngroup=5}
  local hud_pilot = {nmesh=1,ngroup=6,hudcnt={x=-0.894,y=2.277,z=81.111},size=0.65}

  oapi.VC_registermfd (MFDID.LEFT, mfds_left)
  oapi.VC_registermfd (MFDID.RIGHT, mfds_right)
  oapi.VC_registerHUD (hud_pilot)

  vi:set_cameraoffset({x=-0.899,y=2.1,z=80.441})
  vi:set_cameradefaultdirection({x=0,y=0,z=1})
  return true

end
I made a DLL version using the same meshes and everything was fine.
This is on 2024-rc1.
 
I'm starting a VC in a new project but I can't get the Hud to render. MFDs are fine but the HUD is blank.
Code:
function clbk_loadVC(id)

  local mfds_left = {nmesh=1, ngroup=4}
  local mfds_right = {nmesh=1, ngroup=5}
  local hud_pilot = {nmesh=1,ngroup=6,hudcnt={x=-0.894,y=2.277,z=81.111},size=0.65}

  oapi.VC_registermfd (MFDID.LEFT, mfds_left)
  oapi.VC_registermfd (MFDID.RIGHT, mfds_right)
  oapi.VC_registerHUD (hud_pilot)

  vi:set_cameraoffset({x=-0.899,y=2.1,z=80.441})
  vi:set_cameradefaultdirection({x=0,y=0,z=1})
  return true

end
I made a DLL version using the same meshes and everything was fine.
This is on 2024-rc1.
Could be a bug with the Lua vessel. Do you define a clbk_drawHUD function? If not, can you try to (just a function returning true should be enough) and tell me if that changes things?
 
Borrowed this from Atlantis.lua. Still the same result.
Code:
function clbkDrawHUD(mode, hps, skp)

local cx = hps.CX
    local cy = hps.CY

    -- show OMS thrust marker
    if status >= 0 then
        local omsy = cy + math.floor(15.0 * hps.Scale)
        local dx = math.floor(1.0 * hps.Scale)
        skp:line(cx - 2 * dx, omsy, cx + 2 * dx, omsy)
        skp:line(cx, omsy - dx, cx, omsy + dx)
    end
    return true

end
 
Last edited:
Just to be sure, did you rename it to clbk_drawHUD?
Edit: could reproduce with the Lua Atlantis vessel, the HUD is blank when clbk_drawHUD is not defined.
I pushed a fix for the next RC, thanks for the report.
 
Last edited:
Just to be sure, did you rename it to clbk_drawHUD?
Edit: could reproduce with the Lua Atlantis vessel, the HUD is blank when clbk_drawHUD is not defined.
I pushed a fix for the next RC, thanks for the report.
Sorry, I forgot to rename that.
I'm glad you got it taken care of though.
Thanks again for your help. (y)
 
Back
Top