Jump to content

lua to C++


Slimwaffle
 Share

Recommended Posts

Hey guys.

I just bought the professional version so that I can redo my game in c++. This was so I can add things in from the steam SDK. 

So I am wanting to know how it works? Can I run c++ alongside lua? Do I need to recode all my lua scripts? If so does this mean I have to create a new project that states it is a c++ project?

Link to comment
Share on other sites

Scripts can still be attached to objects.  There should be a visual studio project file in one of the folders of your project, under Project->Windows i think...?

Load that up, and you'll see in App.cpp the code that executes Main.lua.  You should just need to recode Main.lua into App.cpp and go from there.

Link to comment
Share on other sites

I found these commands;

Steamworks::Initialize();
Steamworks::InitializeController();
Steamworks::steamcontroller;

visual studio says that they are using lua.

Does that mean that using my lua scripts for main.lua and stuff. That I can reference the steam API using Steamworks:     ?

Link to comment
Share on other sites

I spent all day on this and from what I can gather. In order to use the steam api commands I need to rebuild as a c++ game. From what I can gather. I need to re-write main.lua into app.cpp and re-write menu.lua as menu.cpp. And then systematically change all my lua files to cpp files. I could be wrong though not entirely sure. 

I also noticed that when I click run in the editor it launches from lua files and I have to use visual studio for the cpp files to launch. How do I make it launch cpp files from editor? Also is there anything special I need to do when publishing as standalone to make it use the cpp files?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...