Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedding Lua with Flatbuffers #5085

Closed
drewqb opened this issue Dec 7, 2018 · 3 comments
Closed

Embedding Lua with Flatbuffers #5085

drewqb opened this issue Dec 7, 2018 · 3 comments

Comments

@drewqb
Copy link

drewqb commented Dec 7, 2018

While trying to to use embedded lua between C++ and Lua.

issue:

  • lua 5.3.5 , flatbuffers 1.10 windows, visualstudio 2013
  • use the monster sample in C++
  • 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

@aardappel
Copy link
Collaborator

@dbaileychess any idea?

@drewqb
Copy link
Author

drewqb commented Dec 10, 2018

You can close out issue it was pilot error on my part, my lua code was wrong it is working perfectly.

@aardappel
Copy link
Collaborator

You can close it too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants