Hi, I've created a custom stairs object and associated custom bitmap set. When I place the stairs in ESB editor, ESB does not use the stair icon from the editor cell.pcx file, it just displays the standard floor upright icon. I can't see how to point the custom stair object to te stair icon. Is there a way to do this? Or to point at a standalone icon for use in ESB?
In fact, can I create new icons? Can I expand the cells.pcx? How does one point a gfx reference to it?
There are a few ways to do it. Admittedly none of this is particularly well documented though you can see the code in editor/editor.lua which has plenty of examples.
The simplest way is to set esb_name equal to one of the standard archetypes (e.g. "stairsdown") which will tell ESB to use the icon for that archetype. Another approach is to define esb_drawinfo, which is a table that specifies the icon number in cells.pcx and the priority to draw that icon: { 2, 0 } for stairs down, for example.
You can expand cells.pcx by adding new rows below the existing ones. Do not change the width or you will throw off all of the existing icon offsets and make a huge mess.
Making the process of adding new editor graphics easier is something that I've wanted to do for a while but it's a big enough job I've never really found the time or motivation, so whether it's ever actually going to happen is pretty unclear at this point.
Ok thanks. I had seen the code but didn’t fully understand it, the explanation above makes sense, will play with this later when I get a chance.
Thanks for clarifying also how to add cells, sounds straightforward. I’ll probably add cells to try to better differentiate the custom assets in my custom dungeon. I had already made some mods to change appearance etc.
In relation to my using ESB for more the custom dungeon approach, a few thoughts emerged that would be really beneficial in ESB: 1) the ability to zoom the dungeon map more that 2x view (particularly with the high resolution display/desktop I use), 2) keyboard controls for zooming (say, + and - ), 3) an .ini setting with a default view zoom when ESB loads, and 4) if the cells could be higher resolution/pixel dimension, say 2x what they are currently.
Fully appreciating of course that this may all be lots of work and not ‘worth it’! But just putting it out there
elseif (arch.type == "WALLITEM") then
if (arch.class ~= "DECO") then
if (arch.class == "ALCOVE") then
return (52+dir), 5
else
return (32+dir), 3
end
else
return (48+dir), 4
end
elseif (arch.type == "WALLITEM") then
if (arch.class ~= "DECO") then
if (arch.class == "KEYHOLE") then
return (84+dir), 5
elseif (arch.class == "BUTTON") then
return (80+dir), 5
elseif (arch.class == "ALCOVE") then
return (52+dir), 5
else
return (32+dir), 3
end
else
return (48+dir), 4
end
and it means all the normally manipulable wall items are specifically shown.
Hi Kaypay, thank you! Just tried that in my ESB, very useful improvement, looks good.
Trying to figure out the coordinate system on the cells.pcx. Seems like the top row is exclude, and the two red boxes on the second line are 0 and 1. Stairs down is 2, doors start at 18, etc. Your new switches and keys icons start at 80 and 84 respectively (presumably adding a 'dir' value it seems for 0=south facing, 2/3/4 for west/north/east respectively?)
The second number is the draw priority. Higher numbers are drawn later, so they are shown on top of lower numbers. This makes sure that objects in ESB are shown in a coherent fashion regardless of their actual order on the tile; e.g., doorbuttons always drawn on top of doors.
So, an interesting thing about ESB that I had forgotten: 8 icons per row is hardcoded. This, combined with the fact that the icons are all square, mean that cells.pcx can be any size (or is a multiple of 8, anyway) you want. If you want bigger cells, you can double the size of cells.pcx, save the new image, and everything will just work.
Sophia wrote: Sun Feb 16, 2025 6:45 pm
So, an interesting thing about ESB that I had forgotten: 8 icons per row is hardcoded. This, combined with the fact that the icons are all square, mean that cells.pcx can be any size (or is a multiple of 8, anyway) you want. If you want bigger cells, you can double the size of cells.pcx, save the new image, and everything will just work.
WOW! That works brilliantly. Thank you so much! I just doubled the cells.pcx to two times the size..... result is automatic 2x zoom in ESB AND extra detail / resolution per icon tile. Brilliant stuff, Sophia.
Weirdly enough I had actually mentioned this many years ago and you were both in that thread! But I can't really blame you guys for forgetting since I didn't remember at first either.
Very minor point, but I noticed that once the cells.pcx is 2x size, and if you then go to double size view mode, when you place an object or wall item, the item is placed off centre to the tile, until you scroll the ESB viewport, which seems to redraw the view and the newly placed object position is then corrected and appears on the grid properly.