Page 1 of 1
How can I use C++ code in Lua?
Posted: Fri Dec 23, 2022 3:54 pm
by jime
Im tring to make a mod and I hope I can use my previous code.
Re: How can I use C++ code in Lua?
Posted: Fri Dec 23, 2022 4:27 pm
by Rseding91
Factorio mods only support writing them in Lua. So the answer is: you can't.
Re: How can I use C++ code in Lua?
Posted: Fri Dec 23, 2022 4:57 pm
by DarkShadow44
Even if you could, I don't see how it would be useful to recycle old code. You need to use a lot of factorio specific features. What exactly are you trying to do/reuse?
Re: How can I use C++ code in Lua?
Posted: Fri Dec 23, 2022 5:54 pm
by robot256
If you don't want to reinvent the wheel, take a look at some of the existing mod libraries, like
Factorio Library . You can use any of them as a dependency for your mod, and use the functions they maintain.