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

Lua #2043

Draft
wants to merge 84 commits into
base: master
Choose a base branch
from
Draft

Lua #2043

wants to merge 84 commits into from

Conversation

PieterVdc
Copy link
Member

@PieterVdc PieterVdc commented Dec 12, 2022

not final yet, but works, will probably use code as a dependency instead, but for now it uses a precompiled dll

@AleWin32
Copy link
Contributor

Hello @PieterVdc, what is this PR? It adds Lua scripting to KeeperFX instead of its own scripting language?

@PieterVdc
Copy link
Member Author

not as a replacement, but yeah as a second level script, still in early stage, but on the discord I uploaded a sample map that uses it
https://discord.com/channels/480505152806191114/1051878771692675082

@SimLV
Copy link
Contributor

SimLV commented Dec 28, 2022

Why you have to bring lua.h and others? I assume only luaconf.h is necessary and other files should be attached using git submodule or something like that.
Also API should be invented first. Raw ThingId is not userfriendly. Some userdata (not lightuserdata!) with list of thing-ids would be much better.

@PieterVdc
Copy link
Member Author

PieterVdc commented Dec 28, 2022

indeed, but I started with just a quick draft test to get a quick idea of what would be needed, before doing it proper
and yeah started with the dll, but was going to replace it with luau, as a submodule, so will delete the stuff in lib after I switched

lua/native.lua Outdated
@@ -689,17 +699,13 @@ function MOVE_CREATURE() end
---@param texture string The name or number of the texture to use for the player, like 'STONE_FACE'. Accepts 'None' or '-1'.
function SET_TEXTURE(player,texture) end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not PLAYER0.set_texture('STONE_FACE') ?

lua/native.lua Outdated
@@ -1,6 +1,6 @@
---@meta native

--file not used by the game, but used for telling the IDE about the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider .editorconfig (https://editorconfig.org/#file-format-details) so your editor will fix it for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants