You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add c++ code to save the bits to disk as monster.dat
load up embedded lua instance
run lua script using embedded lua engine sample_binary.lua with extra code to load the save file from above
local f = io.open('monster.dat', 'rb')
local buf = f:read('*a')
f:close()
local mon = monster.GetRootAsMonster(buf, 0)
print(mon.name)
Lua returns this error:
Error: ./lua/flatbuffers\binaryarray.lua:119: bad argument #2 to 'sunpack' (data string too short)
Note: Running sample_binary.lua from embedded engine is fine, it seems to be something related to saving the file.
regards,drew
The text was updated successfully, but these errors were encountered:
While trying to to use embedded lua between C++ and Lua.
issue:
local f = io.open('monster.dat', 'rb')
local buf = f:read('*a')
f:close()
local mon = monster.GetRootAsMonster(buf, 0)
print(mon.name)
Lua returns this error:
Error: ./lua/flatbuffers\binaryarray.lua:119: bad argument #2 to 'sunpack' (data string too short)
Note: Running sample_binary.lua from embedded engine is fine, it seems to be something related to saving the file.
regards,drew
The text was updated successfully, but these errors were encountered: