ObjectBuilder icon indicating copy to clipboard operation
ObjectBuilder copied to clipboard

Same sprite in multiple objects

Open elewental opened this issue 3 years ago • 6 comments

From: https://github.com/ottools/ObjectBuilder/issues/38

Using same sprite to different objects may help not making the client so heavy sometimes, perhaps is not something so impactful, and im not sure if everyone who do this way uses this reason, but I do sometimes.

And when I need add new sprites for only one of the objects, I must replace it by hand. Well I have a suggestion for this situation.

  • Maybe if instead of the "you want to replace the current sprites", it appears "it was found more than one object with the same sprites, select this if you want to replace only this object id" and other option at the same window "ignore and replace all" (only in cases of really having multiple objects using same sprite id -- if not, keep the actual message/mode).

  • As a result, if two objects have same sprite id, and you choose to replace only the 1 (the message "it was found more than one... Replace only this...) and not the 2, instead of replacing the 1 the same way it works now, it would work like if you're importing new sprites and replacing it automatically (it would do the work of remaking the object, once it is already configured), and then object 1 would have different sprite id from the 2.

Example: image image image image

elewental avatar Feb 28 '22 21:02 elewental

If I understand correctly, you are telling about Sprites Optimizer which is in Menu/Tools. It will remove all empty, unused and duplicated sprites at once

punkice3407 avatar Mar 01 '22 23:03 punkice3407

Not exactly.

Example: test4

For a random reason, I have 3 duplicated objects (100, 101 and 102). Each one is 2x1. Normally it would have 6 sprite ids for it, but I used one id equal in the 3 objects, so I have 4 sprite ids instead. image

Then, if I want to replace only the first one, the object id 100, the sprite of 101 and 102 will be replaced too by issue: test5

The proposal is to create a option, for instead of replacing the sprite ID that will change in all objects, if you not choose "replace all", it will import new sprites at the end of the spriteid list and then automatically replace it as another sprite id, keeping the 101 and 102 configuration.

image

You see, If I choose to replace all, it will remain 4 sprite ids. (and keeping the issue shown at first gif) image image

But If I use the option I suggested, this will happen: (101 and 102 will still have a same spriteid, but will not share it with the 100). image image

elewental avatar Mar 03 '22 01:03 elewental

Does the same problem occur with the 1x1 spritesheet?

punkice3407 avatar Mar 05 '22 04:03 punkice3407

It happens for all, when the same spriteid is used in more than 1 object, doesn't matter the width/weight or pattern, or the square the sprite is located.

elewental avatar Mar 05 '22 19:03 elewental

+1 This is a big problem especially when editing ground tiles which share same sprites. Currently if you want to change a sprite only for one tile it will change it for all other tiles too!

When importing .png spritesheets it should always create new sprites, never replace old sprites! When importing .obd it already does that, so why not do the same on .png import?

the-overdriven avatar Mar 06 '22 16:03 the-overdriven

When importing .png spritesheets it should always create new sprites, never replace old sprites!

When importing .obd it already does that, so why not do the same on .png import?

I disagree, the function of replace action is to replace, if you want to import new sprites you could just use the import tool or drag the .png into a blank object.

If you create an object with no sprites, set the correct size and then move a .png file it will add the sprites importing it.

test13

elewental avatar Mar 06 '22 22:03 elewental