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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挕 simplify entity instantiation #102

Merged
merged 8 commits into from Sep 3, 2023
Merged

Conversation

bitbrain
Copy link
Owner

@bitbrain bitbrain commented Sep 2, 2023

Implements #82

This pull request implements proposal #82 (comment) by simplifying the instantiation of entities (e.g. to save them into a custom save game outside of Pandora)

Highlights

  • removed PandoraEntityInstance
  • custom scripts can now be instantiated
  • simplified loading/saving of PandoraPropertyInstance by only persisting it when it actually overrides a value

Usage Example

var entity = Pandora.get_entity(Tools.PICKAXE) as Tool
var pickaxe_instance = entity.instantiate()
pickaxe_instance.set_float("durability", 0.9)
var json_data = Pandora.serialize(pickaxe_entity)
# store json data somewhere!
# pickaxe instance is of type `Tool`, not just `PandoraEntity`
pickaxe_instance = Pandora.deserialize(json_data)

@bitbrain bitbrain marked this pull request as ready for review September 3, 2023 19:56
@bitbrain bitbrain changed the title 馃毀 WIP simplify entity instantiation 馃挕 simplify entity instantiation Sep 3, 2023
Copy link
Contributor

@mrfelipemartins mrfelipemartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah everything looks fine now! Great job! I still have some issues during load but now is all on my side. I can confirm everything on Pandora's side is working properly now.

@bitbrain bitbrain merged commit 16683aa into godot-4.x Sep 3, 2023
3 checks passed
@bitbrain bitbrain deleted the simplify-entity-instancing branch September 3, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants