Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6103757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:45:54+00:00 2026-05-23T13:45:54+00:00

I googled a lot now, but all I find are Hello World examples for

  • 0

I googled a lot now, but all I find are “Hello World” examples for Lua with C++.

Situation: Game, big game. Has an in-game console, currently hard-coded in C++ (object-oriented and all), has a lot of if-else-if-else… blocks to check for the commands that the user entered in the console. Each command can change members of other classes of the game (like the command “speed 5” changes the variable double speed in class Car by calling Car::setSpeed(5)) and also gives an output back to the console about the result. There are also commands that do more “behind the scenes” than only changing a variable, this should also be done by Lua and only the final result passed back to the C++ code (console output + changed variables in the correct class).

Where/how/with what should I start to convert the code behind this console command functions to Lua? Like this: User enters “speed 5” in the console, then Lua calls Car::setSpeed(5) and then Lua reports back to the C++ console.
Instead of hard-coding the code behind the commands they should be written in Lua, but the whole rest of the game should stay in C++ (like my classes and there members and the console framework).

Any good tutorials? Any hints where to start? Some experiences to share?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:45:55+00:00Added an answer on May 23, 2026 at 1:45 pm

    Get a copy of Programming in Lua if you haven’t already. The section describing interop with C (and hence C++) is almost 100 pages, and much more than a ‘hello world’.

    There’s no specific C++ binding information in the book, but if your C++ compiler has any RTTI capabilities,that can be helpful. That’s how we integrate lua with C++Builder

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've googled a lot but it seems to be rather difficult to find complete
I have Googled a lot and found a lot of solutions, but none of
I've have gone through stackoverflow for days and googled a lot but can still
I have googled an serached a lot here about background runnin aps but have
Hy there I searched a lot on google, but couldn't find an answer. Maybe
Hello I'm stuck on this past few days with searching a lot, now I'm
Now there's quite a lot of similar-looking questions here, but I was wondering, what
I have googled a lot on this and i have found integrations of Linkedin
I know that there are a few similar questions and I googled a lot
I am struggling with linking ALAssetsLibrary in my code. I have googled a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.