Birdman Posted May 30, 2011 Posted May 30, 2011 Is there a way to create a variable or property in a class in LUA and access it from C++? For an instance there switch.lua have a Reset time property created in the Property Dialog, and then in the main function you have a resettime variable. How would i access this property/variable from c++? Thanks a lot in advance. Quote
Rick Posted May 30, 2011 Posted May 30, 2011 If you store it as an entity key, you should be able to use GetEntityKey from C++ after you load the map and find the entity. Quote
Birdman Posted May 31, 2011 Author Posted May 31, 2011 If you store it as an entity key.. How do you store an Entity Key in lua? Quote
Canardia Posted May 31, 2011 Posted May 31, 2011 The engine commands are the same in all languages, either procedural or OOP. SetEntityKey(entity,"key","value") or Entity::SetKey("key","value") Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■
Birdman Posted May 31, 2011 Author Posted May 31, 2011 Thanks for the responses guys, i got it working. I just checked there was a sample in the viper vehicle lua. object.model:SetKey("collisiontype",COLLISION_PROP) object.model:SetKey("mass",1.0) C++ Code: GetEntityKey(model,"mass"); Quote
Recommended Posts
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.