-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 mark resources as json and other types #1740
Comments
For reference, this can be implemented as a |
@Xrayez Is this possible to do with gdscript currently? |
@Shadowblitz16 yes, I think it should be straightforward to port to GDScript since the import API is quite similar, see Import plugins. |
so I made a import plugin however that imports json files and populates a resource,
Note this is temporary until its added to the engine. |
@Shadowblitz16 you literally have to create a |
@Xrayez DM me on discord about this its getting offtopic. EDIT: |
Well I've just tried to port https://github.com/godot-extended-libraries/json. to GDScript and stumbled upon a limitation in Godot 3.2. class_name JSONResource extends Resource
var data
var json setget set_json, get_json
func set_json(p_json):
data = JSON.parse(p_json).result
func get_json():
return JSON.print(data)
func _get_property_list():
return [
{ name = "data", type = TYPE_NIL, usage = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NIL_IS_VARIANT },
{ name = "json", type = TYPE_STRING, usage = PROPERTY_USAGE_EDITOR },
]
This is also not possible in Godot 4.0: @export var data: Variant So, I guess there was a reason why it was implemented as a C++ module. 😮 Technically, it's still possible to |
Describe the project you are working on:
Mario game
Describe the problem or limitation you are having in your project:
I want to be able to mark a resource as json so that I can implement modding support
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Allow us to mark resources and custom resources as json so they can be edited outside of the godot editor
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
I would guess it would be a option in the import tab.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
It would be used for modding and not without fighting the editor
Is there a reason why this should be core and not an add-on in the asset library?:
it improves modding support.
The text was updated successfully, but these errors were encountered: