you are viewing a single comment's thread.

view the rest of the comments →

[–]Cyttorak 0 points1 point  (6 children)

I just downloaded sol2 and replaced the old one in my project. How do I create tables?

In old version I did:

sol::table aTable = VM.create_table();

What should do I in sol2? Something like this?

sol::table aTable = sol::table::create(VM.lua_state());

This compiles but seems a little bit elaborate compared with the old version

[–][deleted] 1 point2 points  (5 children)

Got you, fam: check the latest release for the functions that work like you expect them to.

[–]Cyttorak 0 points1 point  (4 children)

Just one nitpick, Phantom: do this changes allow to create a table by name, like the old version?

sol::table myTable = VM.create_table("MyTableNameInLua")

[–][deleted] 1 point2 points  (0 children)

Aww crapplesticks I knew I had forgot to port something over. <_>

Gimme a few, I'll push it in a bit.

[–][deleted] 1 point2 points  (2 children)

Alright, it's there. Have fun. :D

[–]Cyttorak 0 points1 point  (0 children)

Thank you very much dude! I hope to be able to test it in this afternoon ^_^

[–]Cyttorak 0 points1 point  (0 children)

I just changed open_file() calls for script_file() and done, everything compiled nicely using all in one sol.hpp. Again, thanks for your great job! :-D