Lua
From
apam@21:1/126 to
ALL on Friday, August 07, 2020 22:05:44
Hello
Today was an adventure, I wanted to add scripting to Titan, which is in
C++ not C like magicka.. originally I thought I'd try something
different, and had a look at ChaiScript, but after getting that working I realized the author wasn't working on it any more...
Then I thought about using javascript, was thinking about using v8, but
in the end went back to Lua.
Lua was a bit difficult for me to get working. In magicka, each node is a different process, so has it's own variables, so when lua calls back
there is only one node to see.
Titan on the otherhand uses threads, so shared variables, and I had to
figure out how to pass a node class to lua so that i could access that
class in the C function that got called back.
Took a few tries, but figured it out in the end.
All this for a oneliners script :P
Andrew
--- TitanFTN (Linux/x86_64)
* Origin: Wunderlust BBS - wunderlust.ddns.net:2023 (21:1/126)