-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Custom-made resource types cannot be used in export statement #6763
Comments
Offhand, I attempted to make a custom resource in order to create a custom color palette for a practice tetris game. If there's an easier way to make a centralized reference to a set of colors for the I-block, T-block, etc, please tell me. |
Moving to topic:gdscript, since it is only impossible to export it, but it is totally possible to use it in other ways. |
Yeah, after a while I realized I could just |
First of all thank you for your report and sorry for the delay. We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to. We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us. For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors. Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed. Thanks in advance. Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it. |
Is this fixed by #16995? |
Sorry for the delay, myself. I can't check whether this was fixed at this exact moment, but I'll take a crack at it first thing in the morning - it seems like the old 2.1 project should be able to be copied over with minimal edits to test it, anyway. |
For the sake of posterity I checked to ensure that the problem wasn't already solved in v3.0.2.stable.official - it's not. Attempting to I'll be building a version of the editor from the commit of the linked PR soon and replicating my efforts there to see what happens. |
@Noshyaar - Having built a version of Godot from the master branch (ID'd as v3.1.dev.custom_build.d87307d) I can confirm that this issue does not appear to have a direct solution. With a custom resource type named In the process of testing, I think I've found a pretty significant bug. When I create a baseline variable, The "filter with I'm attaching my test project in full for posterity. The |
In hindsight, since I doubt that it would be easy to make the export statement accept custom resource types normally (as in |
Currently, you cannot export variables of type Node, as it is not a primitive or resource type. Try NodePath or String. |
@EmeraldSlash I think you might be commenting on the wrong issue? |
@MutantOctopus What do you mean? This is the only issue on this topic I believe, and the only difference between mine and the thread's issue would have been which specific type of objects (custom & built-in) were not allowed. It's also no longer an issue for me because of what bojiday-bg said. |
Games which are data-heavy (such as RPGs) would benefit immensely from better support for user-defined resources; there is a great deal of convenience in being able to see and modify game data in-engine via the FileSystem and Inspector, and being able to create, save and load this data without having to go through a parser. Thanks to the new |
Sorry for the bump, I just found this issue after commenting about it here: #3597 (comment)
Yeah, supporting custom resource types in exported variables will greatly improve the custom resource workflow. It would be nice to see this implemented yet for 3.1 |
It seems that this behavior is still present in 3.1.1. However, it might get fixed by #26162. I've been running some tests on this branch, and you can use custom resources directly with their classes, using class_name in the resource script.
But there is still one bug mentioned above that can be reproduced. If I write:
I still get CustomResource (on top of Curve) displayed in the editor's drop-down. Basically, this means that any custom type added will appear on every exported resources. Which at best can be inconvenient, at worst could easily lead to errors. Anyway, for those who need custom resources, exporting a different type of resource is still the best workaround I've found. Not pretty (especially when writing a plugin), but at least it allows to select the custom resource from the editor (… by exploiting a glitch) without listing all resources. |
@ClementRivaille Can you elaborate on "exporting a different type of resource is still the best workaround I've found"? Not sure to follow. Thanks. |
Could this make it to 4.0? This has been asked in 2016, and the amount of thumbs up speaks for itself. This would be really nice to have, and I doubt it's a massive change to make. |
@Jeto143 Yes, it's planned for 4.0. Anyway, I'll close this in favor of godotengine/godot-proposals#18, as feature proposals are now tracked in the Godot proposals repository. |
Operating system or device - Godot version:
Windows 10 - Godot 2.1 Stable
Issue description (what happened, and what was expected):
Created a custom resource type as a plugin and attempted to
export(CustomResource)
, which raiseserror(17,7): Export hint not a type or resource.
Steps to reproduce:
Create a plugin which defines a custom resource type.
add_custom_type
like the plugins tutorial shows (Specifically,add_custom_type("Name", "Resource", preload("plugin_source.gd"), preload("icon.png"))
). The new type will appear in the "create resource" menu, but attempting toexport(CustomResourceName)
will raise the error.Link to minimal example project:
Custom Resource (2.1s).zip
The text was updated successfully, but these errors were encountered: