godotengine / godotengine/godot-cpp

Access to ScriptServer

Open
#1,516 15 comments 1 reaction 0 assignees View on GitHub
discussion needs testing
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

### Godot version

4.3 beta 2

### godot-cpp version

master

### System information

Windows 10 and Linux Mint

### Issue description

If implementing a module, we can include the `script_language.h` file then access `ScriptServer`. However this is not exposed to GDExtension. I don't know if there is a reason for that.

That said, there are a few things that are very useful. Of particular interest to me is querying if a scripted class inherits from a specific base. I know that we can manually do that by first obtaining the list of "global classes" (`ProjectSettings::get_singleton()->get_global_class_list()`. However this option means that we always have to iterate through the list of classes. Caching the data might result in outdated data. From my understanding `ScriptServer` is always updated whenever a scripted (global) class is created or removed.

I understand if not exposing `ScriptServer` is actually desired.

### Steps to reproduce

-

### Minimal reproduction project

-

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.