Door frames and alcoves... And a rambling.

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Door frames and alcoves... And a rambling.

Post by ian_scho »

Door Fames

Ermmm. I'm unfamiliar with RTC or CSBWin, so would one of their door frame images 'fit' DSB. I assume not. If you could share the original dungeon image files that you (Sophia) have, for example, I could work off those.

Alcoves

It's a similar story for alcoves, yet Sophia's example double alcove present in 'test_dungeon' shows me how relatively simple the images can be - albeit with having to define click zones etc.

Rambling

I just found the dsb_alt_wallset function and it's quite cool indeed. Seems more 'powerful' than say in DMJava where you were constrained to one wallset per level, and you'd have to do a 'transition' tile such as in DMII.

Can I ask how you'd do a 'pillar', for example? It'd be a bitmap which was effectively a wall tile. Creating a few trees, for example... A wall decoration without the wall! A non-passable floor decoration.

The wallset I have from WHACK uses dsb_make_wallset and not dsb_make_wallset_ext, correct? It's just that I've been reading the documentation again :?
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

ian_scho wrote:I'm unfamiliar with RTC or CSBWin, so would one of their door frame images 'fit' DSB. I assume not.
DSB doorframes are very similar to RTC doorframes. You can use the front images of an RTC doorframe unmodified in DSB as long as you set the offsets properly, and only small modification would be required otherwise. The side bitmaps are a bit more different, but a bit of simple cutting and pasting should still produce the right result fairly quickly.

The alcoves, on the other hand, are pretty much identical to a double-resolution version of a CSBwin alcove. The image is a bit larger than it needs to be, and I had to cut it down to get the clickzones on the double alcove a reasonable size.

If you PM me your email address, I'll send you the bitmaps. You can also rip them yourself out of graphics.dat if you don't mind using the Allegro grabber...
ian_scho wrote:Can I ask how you'd do a 'pillar', for example?
DSB does have a class of flooritems called "FLOORUPRIGHT" that is used for flooritems that don't lie flat. In the base objects.lua, it's used only for stairs and doorbuttons, but something like a pillar should be pretty easy.

If you want to use dsb_alt_wallset, though, the basic syntax is dsb_alt_wallset(level, x, y, dir), where the "direction" is the face of the wall you want to apply the alt wallset to (NORTH, EAST, etc.), or set CENTER if you want to apply it to all four faces, or apply an alternate floor/ceiling for an open tile.
ian_scho wrote:The wallset I have from WHACK uses dsb_make_wallset and not dsb_make_wallset_ext, correct?
No, WHACK-generated wallsets are all ext wallsets, because they have a "left" or "side" or whatever you want to call it bitmap (the RTC way) rather than grabbing all three views from a single long bitmap (the CSBwin way). Look in dsb_out.txt, generated by WHACK, for the Lua code you can paste right into your dungeon.
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Post by ian_scho »

Thanks for PM'ing the images, Sophia.

Door Frames

I did it! Alrighty, not fantastic, but not too shoddy for a graphics dweeb like me. I can see many improvements are required in my case, but I'm happy with my work. I need to change especially... Door runner view (doorframe_0.pcx), and I've applied too much darkness to the farther views. Also I have a push button on the door with a stone background but...

Code: Select all

Door inside view, you see the runner here.
doorframe_0.pcx -> 06X246 pixels
Door front view Closest
doorframe_1.pcx -> 276X188 pixels.
Door front view 1sq. back
doorframe_2.pcx -> doorframe_1.pcx scled from 276X188 down to 204X130 pixels.  Reduced darkness 25% (too much)
Door front view furthest, 2sq. back
doorframe_3.pcx -> doorframe_1.pcx scled from 276X188 down to 140X088 pixels.  Reduced darkness 50% (too much)
WHERE is this No 1?
doorframe_side_1.pcx -> 256X8 pixels
WHERE is this No 2?
doorframe_side_2.pcx -> doorframe_side_1.pcx scaled down to 192X6 pixels.  Pixelate or darken (15%) it a bit?
Back a bit, step left or right a bit!
doorframe_side_3.pcx -> 64X86 Need to darken the texture.
I used an image from one of Kelly's wallsets he made for DMJava. Image shack has 'reduced' the quality of the image (animated gif), but you can see it clearly enough.

Image

Thanks for introducing me to this http://www.allegro.cc/depot/Grabber/ as it has prevented me from asking a few more obvious questions (to you, not me!).

Now for some LUA code, in case it helps someone else...

Code: Select all

-- [b]dungeon.lua[/b]
-- A door
tmp = spawn_door(1, 7, 6, "door_wood", true, "doorframe_wood")

--[b]startup.lua[/b]
-- Doorframe, wooden.  Import images
gfx.ws_03_doorframe_0 = dsb_get_bitmap("ws_03_doorframe_0")
gfx.ws_03_doorframe_1 = dsb_get_bitmap("ws_03_doorframe_1")
gfx.ws_03_doorframe_2 = dsb_get_bitmap("ws_03_doorframe_2")
gfx.ws_03_doorframe_3 = dsb_get_bitmap("ws_03_doorframe_3")
gfx.ws_03_doorframe_side_1 = dsb_get_bitmap("ws_03_doorframe_side_1")
gfx.ws_03_doorframe_side_2 = dsb_get_bitmap("ws_03_doorframe_side_2")
gfx.ws_03_doorframe_side_3 = dsb_get_bitmap("ws_03_doorframe_side_3")
gfx.ws_03_doorframe_0.y_off = -26

--[b]objects.lua[/b]
-- Doorframe, wooden.  The entity.
obj.doorframe_wood = {
	type="FLOORUPRIGHT",
	renderer_hack="DOORFRAME",
	class="DOORFRAME",
	col=doorframe_col,
	same_square=gfx.ws_03_doorframe_0,	--gfx.doorframe_front[0],
	front=gfx.ws_03_doorframe_1, 		--gfx.doorframe_front[1], 
	front_med=gfx.ws_03_doorframe_2, 	--gfx.doorframe_front[2],
	front_far=gfx.ws_03_doorframe_3, 	--gfx.doorframe_front[3],
	side=gfx.ws_03_doorframe_side_1,	--gfx.doorframe_side[1],
	side_med=gfx.ws_03_doorframe_side_2, --gfx.doorframe_side[2],
	side_far=gfx.ws_03_doorframe_side_3 --gfx.doorframe_side[3]
}
Time for a beer.
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Post by ian_scho »

Just updated the above code to include an offset that I missed.
Post Reply