-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Cannot set reference field value #79
Comments
The issue is, that the func(variant): return variant is PandoraEntity, Adding func(variant): return variant is PandoraEntity or variant is PandoraReference, But I don't understand the codebase well enough (yet!) to be fully confident. |
@VojtaStruhar the idea is that the reference gets created dynamically inside Pandora. From an API perspective, it should always be PandoraEntity. Let me see today what the issue is here! |
I dug a little more and found, that after selecting entity from a dropdown, you wrap it in PandoraReference and then call # reference_property.gd, _ready
entity_picker.entity_selected.connect(
func(entity:PandoraEntity):
var reference = PandoraReference.new(entity.get_entity_id(), 1 if entity is PandoraCategory else 0)
_property.set_default_value(reference)
property_value_changed.emit()) But in if value is PandoraEntity:
value = PandoraReference.new(value.get_entity_id(), PandoraReference.Type.CATEGORY if value is PandoraCategory else PandoraReference.Type.ENTITY) I think that in the entity_picker, we are wrapping the entity in a PandoraReference too early! I tried to pass in just the entity, seems to work just fine. I had a look in the stored data too - it seems to add the override correctly: If this sounds good to you, I'll make a pull request, it's a one-liner :) |
Godot version: v4.1.stable.official [970459615]
Describe the bug
When setting a reference property value, error is printed and the change doesn't happen.
To Reproduce
Steps to reproduce the behavior:
Error:
Pandora error: value <Resource#-9223369595769779648> is incompatible with type reference
This happens even if I create a brand new category with new reference fields and items.
Expected behavior
The rarity of CopperOre should change and no error should be printed.
Desktop
The text was updated successfully, but these errors were encountered: