Godot: Expose call_multilevel to scripting

Created on 18 Mar 2017  路  4Comments  路  Source: godotengine/godot

I'm working on the framework of my game in Godot, and I use script inheritance, and function overriding a lot. And in order to call a function both in the children and the parent scripts, you would have to use call_multilevel, which is not yet exposed to GDScript.
I was about to make a PR, but then I thought it would be better to first make sure others would need this too

archived enhancement core gdscript

Most helpful comment

multilevel func test():

ETOOMANYKEYWORDS

More seriously, I don't think it would be a good feature as a keyword. You might want to call multilevel at times, and not multilevel at other times, so a function is better.

All 4 comments

Was thinking of this today as well. It is sometimes useful to do a multilevel call of some functions.

I was wondering if it wouldn't it be better if we make it a flag on the function instead:

func test():
  pass
func call_test():
  call_multilevel("test")
# ----- OR -----
multilevel func test():
  pass
func call_test():
  test()

multilevel func test():

ETOOMANYKEYWORDS

More seriously, I don't think it would be a good feature as a keyword. You might want to call multilevel at times, and not multilevel at other times, so a function is better.

Yeah i also think a keyword would be unnecessary. It doesn't have to be overcomplicated.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adolson picture adolson  路  87Comments

willnationsdev picture willnationsdev  路  93Comments

RyanBram picture RyanBram  路  101Comments

Calinou picture Calinou  路  219Comments

reduz picture reduz  路  111Comments