Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion]LUA callbacks #20172

Closed
Marberguson opened this issue Jan 31, 2017 · 19 comments

Comments

Projects
None yet
@Marberguson
Copy link

commented Jan 31, 2017

LUA callback when activating/deactivating bionics and mutations. This will enable to make more advanced bionics and mutations.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jan 31, 2017

Is anyone even using the Lua bindings? As far as I can tell the whole Lua thing has been a massive waste of time.

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2017

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++.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jan 31, 2017

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.

@vache

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2017

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.

@BrettDong

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2017

How does a mod implement customized iuse functions and iexamine functions without lua bindings?

@Noctifer-de-Mortem

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2017

@kevingranade & @Coolthulhu , The cataclysm++ mod does not use lua, its pure json files.

@BorkBorkGoesTheCode

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2017

Firn and I discussed using LUA to create a photography mod.

@macrosblackd

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2017

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++.

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2017

Problem with Lua is that it isn't a hard dependency, meaning we can't move core game logic to it.

@macrosblackd

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2017

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.

@keyspace

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2017

@Marberguson Do you intend to implement a mod that does this?


Most of the below is OT in relation to OP.

@macrosblackd:

This would enable modders to create mods that core game functionality without needs to get into the source code.

Lua is a programming language. The need to "get into the source code" would not disappear if a modder decided to use it.

@kevingranade:

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.

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.

@keyspace

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2017

On-topic: tried slapping together an example, a naive lua_callback() seems insufficient - need to pass the bionic to Lua, and possibly not just the name.

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?".

@kevingranade

This comment has been minimized.

Copy link
Member

commented Feb 3, 2017

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2017

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?

@Chezzo

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2017

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2017

Rewritting them as C++ would be less effort than keeping that Lua interface around.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 4, 2017

Made a thread: http://smf.cataclysmdda.com/index.php?topic=14231

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.

Judging from what was said before, we're axing Lua after 0.D comes out, correct?

That's the plan, yes.

Rewritting them as C++ would be less effort than keeping that Lua interface around.

So much this.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented May 31, 2017

This was referenced Aug 29, 2017

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2017

Linking to #21743 and #21744.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.