Page 1 of 1

Lua

Posted: Mon Aug 26, 2019 7:13 am
by gabberworld
can you enable the package.loadlib in lua
soo i can use other stuff like mysql

Re: Lua

Posted: Mon Aug 26, 2019 7:53 am
by Bilka
No, modding is sandboxed for a reason.

Re: Lua

Posted: Mon Aug 26, 2019 8:16 am
by gabberworld
is there any info what this game not actually support what lua self supports??

soo i would not faste my time at lua manual

Re: Lua

Posted: Mon Aug 26, 2019 9:24 am
by Bilka

Re: Lua

Posted: Tue Aug 27, 2019 1:57 am
by slippycheeze
gabberworld wrote:
Mon Aug 26, 2019 8:16 am
is there any info what this game not actually support what lua self supports??
soo i would not faste my time at lua manual
I saw your comment elsewhere, gabberworld, that you already gave up on modding Factorio. So, this is more for any audience that happens along here:

Factorio runs Lua 5.2, with modifications exactly as described in the API documentation. Which, frankly, are entirely trivial and in no way change anything in the core language. The mistake is to think that the Lua language, as opposed to Lua the extended environment available through the stand-alone interpreter, is what matters here.

So, for anyone else along, Lua in Factorio is like Lua in most games. An embedded language, with limited and controlled facilities for interaction, used exclusively to make some interaction with the internals possible. In times long past it would have been a custom scripting language, and things like the Unreal Engine still have their own exciting layers of custom languages, but Lua is ... designed for the purpose.

So, in terms of the manual: when it describes the language, (almos) all of it will be available. When it describes the extended ecosystem, such as loading external code in an uncontrolled fashion, or interacting with C language extensions, it is not applicable to the embedded language case. Which, of course, mirrors exactly how it is used in other games - WoW and clones, etc, which long since followed the same path.

Re: Lua

Posted: Wed Aug 28, 2019 6:06 am
by gabberworld
i understand , i'm not that noob actually about stuff like Delphi, c++, lua, c#.

that link explained for me already what Bilka posted ,why i can't use loadlib

even if they enable that, i can't use that like i was planned and i only get the either a crash or error

Re: Lua

Posted: Wed Aug 28, 2019 7:00 pm
by slippycheeze
gabberworld wrote:
Wed Aug 28, 2019 6:06 am
i understand , i'm not that noob actually about stuff like Delphi, c++, lua, c#.
Sorry, didn't mean to suggest you were ignorant or anything. I guess I failed at that goal, though.

Not knowing how Lua the "embedded language for game modding" works is entirely reasonable and, well, everyone starts there some time. I figured I'd explain the difference for the next person who came along so they didn't hit the same issue. A jump-start if you will, on the parts that are specific to Lua in games, rather than Lua in general.

That is: make it easier for the next person to learn what you now know. :)