DSB tints and other pointless questions.

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
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

DSB tints and other pointless questions.

Post by Joramun »

Spoiler
(it's tints, not t*ts in the title)
First question:
I know it is possible, as demonstrated in the test_dungeon, to tint monsters with a color. I'm not sure it's making any sense, but here is my question:
Is it possible to do so with a transparency degree? (ie overlay the whole monster visible pixels with a 40% transparent green e.g.)

Second question:
To stay on a graphical theme, are there hidden base drawing functions, for example to draw a circle, disk, rectangle, pixel on screen ?
Not that i'm thinking about spreading particles everywhere or anything like that :wink:

Third question, more or less related to the first two: is it possible to make a color operation / color overlay / whatever, to have something in the same vein as the CONFLUX "Infrared vision" spell ? (which is "easy" in CSBWin because it uses DM colortab switching on a small colortab)
What Is Your Quest ?
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: DSB tints and other pointless questions.

Post by Sophia »

Joramun wrote:Is it possible to do so with a transparency degree? (ie overlay the whole monster visible pixels with a 40% transparent green e.g.)
I'm not sure if I totally understand, but what I think you're referring to is that right now, when you tint a monster, it's a constant and pretty strong value, which you might not always want. If that's what you mean, it currently isn't possible to change that, but it wouldn't be difficult to add an optional additional parameter to dsb_set_tint that lets you choose this value.
Joramun wrote:To stay on a graphical theme, are there hidden base drawing functions, for example to draw a circle, disk, rectangle, pixel on screen ?
It's not 'hidden', but the only primitive directly supported by DSB is a rectangle, with the command dsb_bitmap_rect(bitmap, x1, y1, x2, y2, color, solidity). So for example, to draw a solid power pink rectangle from (0, 0) to (20, 20) on the bitmap bmp you'd do:

Code: Select all

dsb_bitmap_rect(bmp, 0, 0, 20, 20, { 255, 0, 255 }, true)
Again, if you need other basic drawing commands, they won't be that difficult to implement. You can also use dsb_bitmap_draw(src_bitmap, dest_bitmap, x, y, flip) to just directly draw one bitmap onto another.
Joramun wrote:Third question, more or less related to the first two: is it possible to make a color operation / color overlay / whatever, to have something in the same vein as the CONFLUX "Infrared vision" spell ?
I actually don't know how the Conflux spell works, so maybe I'm not thinking of it correctly, but it is not a problem to create CSBwin-style graphical overlays in DSB. You just create them (in one of your files invoked by startup.lua or wherever) as party conditions with a bitmap and no function or timer:

Code: Select all

C_OVERLAY = dsb_add_condition(PARTY, nil, bitmap, 0, nil) 
You can then toggle it on and off, by specifying 0 for off and 1 for on, with:

Code: Select all

dsb_set_condition(PARTY, C_OVERLAY, value)
User avatar
Trantor
Duke of Banville
Posts: 2467
Joined: Wed Mar 09, 2005 4:16 am
Location: Berlin, Germany
Contact:

Re: DSB tints and other pointless questions.

Post by Trantor »

Sorry for spamming, but this together with the "go deep!" comment makes me wonder if I have found a fan or caused serious brain damage to Joramun... :shock:
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: DSB tints and other pointless questions.

Post by Joramun »

Totally a fan. But I can't say my brain isn't damaged, either.
What Is Your Quest ?
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: DSB tints and other pointless questions.

Post by Joramun »

Sophia wrote:I actually don't know how the Conflux spell works
It replaces the normal color palette with a new one with funny colors.
What Is Your Quest ?
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: DSB tints and other pointless questions.

Post by Sophia »

Joramun wrote:It replaces the normal color palette with a new one with funny colors.
Oh. DSB doesn't use a palette, so I'm not sure how to duplicate this. Obviously there is the capacity for some post-processing of the image (tinting it black when the light level is low, for example) but there would need to be some more specific idea of just what kinds of things we wanted to do. :)
Post Reply