Hi everyone,
I’m currently writing a game in c++, so i would like to add option for external mods which would basically extend the data model of the game with new items. Although i’m unable to figure it out how to just have lua tables that hold that and could be loaded into c++, parsed and populate in game objects. Of course core game data would be written in lua also.
for example i imagined lua script to be something like this which doesn’t have any logic just the plain data
data =
{
name = entity_name,
type = entity_type,
properties = {
property1 = 1,
}
}
Essentially most of the lua scripts will just be tables that contain data about the game, and game logic will be written in c++. I would add later option to extend the entities by providing your own logic.
I went through the source code of lua scripts, but couldnt figure out how to load lua table into c++ and read the data from it. Does urho supports something like that at all? since most of the examples are instantiating objects which are defined in lua and attaching them as a components ?