Page 4 of 15
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 3:36 am
by Sophia
Yes, the subrenderer size is hardcoded. There is a bunch of code, mostly related to the resurrection/reincarnation interface, that is expecting things to be a certain size, so the clickzones can go in a certain location. At some point, I'll go digging around and clean this all up, but don't hold your breath.
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 11:20 am
by Gambit37
OK, glad I checked, I was going to do something fancy with a larger one. I'll leave it well alone...!

Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 11:55 am
by Mon Ful Ir
Okay, I'm now officially intrigued to see what interface Gambit is in the process of cooking up.
At this rate we're not far short of being able to clone Eye of the Beholder with the DSB engine.
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 1:08 pm
by Gambit37
Don't expect any major changes. DSB core is still tied into rendering the DM interface, so anything
majorly different isn't really possible. (Currently anyway

)
Some elements can be customised quite well, such as the runes interface or the movement arrows, but stuff like the inventory screen and the portrait areas/stat bars are not fully editable yet as they are handled by the core -- well, as far as I can tell anyway.
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 4:40 pm
by Gambit37
Next question: is it possible to override a scroll's default subrenderer, and instead show a fullscreen renderer? I'd like larger scrolls with longer messages, those DM ones are so tiny!
Another question: I remember a test dungeon that had a subrenderer showing a poison bar with green markers -- anyone know where that is?
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 9:13 pm
by Sophia
Gambit37 wrote:Next question: is it possible to override a scroll's default subrenderer, and instead show a fullscreen renderer?
Yes, that's not that difficult.
You could give it an attack method that triggers a fullscreen renderer, or place it in the
on_look event, or both!
(EDIT: Wrong event name)
Gambit37 wrote:I remember a test dungeon that had a subrenderer showing a poison bar with green markers -- anyone know where that is?
That was the old
test_dungeon. I never bothered to port that over because it really was a terrible hack.
Since DSB gives you full control over the drawing of the food and water bar subrenderer now, if you want to do something like that, you're really better off just putting it all in that code.
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 9:26 pm
by Gambit37
OK. But I don't think I can pass exvars from the scroll arch to the full-screen renderer though?
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 10:54 pm
by Sophia
Well, no. But there are plenty of ways around that.
A temporary global variable will work well, I think.
(You are only going to be invoking one fullscreen renderer at a time, so it shouldn't create any real problems.)
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 11:27 pm
by Gambit37
Right, that makes sense. I'll give it a go, thanks
Last question for today: can DSB read external text files? I think for long strings of text (for a scroll) it may make more sense to store it externally for easier editing...
Re: Questions about DSB/ESB
Posted: Sun Jun 17, 2012 11:46 pm
by Sophia
No, but that doesn't mean you can't create something called
strings.lua that only contains your text strings.
Code: Select all
strings = {
my_scroll = "Some text! You can write a big long string if you want.",
another_scroll = "Another scroll. All the strings are here so it's easy to edit."
}
Then just set it up to use an entry in
strings rather than using an
exvar directly.
(i.e., instead of using
exvar[
id].
text, use
strings[
exvar[
id].
string], or whatever)
Re: Questions about DSB/ESB
Posted: Mon Jun 18, 2012 12:23 am
by Gambit37
Perfect!

Re: Questions about DSB/ESB
Posted: Sat Jun 30, 2012 2:33 pm
by Gambit37
In the wiki, there's a dsb_wakeup() but I can't find an associated dsb_sleep(). How do I send the party to sleep?
Re: Questions about DSB/ESB
Posted: Sat Jun 30, 2012 6:36 pm
by Sophia
Gambit37 wrote:How do I send the party to sleep?
You can't.
I honestly couldn't think of any time when this would be needed.

Re: Questions about DSB/ESB
Posted: Sat Jun 30, 2012 6:39 pm
by Gambit37
OK, let me phrase it another way

Is there a way of moving the zZZ button out of the inventory and into the main interface area, so it's always available?
Re: Questions about DSB/ESB
Posted: Sat Jun 30, 2012 6:45 pm
by Sophia
Gambit37 wrote:Is there a way of moving the zZZ button out of the inventory and into the main interface area, so it's always available?
Oh, I get it now.
Not at the moment. I'll look into this, too!
Re: Questions about DSB/ESB
Posted: Mon Jul 02, 2012 12:49 pm
by Gambit37
I'd like to create a creature that both walks and flies. But I'm not sure how to get it to swap 'modes' and bitmaps?
Re: Questions about DSB/ESB
Posted: Tue Jul 03, 2012 11:56 pm
by Mon Ful Ir
Create flying_creature and walking_creature as separate monsters and have triggers or attack modes that swap them?
Re: Questions about DSB/ESB
Posted: Wed Jul 04, 2012 4:54 am
by Sophia
That's how I'd do it, too.

Re: Questions about DSB/ESB
Posted: Wed Jul 04, 2012 8:06 am
by ian_scho
I'd appreciate it if you didn't swapped their HP values as well

Re: Questions about DSB/ESB
Posted: Wed Jul 04, 2012 10:33 am
by Gambit37
Looks like
dsb_qswap(id, new_arch) does what I need, and will preserve the HP. Nice

Re: Questions about DSB/ESB
Posted: Sat Jul 07, 2012 5:38 pm
by Gambit37
Is there a way of looping a monsters move sound? When I tried it, the sounds remained playing all over the map, even though the monsters were now dead (makes sense I guess). Basically, I'd like the sound to repeat while the monster is stationary, but then reset and start again when it moves. Think in terms of a bee buzzing... it doesn't only buzz when it moves from tile to tile, but continuously.
Re: Questions about DSB/ESB
Posted: Sat Jul 07, 2012 6:09 pm
by Sophia
Gambit37 wrote:Is there a way of looping a monsters move sound?
No, but I'll add this for the next version.
(It's complicated enough it's best integrated into the base code instead of something you patch in yourself)
Re: Questions about DSB/ESB
Posted: Sat Jul 07, 2012 6:19 pm
by Gambit37
Cool, thanks

I got my flying/walking creature working, it all works really well. So much better than RTC for this sort of thing

Re: Questions about DSB/ESB
Posted: Sat Jul 07, 2012 10:04 pm
by Gambit37
Is it possible to dynamically change the bitmaps/speed of animations used by an instance of a creature? I know I can do animations at the setup stage, but then all creatures animate in sync which looks un-natural when they are in groups.
Re: Questions about DSB/ESB
Posted: Sat Jul 07, 2012 11:45 pm
by Sophia
Ok, another one that is best handled as a feature request.
The current animation system is kind of a mess anyway. It'll be a lot cleaner internally in DSB 0.53.
(End users won't notice anything if I did it right)
Re: Questions about DSB/ESB
Posted: Sun Jul 08, 2012 12:19 am
by Gambit37
Sorry, I don't mean to keep adding to the list...!

Re: Questions about DSB/ESB
Posted: Mon Jul 09, 2012 6:48 pm
by Gambit37
How do I pass an array of gfx entries to
dsb_animate()? Seems like it won't accept an array as a passable parameter and that I have to write out the full list of frames? I'm trying to build an array like gfx.frame00, gfx.frame01, ... etc using a loop to avoid having to hard code names in my source.
When I pass an array, DSB crashes:
Code: Select all
PROGRAM CRASH!
Location: -5 0 0
Reason: Segmentation Fault
Stack Dump:
DSBmain
manifest_files
execute_stacktop_manifest
src_lua_file(dungeon/_lua/ui_title.lua)
src_lua_file.pcall
lua.dsb_animate
setup_animation
This is my code, it creates both a string and an array. Neither can be passed to dsb_animate without it crashing:
Code: Select all
snow_frames = ""
snow_array = {}
for i = 0,63 do
label = "snow"
if (i < 10) then label = label .. "0" end
label = label .. i
gfx[label] = dsb_get_bitmap(path .. label)
-- Create a string of frames
snow_frames = snow_frames .. "gfx." .. label
if (i < 63) then snow_frames = snow_frames .. "," end
-- Create an array of frames
snow_array[i] = "gfx." .. label
end
Re: Questions about DSB/ESB
Posted: Mon Jul 09, 2012 7:17 pm
by Sophia
You set it up wrong. I should probably figure out why this just goes ahead and tries to use the bad input and crashes rather than printing an error, but anyway, you're passing it an array of
strings when what you really want are graphics table entries:
Code: Select all
snow_array = {}
for i = 0,63 do
label = "snow"
if (i < 10) then label = label .. "0" end
label = label .. i
gfx[label] = dsb_get_bitmap(path .. label)
-- Create an array of frames
snow_array[i+1] = gfx[label]
end
gfx.animated_snow = dsb_animate(snow_array, 0, delay)
The 0 in the call to
dsb_animate is the number of frames parameter, which is not needed and ignored when you're passing a table.
Re: Questions about DSB/ESB
Posted: Mon Jul 09, 2012 7:46 pm
by Gambit37
Argh, right, that's me totally once again misunderstanding the difference between a string ("gfx." .. label) and the actual pointer to the graphics entry (gfx[label])
I *keep* doing that. Mostly I find it and fix it, but I just didn't spot it this time

Re: Questions about DSB/ESB
Posted: Fri Jul 13, 2012 12:36 pm
by Gambit37
Does an object's TYPE affect its rendering in the viewport in any way? For example, does setting to FLOORFLAT rather than FLOORUPRIGHT change the rendering order of items on a tile?
Similarly, does the CLASS affect rendering order?