Author Topic: .bls Modification [Solved]  (Read 1068 times)

How could I use file objects to modify a .bls file so that all bricks not owned by a certain ID are deleted?
« Last Edit: January 23, 2013, 12:24:20 PM by jes00 »

yes. pretty easily actually.
look up the serversided saver.
read about the format of the .bls
then when you read over a .bls file
pick out the lines you want.
get the amount of lines you want
and rewrite it.

It's actually pretty hard. Ownership is not explicitly defined on a per-brick level in the save file and is in fact inherited from the baseplate supporting it, so you'd need to work out which bricks in the save file were supported by a baseplate owned by a certain ID which is far from trivial.

pretty much what ephi said

What would be easier is weeding out all the bricks once they are loaded, as ownership is then more easily defined on a per-brick basis

What would be easier is weeding out all the bricks once they are loaded, as ownership is then more easily defined on a per-brick basis
Yes, at that point you can just delete the unwanted brickgroups.

what happens if you have two baseplates next to eachother, owned by two different people, and a brick on top of both in the middle of them
then who gets the brick when it's loaded?

what happens if you have two baseplates next to eachother, owned by two different people, and a brick on top of both in the middle of them
then who gets the brick when it's loaded?
The baseplate that was loaded last gets the brick.
At least, that's what happened when I tested it

What would be easier is weeding out all the bricks once they are loaded, as ownership is then more easily defined on a per-brick basis
What if I don't have all the bricks enabled and I still want some of the bricks that did not load to "exist".

What if I don't have all the bricks enabled and I still want some of the bricks that did not load to "exist".
If there isn't a callback for when a brick fails to load, you could go through the file with a whitelist of UI names that are on the server, but then you still have to think of a way to determine per-brick ownership through the save file.

You have two options the way I see it, either half-ass the ownership through bls and load it anyway, or do a good job on the bls ownership detection and have it convert the entire save file. My advice is to do the latter

How would it be possible to detect ownership if only the bricks on the ground have it saved