Questions about DSB/ESB

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.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

No, it tells the resurrection/reincarnation interface to use the screen positioning for a subrenderer rather than absolute positions like everything else in gui_info. Note the offsets are 6,0. So without act_like_subrenderer being set to true, the resurrection/reincarnation interface will be drawn way up in the upper left corner of the screen. This is something you asked for, actually, earlier in this thread.

Unfortunately, the actual code to draw the resurrection/reincarnation interface is still more or less hardcoded in C and it's not the kind of thing that would be easy for me to change.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Ah yes, I remember now that we discussed this before. Time flies eh? Thank you, I recall now what I was going to do for this, although give my time pressures these days I'll probably just reskin it.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

FYI, I've just updated the DSB Versions thread to include everything from 0.55 - 0.79, as it was very out of date.

That thread makes it clear how amazing you've been Sophia for continuing to support and maintain DSB for such a long time. I'm seriously impressed with everything you've achieved with DSB. It is an *amazing* engine and creative tool, and I'm determined to finish my project(s) so that others can see what it's capable of -- however long it takes! Thank you so much for continuing to support DSB, it's my happy hobby place. 😍
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

I noticed an addition in an earlier version, a mention of sys_tick_second(). I'm curious what this is for / how it might be used? Can it be used to create real-world timers -- for example, "You have five minutes to do X." ??? If so, how would I go about that?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

It ticks once per second. That's all it does. :)

It both is and isn't "real world." It will tick consistently every second, regardless of whether the party is moving around, unlike something based on movement ticks, which would go faster when the party is moving, of course. However, it does not tick when the game is frozen or anything like that.

If you want to give five actual minutes to do a task, just set a variable to 300 and decrement it in your implementation sys_tick_second. When it hits 0 your time is up.

Also, thanks for keeping the version thread updated. I'm glad you've enjoyed DSB over the years. It's sort of cool to see how far it has come. :mrgreen:
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

A bit random, but would you consider changing the startup screen to render it's text on black, rather than blue? It would make much more sense now that everyone has widescreens with black bars on the left and right of the DSB 4:3 display. The current blue screen startup looks odd when the custom game then follows with a title sequence that fades in from black (as mine does).

Better still, someway of customising this would be great, although I imagine that's not possible with the way the startup sequence works? If it were possible to customise the background and foreground colours of the startup output, that would be amazing (but I understand if not possible).

Also, another thought, would it ever be possible to modify DSB to use a dungeon viewport bigger than 448x272 within the 640x480 screen? I guess so much of how DSB works is tied into that, that it would be impossible, or a major rewrite?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Changing the size of the viewport would be a major rewrite, so it would probably be best to tie that into some hypothetical future reworking of DSB that adds support for higher resolutions and modern graphics cards... which is unfortunately not something I'll be able to do any time soon, if ever.

Changing the background color, or at least letting the designer specify it, is quite a bit easier. I'll probably be able to do something with that.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Cool, thanks for the quick reply.
User avatar
baikin
Neophyte
Posts: 3
Joined: Tue May 12, 2020 3:45 pm
Contact:

Re: Questions about DSB/ESB

Post by baikin »

hi Sophia!
I am having fun playing DSB.
I respect the amount of effort you put into it.

well, I know it's a simple question, but I hope you'll forgive me for not having studied enough.

For some reason I can't seem to do File I/O.
I have the following code in my program:

Code: Select all

local file = io.open("aiueo.tbl")
When I run the DSB I get the error
FATAL LUA ERROR
C:\work\csb/prison.lua:3: attempt to index global 'io' (a nil value)
I really want to read an external file, is there a way?
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

DSB doesn't implement Lua's file functions so you can't do that unfortunately.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

It isn't possible to open arbitrary external files in DSB because I thought it was too much of a security risk.

What are you trying to do? Would it be possible to format your external data as a Lua table and run it as Lua code?
User avatar
baikin
Neophyte
Posts: 3
Joined: Tue May 12, 2020 3:45 pm
Contact:

Re: Questions about DSB/ESB

Post by baikin »

omg! I get it now.
Thanks Gambit & Sophia.

Trouble getting DSB to Display Japanese Characters(Shift-JIS).
I needed to read a table to convert from UTF8 to Shift-JIS, so I used I/O input.
There was no problem with Lua, but an error occurred with DSB.

After asking the question, I found a page about fonts on the Dungeon master Wiki.
I think it is very difficult to display the Japanese fonts of the SNES version. I have no idea.

I've just started working on custom dungeons, but it seems like I still need to learn more.
Anyway, thank you very much.
thank you.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Yeah, unfortunately, the situation isn't great. It's quite difficult for DSB to display Japanese characters. Since I use DM's font, there are no kana or kanji provided. And, as you know, even if DSB had a font with Japanese characters, DSB has a really hard time with Unicode. When designing DSB, I really only planned around English. Other languages with the Roman alphabet could probably be used, but Japanese would be difficult without a lot of code.

日本語も話せるんです。とにかく大変ですね。DSBには残念ながら日本語の文字の表示は難しいです。DMのフォントを使うからかなや漢字がないです。そして、ご存知の通りDSBのフォントで日本語の文字があってもユニコードが苦手です。DSBのデサインの時には英語しか計画しませんでした。他のローマ字の言語が使用できるでしょうが日本語の書くのはたくさんのコードをせずに難しいです。
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote: Mon Jan 30, 2023 6:24 pm Better still, someway of customising this would be great, although I imagine that's not possible with the way the startup sequence works? If it were possible to customise the background and foreground colours of the startup output, that would be amazing (but I understand if not possible).
This is now doable. It can't use Lua, because the Lua interpreter hasn't been initialized yet, but there is a new setup.ini that contains the color options. The test dungeon includes an example.
Post Reply