-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Ability to create your own resource types #7037
Comments
You can make custom resource with an EditorPlugin. It's quite similar to making a custom node as described in the documentation, just replacing the base type to It's still a bit cumbersome, since you can't use this custom types as export hints and it's a bit difficult to make a custom editor for your Resource type, since it's impossible to save it through the plugin (#6603). Still, it's possible to create, edit, and save them from the Inspector dock like any other Resource type. |
@vnen to me it seems like he is talking about something like unity's ScriptableObjects, which are a nice thing to have anyways. |
So... no chance for this to become a thing? |
@indiemaatheus did you even read my previous comment? I literally said it is already possible to create custom Resource types (just might not be in the ideal format yet, but there's always margin for improvement). If this is not what want, then describe it in another way. BTW, I don't use Unity and have no idea what ScriptableObjects are. |
Well, I did not mean to annoy you. What I asked is that - once you said it's "a bit cumbersome" process - if it was going to get some more attention from the team. And no, I'm not talking about an Unity's feature since I've never used it, but the idea is pretty simple and is probably the same as what KioriSun described. |
you can already make a .gd that inherits from resource, then instance those On Tue, Nov 8, 2016 at 5:46 PM, indiemaatheus [email protected]
|
It'll get improved, it's just not a priority for now. There's always community members working on stuff though, so maybe it gets looked sooner. |
I created this Inheritance Dock plugin that I think will make this much easier. |
The original issue should be fixed with @vnen's comment here: #7037 (comment) IIUC? |
If you wondering how to make a .gd as a resource. This post in the dev forum answers it: https://godotengine.org/qa/8139/need-help-with-exporting-a-custom-ressource-type |
I'll close this as the base feature is now implemented. There are a few proposals related to improving custom resource usability, such as godotengine/godot-proposals#18. |
What do I mean?
Well, since Resources are just data containers, this should not be too complex to achieve. What I mean is to, somehow, be able to create your own Resource type, making it possible to create data files and edit them within the editor.
How would it work?
My sincere apologies if it's not welcome to show how other engines do it, but I think it's interesting to exemplify. I will just not mention the framework/editor I'm talking about, but that's how one can create a Resource:
http://image.prntscr.com/image/fc4489a3b0104102974c6b08da2dd965.png
After compiling it, it's possible to edit the public properties (similar to export vars) of said Resource. Reminder: The Resource itself won't do any thing, it just stores data for the game to handle. The Resource's file extension could be fileName.resourceName.res.
Let's say I create a Resource type called Character and I name it George... Its filename would be george.character.res. There are other ways to name it, though (or maybe leaving it as field, so the user names it however they want).
When would it be useful?
That's a great way to make databases. One could make a --xml, json, ini or whatever-- the game would read and then would just create Resources for the game. Let's say I created a Weapon Resource, and a Character one. The Weapon Resource would contain: A string called Name, and a int called Damage.
The Character Resource would contain: A string called Name, and a ResourceRef called Weapon. Then I could give the weapons a name and a damage. Also give the Character a name and a weapon.
Then, I could create a Sprite node that would be my character, with a ResourceRef and properly load its data. Not only set its weapon but the stats, appearence, or whatever I wanted.
I hope I'm clear and if there's already a feasible way to achieve this within Godot, let me know how.
The text was updated successfully, but these errors were encountered: