Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[Suggestion]LUA callbacks #20172
Comments
This comment has been minimized.
This comment has been minimized.
|
Is anyone even using the Lua bindings? As far as I can tell the whole Lua thing has been a massive waste of time. |
This comment has been minimized.
This comment has been minimized.
|
Stats Through Skills uses it. I recall one of the less popular mods also using it - Cataclysm++? I wanted to add a sci-fi mod which would use it (for psionic powers), but I'll refrain if you want to axe Lua - if it was just my mod, I could implement that in C++. |
This comment has been minimized.
This comment has been minimized.
|
That's what keeps happening, it would be way easier to just expose apis that let mods use json to adjust things than to continue supporting Lua, for the existing uses at least. I'd be perfectly happy to keep it around if it were actually needed, but AFAIK it's not being used for anything that's easier to do with Lua. I'll take a look at cataclysm++ and get an idea of what it's using it for. |
This comment has been minimized.
This comment has been minimized.
|
I would love to see LUA mapgen be used more since it can be used to create more randomized and alive feeling structures than JSON. |
This comment has been minimized.
This comment has been minimized.
|
How does a mod implement customized iuse functions and iexamine functions without lua bindings? |
This comment has been minimized.
This comment has been minimized.
|
@kevingranade & @Coolthulhu , The cataclysm++ mod does not use lua, its pure json files. |
This comment has been minimized.
This comment has been minimized.
|
Firn and I discussed using LUA to create a photography mod. |
This comment has been minimized.
This comment has been minimized.
|
Lua would probably be used more if it were better fleshed out. I've tried pushing the idea of moving bits of core logic to lua (iuse, special attacks, generally non performance critical pieces of logic) but that has been shut down every time I suggest it. By pushing more of our logic to lua, we find the holes in the api that would let us expand its functionality, which would make it easier for modder to create more sophisticated mods without needing to learn C++. |
This comment has been minimized.
This comment has been minimized.
|
Problem with Lua is that it isn't a hard dependency, meaning we can't move core game logic to it. |
This comment has been minimized.
This comment has been minimized.
|
And that is why we don't see more mods using it. If we want to see more mods using Lua, we need to mainline it, and move (some) core game logic to it. This would enable modders to create mods that core game functionality without needs to get into the source code. Mods that currently require the modder to release their own build of the game could then slowly be worked into lua mods. It would be easier for us to mainline mods that alter gameplay logic, since they wouldn't need to alter the source code to achieve the functionality they're looking for. |
This comment has been minimized.
This comment has been minimized.
|
@Marberguson Do you intend to implement a mod that does this? Most of the below is OT in relation to OP.
Lua is a programming language. The need to "get into the source code" would not disappear if a modder decided to use it.
Tend to agree on "current uses" part. However, the promise of Lua is providing non-implemented functionality. Some current non-critical parts could be off-loaded to Lua. Games that come with "handheld game system" seem a good example. Or controlling an RC car (with IED attached)?.. I've been thinking about something like this, but TBH there's always more important bugs. |
This comment has been minimized.
This comment has been minimized.
|
On-topic: tried slapping together an example, a naive Otherwise, the Lua mod would have to sift through all the character's bionics, EDIT: and match them to bionics handled by the mod. EDIT2: Passing a bionic would allow the mod to forego "What is it that changed?", but would still need checking "Am I responsible for this?" - demonstrating clearly the need to "get into the source code". EDIT3: To clarify, I don't intend to make a Lua-using bionics mod. This was just a "How hard can it be?". |
This comment has been minimized.
This comment has been minimized.
|
On Feb 2, 2017 11:45 AM, "Justin" <notifications@github.com> wrote:
Lua would probably be used more if it were better fleshed out.
Initial LUA support was added by commit
88dc3fd over THREE YEARS AGO. In that
three years the game has had massive extension in nearly all areas, but a
compelling use case for LUA support has yet to surface. Proponents have
continued to insist it will be massively useful, but NO ONE IS USING IT.
So for three years we've merged extensions to it, kept data bindings up to
date, and made our build process more difficult than it had to be because
LUAs packaging is insane, with literally nothing to show for it. Let me
repeat that, LITERALLY NOTHING. The proof of concept type code present in
e.g. faster zombies could be rewritten in c++ in minutes, or replaced with
a parameterized json mechanism with similar functionality in part of an
evening. Meanwhile we can drop thousands of lines of rather complex data
binding definition and code, trim some gnarly code out of the Makefile and
other project files, and drop a library dependency that has made building
on Windows in particular a pain in the ass.
After three years and thousands and thousands of lines of code, I'm calling
it, LUA support is a total failure, and I intend to remove it as soon as is
convinient. Please don't open any PRs or issues about LUA, because it's
dead.
I've tried pushing the idea of moving bits of core logic to lua (iuse,
special attacks, generally non performance critical pieces of logic) but
that has been shut down every time I suggest it.
LUA support has been provisional for its entire existence, doubling down by
embedding it further in the game with literally zero evidence that there is
real interest in using it has never been an option.
If someone had simply written a significant new feature in LUA at any point
in the past three years, we wouldn't be having this discussion, but no,
dispite ~5 core contributors being heavily invested enough in it to spend
significant time building infrastructure for it, none of them or anyone
else has shown any interest in developing actual features in the language
once their infrastructure was merged.
Frankly I now consider its provisional addition three years ago to have
been a mistake, YAGNI is in full force, speculatively adding infrastructure
that might be used some time later is never a good idea, build
infrastructure to support features you need, no more.
|
This comment has been minimized.
This comment has been minimized.
|
Made a thread: http://smf.cataclysmdda.com/index.php?topic=14231 Judging from what was said before, we're axing Lua after 0.D comes out, correct? |
This comment has been minimized.
This comment has been minimized.
|
What about Stats through Skills, doesn't that use Lua? It is on its fifth
or so iteration, isn't it? And Slow Zombies and Tough Zombies and Zombie
Nightvision use it too, I think.
|
This comment has been minimized.
This comment has been minimized.
|
Rewritting them as C++ would be less effort than keeping that Lua interface around. |
This comment has been minimized.
This comment has been minimized.
Good call, someone coming out of the woodwork stating, "I use LUA extensively in my huge mod you've never heard of" is pretty much the only thing that can save it now.
That's the plan, yes.
So much this. |
kevingranade
closed this
Apr 10, 2017
This comment has been minimized.
This comment has been minimized.
|
Played a bit with the LUA: http://smf.cataclysmdda.com/index.php?topic=14542.msg300320#msg300320 |
Marberguson commentedJan 31, 2017
•
edited
LUA callback when activating/deactivating bionics and mutations. This will enable to make more advanced bionics and mutations.