GE Lua Documentation

Press F to search!

scenetree_test_fields

Definition


-- @/lua/ge/ge_utils.lua:134

function scenetree_test_fields()
  print('testing fields of "thePlayer": ' .. tostring(scenetree.thePlayer))
  local player = scenetree.thePlayer
  local fields = player:getFields()
  for k, f in pairs(fields) do
    if k ~= 'dataBlock' and k ~= 'parentGroup' then -- why do we need to exclude these?
      local val = player[k]
      if val == nil then
        print(' N ' .. tostring(k) .. ' = NIL [' .. (f.type or 'unknown') .. ']')
      else
        print(' * ' .. tostring(k) .. ' = ' .. tostring(player[k]) .. ' [Types| Lua: ' .. type(val) .. ', C: ' .. (f.type or 'unknown') .. ']')
      end
    else
      print(' x UNSUPPORTED TYPE: ' .. tostring(k) .. ' [' .. (f.type or 'unknown') .. ']')

    end
  end
end

Callers