This sounds like a dangerous idea (arbitrary code execution by an attacker), what is your use case?
Godot
Welcome to the programming.dev Godot community!
This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.
Make sure to follow the Godot CoC while chatting
We have a matrix room that can be used for chatting with other members of the community here
Links
Other Communities
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Rules
- Posts need to be in english
- Posts with explicit content must be tagged with nsfw
- We do not condone harassment inside the community as well as trolling or equivalent behaviour
- Do not post illegal materials or post things encouraging actions such as pirating games
We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent
Wormhole
Credits
- The icon is a modified version of the official godot engine logo (changing the colors to a gradient and black background)
- The banner is from Godot Design
This is really just an internal tool I want to build. This will not be exposed to the player,
If it's connected to a network it's not enough that it's an internal tool. Don't open yourself up to a coworker executing code on your machine as you.
Okay this is reasonable... I should have clarified that i am the only worker (don't own a company or anything) so i think it'll be fine
found a few examples of how to do it on a github issue:
var script = GDScript.new()
script.source_code = "func say_hello():\n\tprint(\"Hello!\")"
script.reload()
var script_instance = script.new()
script_instance.call("say_hello")
var MyClass = load("myclass.gd")
var instance = MyClass.new()
assert(instance.get_script() == MyClass)
Are you perhaps looking for an Expression?
I think that is probably as close as you can get to what you want to do.
This seems to be the exact thing I am searching for, thanks! I have run into an interesting hickup tho. One can pass self to the expression so that it uses the node as the base, but the expression doesn't seem to have access to autoloads. The error I'm getting there looks something like this: Invalid named index 'ExampleAutoload' for base type Object EDIT: Turns out I need to pass these individually as arguments essentially.