Page 14 of 15

Re: Questions about DSB/ESB

Posted: Tue Dec 14, 2021 8:45 pm
by Sophia
Unfortunately it seems like it was not.

Re: Questions about DSB/ESB

Posted: Wed Dec 15, 2021 11:01 am
by Gambit37
OK, no worries.

Re: Questions about DSB/ESB

Posted: Wed Dec 15, 2021 5:32 pm
by Gambit37
Upon further consideration, might I request the addition of two new functions: dsb_sleep() and dsb_save() which would invoke the standard sleep function and save game system dialog respectively.

Enabling these two missing functions would allow for truly flexible and non-DM type interfaces in DSB. It's very restrictive only being able to use these functions through buttons that only show up within the inventory. I appreciate you might have all but abandoned DSB by now, but I'm still plugging away at a long term project using it and these functions would really, really help... pretty please? :D

Re: Questions about DSB/ESB

Posted: Fri Dec 17, 2021 2:16 am
by Sophia
I wouldn't necessarily say "abandoned" but I'll certainly admit that I haven't been able to work on DSB lately.

After the new year I should be able to get back to DSB and I can (finally) get a new version out.

Re: Questions about DSB/ESB

Posted: Fri Dec 17, 2021 4:44 pm
by Gambit37
Oh my, I hope I didn't come across as demanding, I totally get that hobby projects are low priority with the state of the world as it is. I hope you understand that I only add these requests here to get them out of my head and I have no expectations for any kind of timely response. I hope you're doing OK, my sincere apologies if I was insensitive.

Re: Questions about DSB/ESB

Posted: Wed Jan 12, 2022 5:06 pm
by Gambit37
To slow a monster's movement, which property should be changed? I've tried fiddling with act_rate, quick_act_rate and quickness of a rockpile, to no avail -- it still seems to move between tiles far too quickly?

Re: Questions about DSB/ESB

Posted: Thu Jan 13, 2022 12:50 pm
by kaypy
What do you get if you set both act_rate *and* quick_act_rate high? I got a rockpile close to immobile...

As near as I can tell, with the base values a rockpile should be really slow, but if you hit it, then it will use the quick_act_rate which is >10x faster to try to counterattack, and can chase you at that rate for a fair while before it gives up.

Re: Questions about DSB/ESB

Posted: Thu Jan 13, 2022 11:10 pm
by Gambit37
Ah right, thanks that explains it -- yes it definitely moves a lot faster after I've hit it!

Re: Questions about DSB/ESB

Posted: Fri Jan 14, 2022 2:27 am
by Sophia
Just to clarify how all these numbers fit together, for normal monster movement, its act_rate is the number of ticks in between turns. When it has attacked, the attack_delay is also applied. This slows down wasps and the like (early versions of DSB didn't have this, and you got stung to death quite easily!) but it is a large negative number for slow monsters like rock piles, so they get another turn very soon after they attack. The quick_act_rate is applied if the party is standing next to the monster. For rock piles, this means they'll be quite slow unless you're standing next to them or they're attacking. This is all done the same way DM does it as best as I understand how DM works.

(For completeness, quickness is used in the melee combat calculations and doesn't figure in here at all)

Re: Questions about DSB/ESB

Posted: Tue Jan 18, 2022 12:24 am
by Gambit37
This is great, thanks for explaining, makes much more sense now! :)

Another quick question: When using the Magic Map, if you cast a map spell on it, it vanishes very briefly and you can see the default food/water subrenderer instead before the map re-displays with the rune highlighted for the map spell just cast. I know you don't maintain the magic map code, but I was wondering if you might have any insight into why this happens?

Re: Questions about DSB/ESB

Posted: Wed Jan 19, 2022 10:52 pm
by Sophia
Right, I don't maintain the magic map code, so I really have no idea about how it works.

Re: Questions about DSB/ESB

Posted: Thu Jan 20, 2022 11:38 am
by Gambit37
OK, no worries, I think I know what the problem is, hopefully it's a simple fix.

Also, I just checked the start date of this thread -- over 11 years ago. :o :shock:

Re: Questions about DSB/ESB

Posted: Sat Jan 22, 2022 11:49 pm
by Gambit37
Would a function such as dsb_version() be possible? This could be used to warn players about mismatches between their version of DSB and the version required to play a particular custom dungeon. (This request is born out of re-reading the Surgical Strike thread where it required 0.37 of RTC but players were using 0.49 and getting issues...)

Re: Questions about DSB/ESB

Posted: Tue Jan 25, 2022 11:16 pm
by Sophia
I could add this, but I don't really like the idea of version-locking a dungeon to a particular version of DSB. I try to maintain backward compatibility and I think I've done pretty well since about 0.60 or so. Being realistic about it, given my rather slow pace of DSB innovation, the biggest changes to DSB going forward are probably just going to be bug fixes. If a dungeon demands a certain version of DSB then players using future versions will miss out on the fixes.

Re: Questions about DSB/ESB

Posted: Wed Jan 26, 2022 12:37 am
by Gambit37
OK, that makes sense. I was thinking more along the lines of recent new features not working. If I use a new feature from 0.79 for example, and a player runs the dungeon in 0.78, won't DSB crash the moment that new feature is invoked? So it's not about version locking as such, it's just a check to make sure the player has the minimum version of the engine required to play that dungeon. It seems more polite to test that in the dungeon code and warn about it, rather than just crashing.

Re: Questions about DSB/ESB

Posted: Wed Jan 26, 2022 1:32 am
by Sophia
If the dungeon is compiled, DSB will refuse to load a dungeon compiled with a newer version.

Re: Questions about DSB/ESB

Posted: Wed Jan 26, 2022 1:39 am
by Gambit37
Ah right, perfect then! :D

Re: Questions about DSB/ESB

Posted: Wed Jan 26, 2022 10:47 pm
by Gambit37
Is there a way of changing the mouse cursor on demand? Some kind of dsb_mouse_bitmap()? I was certain something like this existed but can't find anything on the wiki?

Also, is there a way of forcing an animated bitmap to re-start at frame 0 before it's displayed? At the moment, animation timers seem to continue running even when the animation isn't displayed which messes up some effects I'm trying to achieve.

Re: Questions about DSB/ESB

Posted: Mon Jan 31, 2022 7:41 pm
by Sophia
It does already exist. It's dsb_mouse_override(bmp), and takes the image you want to use. Pass it nil or false to remove the override image.

Where is the animation? If the animated bitmap is associated with an inst, you can use dsb_set_animtimer(inst, timer_val) to reset the timer to 0. Other animations (like for the gui) use a global frame counter.

Re: Questions about DSB/ESB

Posted: Tue Feb 01, 2022 12:09 am
by Gambit37
Sophia wrote: Mon Jan 31, 2022 7:41 pm It does already exist. It's dsb_mouse_override(bmp), and takes the image you want to use. Pass it nil or false to remove the override image.
Ah fabulous, thanks. I'll add it to the wiki.
Sophia wrote: Mon Jan 31, 2022 7:41 pmWhere is the animation? If the animated bitmap is associated with an inst, you can use dsb_set_animtimer(inst, timer_val) to reset the timer to 0. Other animations (like for the gui) use a global frame counter.
OK, yeah that's a problem, I'm doing some animated stuff in the UI. It's for a fading/flashing effect which completely breaks with a global counter. Ideally there would be a way of resetting the start frame of any animation just before it's displayed.

Re: Questions about DSB/ESB

Posted: Tue Feb 01, 2022 12:29 am
by Sophia
How many bitmaps are there?

Giving each bitmap its own frame counter would be sort of a mess, which is why I currently use a global frame counter for things not associated with an object inst. However, as long as you only have a few different instances, or they're going to be synchronized, I could just add a few more global frame counters and let you choose which one you want to use, and reset it to 0.

Altenatively, I could let you associate an object in the dungeon with a bitmap and take its frame counter from there, but that is a little hacky.

Re: Questions about DSB/ESB

Posted: Tue Feb 01, 2022 1:06 am
by Gambit37
Only 4 bitmaps in my test sequence which goes 1-2-3-4-3-2. It's a bit clunky so I might need to increase that to smooth it out a bit. The anim needs to start at frame 1 each time it's displayed, otherwise it looks broken.

Re: Questions about DSB/ESB

Posted: Tue Feb 01, 2022 9:28 pm
by Sophia
Oh, I meant, how many animated bitmaps are you using? In other words, how many independent frame counters do you need?

Re: Questions about DSB/ESB

Posted: Wed Feb 02, 2022 7:55 am
by Gambit37
Oh right! Just one for now, but maybe a couple more. Let's say 5 to be safe. Is that possible?

Re: Questions about DSB/ESB

Posted: Wed Feb 02, 2022 8:46 pm
by Sophia
Quite doable! I'll make it 16 because that's a nice round number and there's plenty of room.

So, DSB 0.80 will no longer have just one but 16 global frame counters. By default every animation will use counter 0 but you'll be able to use the command dsb_bitmap_animtimer(bmp, num) to specify which one to use, and use the already existing dsb_set_animtimer with these new global counters.

If you then set the animated bitmap to use the proper frame counter and set its value to 0 when you first enable your UI element, your animation will always start at the beginning. (Don't set it to 0 when you draw it or you'll set the count to 0 every frame and your bitmap won't seem to animate at all!)

Re: Questions about DSB/ESB

Posted: Wed Feb 02, 2022 11:28 pm
by Gambit37
Wow, that sounds perfect, thank you very much!

Another quick one: If I'm building a game that doesn't use any DM stuff at all, and I want to start from scratch, can I simply redefine the obj and gfx tables from scratch? Ideally I'd like ESB to only show my new stuff, presumably a redefined obj would enable that? (Plus copying the required triggers/mechanics over).

Re: Questions about DSB/ESB

Posted: Fri Feb 04, 2022 3:38 am
by Sophia
It might work, though I will say it's not a "supported" configuration. I know there are some references to default stuff buried in the base code, so you'll probably have to copy some objects over, but I don't know for sure exactly which ones.

Re: Questions about DSB/ESB

Posted: Sat Feb 05, 2022 12:00 pm
by Gambit37
Cool, I'll try it out and see what happens!

Another question: is there a way of stopping right-click from opening the inventory by default? It would be cool to use right-click to offer alternate actions on the combat buttons, but right now the "open inventory" function always wins.

Re: Questions about DSB/ESB

Posted: Sun Feb 06, 2022 9:58 pm
by Sophia
What the mouse buttons do is pretty hardcoded at the moment. However, for your specific example, DSB internally supports displaying 16 attack methods per weapon, so if you wanted more than 3, it's just a UI thing.

Re: Questions about DSB/ESB

Posted: Sun Feb 06, 2022 10:55 pm
by Gambit37
16! Wow :) I was thinking more along the lines of Grimrock: left click to take the item out of the hand, right click to use it. But I understand that's a big change, and as I don't have an actual use case anyway, don't worry.

Last question for now: You previously added a setting to the gui_info for the resurrect subrenderer: act_like_subrenderer = true. I'm finally getting around to redoing this subrenderer and have no idea what this setting does? Does this enable the ability to code up a whole new subrenderer -- if so, is there a hook for that?