ID:1631666
 
Hi! I've been working on a new way to save objects by storing some of their most important values in a list, and then recreating them when world's rebooted.

It works great, however, I'm having some problems while deleting them.

I am adding some values (x, y, z, type, etc) in a list, the problem is that when you use List.Remove(value) it could be removing another var which shared the same value (because they're all stored in the same list). Therefore I need to delete specific values in the list, I tried to do that by using Del(value) (after looping through the list), but this returns an error (bad del), if I display it to the world, it displays the correct values.

I'm not deleting null values, I checked the values that were getting deleted by using world<<"[V]" (returns the value), and it was showing the correct value I was attempting to delete.

So well, is there a way to remove an specific value in a list by looping through the list without using Remove()? I imagine I could recreate the list by looping through the list again and skipping the values that are getting deleted, but I thought that I could find a better answer here :)
Just going to put an idea out there. Why are you storing all of these in the same list? Why not have a list of lists? That way each package of information on an object is stored neatly in it's own list which can easily be removed.
In response to Zecronious
Zecronious wrote:
Just going to put an idea out there. Why are you storing all of these in the same list? Why not have a list of lists? That way each package of information on an object is stored neatly in it's own list which can easily be removed.

I'm basically doing it this way because it requires less space, I tried the other way and the save file was much bigger. I think I'll do what I stated though, it works well.
Have you thought about using a separator? When you're looping through, then each time you encounter a separator you're onto a new object.