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

Project Setting application/run/main_loop_type: existing classes not found #35822

Closed
simaimch opened this issue Feb 1, 2020 · 2 comments · Fixed by #41190
Closed

Project Setting application/run/main_loop_type: existing classes not found #35822

simaimch opened this issue Feb 1, 2020 · 2 comments · Fixed by #41190
Milestone

Comments

@simaimch
Copy link

simaimch commented Feb 1, 2020

Godot version: 3.2

OS/device including version: Win 8.1

Issue description:

It appears as if the project setting application/run/main_loop_type can't be set to any valid custom class. Any setting will result in the error message "Error: MainLoop type doesn't exist: main_loop_type" and a crash.

The script checks for the existence of the class in ClassDB. Maybe not all scripts have been loaded to ClassDB at this point of time?

Steps to reproduce:

  1. Create Project.
  2. Create class extending MainLoop. Exmple:
extends SceneTree

class_name MyClass


var time_elapsed = 0

func _initialize():
	print("Initialized:")
	print("  Starting time: %s" % str(time_elapsed))
  1. Set project setting application/run/main_loop_type to MyClass.
  2. Run.
@eon-s
Copy link
Contributor

eon-s commented Feb 24, 2020

This never worked (like, ever) unless you compiled the engine with your class in it, but you can set a script to the scene tree at runtime, it may work for testing purposes but is not practical at all.

Custom main loops will run from the command line, though, maybe the parameters are not correct in the editor?

@Xrayez
Copy link
Contributor

Xrayez commented Aug 11, 2020

Yeah, it works if you set this option explicitly to SceneTree or MainLoop (warning: screen flicker on startup), any other option fails (if you have no MainLoop classes registered on C++ level), of course there's little to no benefit in doing so (--script command-line option is more useful currently).

#41190 is there to handle global script classes, so this option will actually become more useful to regular users, which also works for exported projects (unlike --script, which also doesn't work when the engine is compiled with tools=no: #17778).

@akien-mga akien-mga added this to the 4.0 milestone Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants