Dictionary load and save tutorials
-
We could really use a clear tutorial on arrays and dictionaries — something that shows how to add and remove elements with simple, clean examples, and explains how an inventory system should work.
This would be perfect. ❤️
-
How do I put an object at the next index value place?
It’s not append and not prepend. And I am not supposed to know the current index.After the A9. How can I put my next object there? Is there any function to put things one after the other?

-
How to delete a spawned object from the array?
I pick up an object and that object appears in the inventory. I want to remove the object from the inventory and from the array at the same time. Destroying the inventory object itself is easy, but I don’t know how to remove the source object (the one that was used to spawn the inventory object) from the array.
The problem is that the object I pick up and the object in the inventory do not share the same object ID. Every time I pick something up, the inventory gets a new object instance with a new ID.
How can I delete the original source object (the one that was used to spawn the inventory object) from the array when I destroy the inventory object? -
Here I found it

-
How do I put an object at the next index value place?
It’s not append and not prepend. And I am not supposed to know the current index.After the A9. How can I put my next object there? Is there any function to put things one after the other?

How do I put an object at the next index value place?
It’s not append and not prepend. And I am not supposed to know the current index.After the A9. How can I put my next object there? Is there any function to put things one after the other?

You must find the index of the first occurrence of "".
Loop loop through all elements of an array --> If check whether the current value is equal to "" --> Modify Array if the current value is equal to "", then you can replace the item given the current
indexof the Loop behavior -->Break you want to break out of the loop so it doesn't do it for the rest of the array.

-
How to delete a spawned object from the array?
I pick up an object and that object appears in the inventory. I want to remove the object from the inventory and from the array at the same time. Destroying the inventory object itself is easy, but I don’t know how to remove the source object (the one that was used to spawn the inventory object) from the array.
The problem is that the object I pick up and the object in the inventory do not share the same object ID. Every time I pick something up, the inventory gets a new object instance with a new ID.
How can I delete the original source object (the one that was used to spawn the inventory object) from the array when I destroy the inventory object?How to delete a spawned object from the array?
I pick up an object and that object appears in the inventory. I want to remove the object from the inventory and from the array at the same time. Destroying the inventory object itself is easy, but I don’t know how to remove the source object (the one that was used to spawn the inventory object) from the array.
The problem is that the object I pick up and the object in the inventory do not share the same object ID. Every time I pick something up, the inventory gets a new object instance with a new ID.
How can I delete the original source object (the one that was used to spawn the inventory object) from the array when I destroy the inventory object?For this one you want to store the source object ID in the spawned object using attributes. You can use Set Attribute to set a key with the object ID as the value. Then when destroying the object, you can use Get Attribute to retrieve it from the object.
Here's an example:
Original Object
The original object spawns another object (the red one). In the spawned object, we can set an attribute
source object idwith the original object id.
Spawned Object
The spawned object can retrieve the original object that spawned it and destroy it.

-
Thanks 😃
-
Yes but it is coming from a loop and a spawn the entire array. So what would you do?
-
A little option to destroy the source would be nice 😊
-
It’s weird because sometimes it delete the source even if the ID is not the same… For that I do a modify array by doing a get array value at index when the spawn object is touched. But it doesn’t work every time. I don’t understand why.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login