WeaselGames / godot_luaAPI

Godot LuaAPI
https://luaapi.weaselgames.info
Other
361 stars 27 forks source link

Registry indexing, function calls, global manipulation, now all recursive! #156

Closed RadiantUwU closed 11 months ago

RadiantUwU commented 11 months ago

Some nice QoL features

RadiantUwU commented 11 months ago
extends Node2D

func _ready():
    var api := LuaAPI.new()
    api.bind_libraries(["base","debug"])
    api.do_string("debug.getregistry().test={test_f=function() print('hello') end}")
    api.call_function_registry("test.test_f",[])
    api.do_string("""
    utils = {
        something_i_guess=function()
            return debug.getregistry().test.test_f()
        end
    }
    """)
    api.call_function("utils.something_i_guess",[])

Still testing the new stuff out, this did work btw.

RadiantUwU commented 11 months ago

https://github.com/RadiantUwU/godot_luaAPI/actions/runs/6160441461 in case you want to test it

RadiantUwU commented 11 months ago

Uhoh found an issue already

RadiantUwU commented 11 months ago

SUGGESTION: Can you make a 3.0 branch really quick and we move everything in there instead?

RadiantUwU commented 11 months ago

Alr now it should be fixed

RadiantUwU commented 11 months ago

@Trey2k I saw an issue with the unit tests in gdextension, it keeps trying to compare a float with some dictionary for LuaCoroutine.yield_await

Trey2k commented 11 months ago

@Trey2k I saw an issue with the unit tests in gdextension, it keeps trying to compare a float with some dictionary for LuaCoroutine.yield_await

This is not something the was failing before. Some how the changes here have messed up or changed what is returns when a coroutine yields. Either the test needs to be modified, or the bug needs to be found.

RadiantUwU commented 11 months ago

@Trey2k I saw an issue with the unit tests in gdextension, it keeps trying to compare a float with some dictionary for LuaCoroutine.yield_await

This is not something the was failing before. Some how the changes here have messed up or changed what is returns when a coroutine yields. Either the test needs to be modified, or the bug needs to be found.

I have honestly no idea why it fails those tests but it does work in my editor

RadiantUwU commented 11 months ago
2023-09-12T20:13:22.8621951Z           at: _process (res://testing/tests/LuaCoroutine.yield_await.gd:55)
2023-09-12T20:13:22.8690790Z SCRIPT ERROR: Invalid operands 'float' and 'Dictionary' in operator '<='.
2023-09-12T20:13:22.8691787Z           at: _process (res://testing/tests/LuaCoroutine.yield_await.gd:55)
2023-09-12T20:13:22.8759079Z SCRIPT ERROR: Invalid operands 'float' and 'Dictionary' in operator '<='.
2023-09-12T20:13:22.8760059Z           at: _process (res://testing/tests/LuaCoroutine.yield_await.gd:55)
2023-09-12T20:13:22.8825950Z SCRIPT ERROR: Invalid operands 'float' and 'Dictionary' in operator '<='.
2023-09-12T20:13:22.8826485Z           at: _process (res://testing/tests/LuaCoroutine.yield_await.gd:55)
2023-09-12T20:13:22.8894685Z SCRIPT ERROR: Invalid operands 'float' and 'Dictionary' in operator '<='.
2023-09-12T20:13:22.8895169Z           at: _process (res://testing/tests/LuaCoroutine.yield_await.gd:55)
2023-09-12T20:13:22.8964678Z SCRIPT ERROR: Invalid operands 'float' and 'Dictionary' in operator '<='.
2023-09-12T20:13:22.8965188Z           at: _process (res://testing/tests/LuaCoroutine.yield_await.gd:55)
2023-09-12T20:13:22.9021091Z ##[error]The operation was canceled.
2023-09-12T20:13:22.9096875Z ##[group]Run actions/upload-artifact@v2
2023-09-12T20:13:22.9097156Z with:
2023-09-12T20:13:22.9097429Z   name: gdextension-test-results
2023-09-12T20:13:22.9097743Z   path: project/extension-log.txt
2023-09-12T20:13:22.9098011Z   if-no-files-found: warn
2023-09-12T20:13:22.9098422Z env:
2023-09-12T20:13:22.9098648Z   BASE_BRANCH: main
2023-09-12T20:13:22.9098871Z ##[endgroup]
2023-09-12T20:13:24.4945753Z ##[warning]No files were found with the provided path: project/extension-log.txt. No artifacts will be uploaded.
2023-09-12T20:13:24.5006976Z Post job cleanup.
2023-09-12T20:13:24.7274492Z [command]/usr/bin/git version
2023-09-12T20:13:24.7274876Z git version 2.42.0
2023-09-12T20:13:24.7312228Z Temporarily overriding HOME='/home/runner/work/_temp/6dcad683-b89f-4d40-914c-f50693090ee8' before making global git config changes
2023-09-12T20:13:24.7313696Z Adding repository directory to the temporary git global config as a safe directory
2023-09-12T20:13:24.7314356Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/godot_luaAPI/godot_luaAPI
2023-09-12T20:13:24.7315362Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-09-12T20:13:24.7316641Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-09-12T20:13:24.7317770Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-09-12T20:13:24.7318312Z http.https://github.com/.extraheader
2023-09-12T20:13:24.7319215Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2023-09-12T20:13:24.7320540Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-09-12T20:13:24.7512295Z Cleaning up orphan processes
2023-09-12T20:13:24.7768021Z Terminate orphan process: pid (1775) (godot)

Did you cancel it?

Trey2k commented 11 months ago

Did you cancel it?

No, it timed out.

RadiantUwU commented 11 months ago

No, it timed out.

Oh. I have no idea how to fix it

Trey2k commented 11 months ago

Oh. I have no idea how to fix it

I am not sure what broke either, as I mentioned something had to change with the values that get returned on coroutine.resume, so I would start looking there

RadiantUwU commented 11 months ago

Seems like the tests were working before i modified the table indexing stuff

RadiantUwU commented 11 months ago

https://github.com/RadiantUwU/godot_luaAPI/actions/runs/6157594176

RadiantUwU commented 11 months ago

I think i saw something

Trey2k commented 11 months ago

BTW, this will not be a version bump to 3.0, no core features here I think should be changing functionality, only some new features in addition to whats been there. So it should be fine to merge into the current 2.1 minor version bump.

RadiantUwU commented 11 months ago

BTW, this will not be a version bump to 3.0, no core features here I think should be changing functionality, only some new features in addition to whats been there. So it should be fine to merge into the current 2.1 minor version bump.

Maybe 2.2 version bump?

RadiantUwU commented 11 months ago

After all, its gonna be a lot easier now to simply run either functions that are meant to be hidden from the environment or not.

Trey2k commented 11 months ago

Maybe 2.2 version bump?

2.1 is still in dev, not released. So should be fine to include there.

RadiantUwU commented 11 months ago

2.1 is still in dev, not released. So should be fine to include there.

Oh, alright

RadiantUwU commented 11 months ago

I think its working now since its not showing errors currently on the test.

RadiantUwU commented 11 months ago

Nevermind.

RadiantUwU commented 11 months ago

And now i'm gonna probably head for the night, i'll see what happened next tommarow. Cya

RadiantUwU commented 11 months ago

Seems like it succeeded!

Trey2k commented 11 months ago

Also please squash the PR at some point, lots of commits here

RadiantUwU commented 11 months ago

Also please squash the PR at some point, lots of commits here

doesn't github do that automatically when the PR is merged?

Trey2k commented 11 months ago

doesn't github do that automatically when the PR is merged?

Yes that is an option, but it makes reviewing the PR a little more annoying until it is merged, its not a big issue but helps a lot to prevent lots of scrolling haha

RadiantUwU commented 11 months ago

fixed issues

RadiantUwU commented 11 months ago

uhoh

RadiantUwU commented 11 months ago

style fix

Trey2k commented 11 months ago

uhoh

Static checks can be picky

RadiantUwU commented 11 months ago

Oops, i went overboard with replacing

RadiantUwU commented 11 months ago

Should be fine... hopefully....

RadiantUwU commented 11 months ago

I think its gonna be fine