Fun DSB fact...
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

Fun DSB fact...
In case anyone is keeping score, as of DSB .22 the base scripts define some 400 global functions (including dsb_*s - okay, so those aren't defined in the base, but I include them anyway; if you're wondering, they are about a third of that total), 60 or so global tables, and about 140 constants and assigned values.
Further, those 400 functions define 1039 arguments, so they average about 2.5 each. dsb_make_wallset has the most, at 20.
I'm not trying to make a point or anything, just illustrating how big DSB really is.
Further, those 400 functions define 1039 arguments, so they average about 2.5 each. dsb_make_wallset has the most, at 20.
I'm not trying to make a point or anything, just illustrating how big DSB really is.
All dsb_ functions are already documented here.
And exvars too...
True, I (or anyone) could start a project to fully comment DSB's lua code.
But exploring the code is also a good way to learn LUA and DSB at the same time.
I suggest using SCITE (scite is a greatly upgraded notepad with syntax highlighting for many languages)
Starting with : test_dungeon/ dungeon.lua, objects.lua, startup.lua
then : base/global.lua, startup.lua, graphics.lua, objects.lua
then the others, looking for the functions used in objects.lua (mainly in triggers.lua, util.lua, msg_handlers.lua ...)
And exvars too...
True, I (or anyone) could start a project to fully comment DSB's lua code.
But exploring the code is also a good way to learn LUA and DSB at the same time.
I suggest using SCITE (scite is a greatly upgraded notepad with syntax highlighting for many languages)
Starting with : test_dungeon/ dungeon.lua, objects.lua, startup.lua
then : base/global.lua, startup.lua, graphics.lua, objects.lua
then the others, looking for the functions used in objects.lua (mainly in triggers.lua, util.lua, msg_handlers.lua ...)
What Is Your Quest ?
My d has gone down a pit.
Ok, it seems it is bothering a lot of people.
A small tale :
My name is taken from a book, which I happen to have re-read a few weeks ago.
And I could verify the real character's name is "Joramun" not Joramund.
Hence the 'd' was simply an error. But since it seems so much people miss it, maybe I'll put it back.
But not just yet, I want to try without it a bit more, it feels lighter
Ok, it seems it is bothering a lot of people.

A small tale :

My name is taken from a book, which I happen to have re-read a few weeks ago.

And I could verify the real character's name is "Joramun" not Joramund.

Hence the 'd' was simply an error. But since it seems so much people miss it, maybe I'll put it back.

But not just yet, I want to try without it a bit more, it feels lighter

What Is Your Quest ?
Can I just first say, I dislike this use of the acronym "API". Yes, I know that that makes me stuffy and dated, but a webpage cannot act as a programming interface unless you use a hefty web-scraper to poll the data. Otherwise, it's just documentation.Now pop this info in a wiki, documenting each function along the way, creating an über dsb-api.
Secondly, you don't really believe I collected that data for nothing, do you? Obviously, I intend to do something with it.
Here's a couple of screens of a proof-of-concept test I did:
Code Completion
Intellisense
Now, obviously these are just basic tests - it's a long way from actually being anything productive.
- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:

As for the documentation, there's already a fair bit of it... the core code that already exists is set up to make dungeons of the variety that we're all used to fairly easy to produce. So I'd say the best thing if you're trying to learn is to just dive in and start making something, and when you get an idea for strange mechanics that can't be done in default DM, find something close, see how that works, and make your own with slightly modified code.
Lua is actually a pretty easy language to learn.

Yeah well I was joking, just a little bit. From what little I've seen of the code you provide helpful comments along the way - most unusual for a software developer!
The intellisense thing can make things much easier, that's for sure. We could use notepad to write these files, but to have it colour formatted with prompts certainly helps. I have the Java api/documentation open most of the time at work, which is why I chirped up with the comment in the first place. Sophia's copy and paste and modify idea is how I learnt to code anyways

The intellisense thing can make things much easier, that's for sure. We could use notepad to write these files, but to have it colour formatted with prompts certainly helps. I have the Java api/documentation open most of the time at work, which is why I chirped up with the comment in the first place. Sophia's copy and paste and modify idea is how I learnt to code anyways

I actually did alot of this the past few days, using a little utility I made, testing Lua integration. It's not overly complicated or all that useful, but it does give easy access to the functions in DSB's base files.Sophia's copy and paste and modify idea is how I learnt to code anyways
Screenshot
Basically, it uses a Lua script to pick out the functions in the base files (I've included those from DSB v.22, but you can swap them out -- check 'config.lua' for details) and puts them in a set of tables. The table is then parsed to an expandable treeview. Clicking on a function displays it's name, arguements, and the source-code so you can copy/paste it.
If you want it, you can download it here.
There's also a file for dsb_* functions, but it's not all that useful or complete.