Jump to content

Calling C++ functions from LUA and LUA functions from C++


VeTaL
 Share

Recommended Posts

You should do only generic logic and behaviour in Lua, and game specific logic on the Lua entities in C++.

From C++ you can access any Lua entity using FindFirstEntityByKey("name","enemy_9") (see gamelib).

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

You should do only generic logic and behaviour in Lua, and game specific logic on the Lua entities in C++.

 

Only because that's the way LUA has been implemented in Leadwerks. But that's at odds with the way it is done in most of the gaming industry where scripting is very much used to control the AI and game logic! My aim is to expose all my C++ functionality to LUA so this can be scripted but accept I need to implement that myself.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

  • 3 weeks later...

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...