How do you create a GUID in a Lua script? using LuaPlus if that helps

I am currently working on a project with LuaPlus, and I need to be able to use GUIDs but cannot find them in Lua. When I build the data for lua, there is no setGUID, there is a given number, a given string, etc. There is also a Set () function. Does anyone know the correct way to pass GUIDs from C ++ to lua and lua to C ++. Thank you very much.

Update:

Thank you all for your answers. I appreciate the quick answers. Usually I do not often look at the tables of actors, mainly only at the front end, when we load everything. Nevertheless, I probably worry too much, because the game is not numerous, and there will not be a large number of actors in any case. I was thinking of writing an optimized string comparison in lua, where you check the first char GUID against a test member. If it passes, go to the second and that one. If this fails, continue to the next actor. I hope that by making an optimized comparison like this, I will not worry about any speed issues, at least for the game I'm working on. Does this sound like a good idea compared to a normal string comparison?

+4
source share
1 answer

GUID - only 16 bytes. For example, you can pass this 16 characters. Why do you need a GUID in lua?

+2
source

Source: https://habr.com/ru/post/1336415/


All Articles