Scripts / Load DLL from c++ ( own progamm ) with LUA and game guru

Author
Message
Event Horizon
5
Years of Service
User Offline
Joined: 9th Nov 2018
Location:
Posted: 9th Nov 2018 13:17
I have searching in this forum for information about telling an Dll in a LUA script ( lua need required) but i have not find any treadth that deal with it. So the question is : game guru script are really standar compliant LUA ? , and if i can use required dll with my own LUA script. I don't have game guru so , before buy it i want to be 100% sure that he can do this. Basicaly, you need a dll with a custom fonction in c++ ( for exemple, void randomiseObjectsInLevel { .... }. compile the fonction in the dll , for exemple "myDll.dll"
and, in game guru make like
. Thanks for joining the discution. We know that c++ is fast for computing informations , it will be a really advantage for this soft i think.
regards
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 9th Nov 2018 15:15
Judging by a quick experiment 'loadlib' is not recognised as a Lua command by GG, in fact notepad++ doesn't even recognise it as a command!

Aha, this is a Lua 5.0 command, we are on 5.2 and this has been moved to the package library, so package.loadlib() is recognised.

Although I'm having a hard time seeing what you would use this for, a library written in C++ may execute slightly faster than a raw Lua function but not enough to make the extra complexity worthwhile.

If there were a C++ API for GG giving dynamic access to internal data structures then it might be more useful, but there isn't, all acees would have to go via Lua so you would have the added overhead of conversion of data to/from Lua in your library which you wouldn't have if you simply write the equivelent functions in Lua directly, i.e. simply write Lua libraries and load them in at runtime.

Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-05-24 21:39:58
Your offset time is: 2024-05-24 21:39:58