ID:2315319
 
(See the best response by Kaiochao.)
I'm having trouble assigning bounds to icons that are greater than my default world.icon_size.

Is it even possible to do that currently? As it stands, I have an icon that is 64x64, with the contents being around 48x48 and placed within the middle of the 64x64 square. After assigning the correct space between the icon via bound_x/y, I then set the desired width and height.

The problem is, everything seems off. I've tried adjusting both the pixel_x/y and step_x/y, but I don't think I'm understanding things correctly overall to get this working correctly.

Could anyone offer some advice or suggestions?


Could you elaborate on the issue? Maybe show a video clip of the problem in action?

Seeing the problem would help a lot. Also seeing the code for the object wouldn't hurt.
Hmm, so basically. When I assign the correct bound box vars for an obj that has a higher pixel size than world.icon_size, the actual box itself isn't aligned where I thought it would be. Instead of bumping into the correct edges of the bound box and stopping, I can pass through places where I thought I set the correct boundings, and get stopped in places where I shouldn't.

Not sure if it helps, but here is an example of what I'm using.

mob step_size is 6 in this instance.

So the icon is 64x64 in total, but the actual pixels of the obj inside its dmi is about 48x64 roughly. So I set this for its boundings.

bound_x = 25
bound_y = 1
bound_width = 47
bound_height = 24

The red lines in this image show the large gap I have either side of the obj in game and show that I can't get any closer, even though I should be able - https://imgur.com/jp0kaKi
Best response
With (pixel_x, pixel_y) = (0, 0):

(bound_x, bound_y) should be the number of pixels between the bottom-left edge of the icon and the bottom-left edge of your bounding box. If you open the icon in Dream Maker's icon editor, put your mouse at the bottom-left pixel of where you want the solid part to be, and then move it one more pixel to the lower-left, then the coordinate is equal to what your (bound_x, bound_y) should be.

(bound_width, bound_height) should be the width and height of the bounding box in pixels, obviously.

Any amount you add to (pixel_x, pixel_y) should also be added to (bound_x, bound_y). For example, if you have a 96x96 icon with a 32x32 bounding box in the center, then your (bound_x, bound_y) = (32, 32). You could then adjust its offsets to move the bounding box to the bottom-left of the icon by setting (pixel_x, pixel_y) = (-32, -32), but then you would have to set its (bound_x, bound_y) to (0, 0), because pixel offsets are purely visual and don't affect any physical properties of the object. It's kind of up in the air at this point whether or not one should always use pixel offsets instead of bound offsets, since it's kind of redundant.

Another way of configuring your bounding box is to use the undocumented "bounds" variable. It uses a syntax similar to screen_loc:
bounds = "[width],[height]" // bound offsets = 0
bounds = "[x1],[y1] to [x2],[y2]" // fully specified

You can get the coordinates simply by hovering the mouse over the pixels in the icon editor. The only downside, when you use the fully-specified format, is that it's not immediately clear what the width and height are (though it's just a tiny bit of math to figure it out).
I think I understand, thank you for the replies. One last question. Is it possible to set bounds that are higher than the current world.icon_size?
In response to Doughy One
Try it and find out. Sometimes, questions are faster being answered with a little play-testing than awaiting replies on the forums.
Ah yes, thank you. I understand what you're saying. :)

Hmm, the reason I asked, is because I already tried and wasn't able to get it to work. So I was wondering - and hoping, someone might know a way to enable it.
In response to Doughy One
Taken from the reference (F1 in Dream Maker)

"icon_size var (world)

This is the tile size that will be used as a default for icons in the world. It can be set to a single number that represents both the width and height, or you can use a format like "[width]x[height]" (such as "16x48") to specify width and height separately.

This value affects several calculations, including icon operations and gliding between turfs."
In response to Doughy One
Doughy One wrote:
I think I understand, thank you for the replies. One last question. Is it possible to set bounds that are higher than the current world.icon_size?

Yes. Movable atoms can have bounds larger than world.icon_size. The issue though, is if you are using pixel movement mode, they must be an even multiple of your world's icon_size. If any component of bounds is not a perfect tile size, or if step_x/y are offset on a single object in the world, your whole world will dump into pixel movement mode and gliding behavior will immediately stop.