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

Allow projects to reference classes from other projects, even if not present on the filesystem #5147

Open
antonWetzel opened this issue Aug 11, 2022 · 2 comments

Comments

@antonWetzel
Copy link

antonWetzel commented Aug 11, 2022

Describe the project you are working on

Rougelike with planned mod support by loading resource packs

  • language: CSharp
  • base game not open source
  • rooms as packed scenes
  • enemies as inherited packed scenes from core class
  • items as scripts placed on child nodes
  • mods/content packs as complementary projects

At boot time the game loads all resource packs in a folder and has a collection of enemies, rooms, ... to create the game content

Describe the problem or limitation you are having in your project

I can't reference Scripts and Scenes from the core game in the editor in the complementary project.

  • can't reuse enemies in a new room
  • can't reuse items for a new enemy

Describe the feature / enhancement and how it helps to overcome the problem or limitation

A godot Project can be marked as complementary

  • Scripts and PackedScenes can be 'unknown'
    • manual path selection
    • exported Variables can be edited like Metadata without validation
  • run is replaced with export and run
    • export pck to export path (games extra content folder)
    • run game (no clue how much debugging is possible with exported game)
  • optional / future
    • base game can be exported as placeholder
    • placeholder contains all selected scripts and scenes with only exported variables
    • placeholder can't be edited in the editor
    • placeholder is excluded from the exported pck

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

image

image

The Resource file format can mark a external resource as 'unknown' and the editor allows to edit properties without validation

[ext_resource type="Script" path="res://Core/Script.cs" id="1_h1no0" unknown]
[ext_resource type="PackedScene" path="res://Core/Scene.tscn" id="7_qa0ue" unknown]

The 'unknown' tag is removed at export

If this enhancement will not be used often, can it be worked around with a few lines of script?

not possible

Is there a reason why this should be core and not an add-on in the asset library?

not possible

@Calinou
Copy link
Member

Calinou commented Aug 11, 2022

Related to #1205.

@Calinou Calinou changed the title Editor Support for 'Complementary-Project' Allow projects to reference classes from other projects, even if not present on the filesystem Aug 11, 2022
@antonWetzel
Copy link
Author

antonWetzel commented Aug 14, 2022

I think is it possible to replace this with an addon, which contains

  • script_placeholder.gd with @export var path: String and @export var data: Dictionary
  • scene_placeholder.tscn with a single Node and script_placeholder.gd attached
  • An EditorExportPlugin to replace the placeholders on export

My problem is, that I would like to use SceneState but the build API is not public to GDScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants