Page 1 of 1

Posted: Tue Jan 09, 2007 4:28 pm
by ian_scho
Been looking at some Lua tutorials and it seems an interesting language to learn. It would seem that most of the other DM engines have a graphical interface with a makro/dsa 'thingy' attached to it too for those that wish to get their fingers burnt and really put some special functionality in their custom dungeon. Documentation would be the thing here, I suppose (Paul Stevens is CONSTANTLY referring people to his docs :P).

Posted: Thu Jan 11, 2007 11:45 pm
by Sophia
I've tried to get away from that approach (time will tell if this is a good or bad thing) and instead of having a "default" way and then a way to modify that, simply have the engine call Lua directly and let you do whatever you like.

This means some rather "core" features, such as opening/closing doors, stepping on triggers, and handling the display of chests and scrolls are left up to Lua. This could make things interesting... or confusing. :D

I have, of course, provided scripts that do things the basic DM way, but the sky's the limit, really... ;)

Posted: Fri Jan 12, 2007 12:01 am
by Paul Stevens
This could make things interesting... or confusing.
It will also give you the opportunity to do
a lot of debugging of other people's attempts
at cleverness.

Posted: Fri Jan 12, 2007 12:11 am
by Sophia
Oh goody. :roll:

Seriously, though, it shouldn't be so bad, as long as people are good enough to provide rather minimalist code fragments if the engine is going wrong, so we can be sure it's the engine going wrong, and not simply someone being too clever for their own good.

Programmers seem to have that problem sometimes. :lol:

Posted: Fri Jan 12, 2007 12:15 am
by Parallax
This is (at least) six kinds of awesome!
Sophia wrote:This means some rather "core" features, such as opening/closing doors, stepping on triggers, and handling the display of chests and scrolls are left up to Lua. This could make things interesting... or confusing.
My guess is 'interesting'. After all, if one is interested only in the default behavior of a particular feature, one can just leave it alone, right? I've only just started on the Lua tutorials so maybe I have the wrong idea, but it looks like it is going to make it fairly easy for people to implement whatever changes they want in the code. I was also wondering, and maybe it's a moot point with Lua, but is this an open source type of project?

Posted: Fri Jan 12, 2007 12:23 am
by beowuuf
Also notice if someone wanted to try to port a complex dungeon, they could certainly try with this

Posted: Fri Jan 12, 2007 12:42 am
by Sophia
Parallax wrote:After all, if one is interested only in the default behavior of a particular feature, one can just leave it alone, right?
Right. :)
Parallax wrote:I was also wondering, and maybe it's a moot point with Lua, but is this an open source type of project?
It's pretty much a moot point-- just about anything that you'd be interested in hacking around with will be part of the included Lua scripts, and distributed in source form.

Posted: Fri Jan 12, 2007 6:38 pm
by Parallax
Sophia wrote:It's pretty much a moot point-- just about anything that you'd be interested in hacking around with will be part of the included Lua scripts, and distributed in source form.
Cool. Having transparent and customizable mechanics means a lot.
Beowuuf wrote:Also notice if someone wanted to try to port a complex dungeon, they could certainly try with this
Hint hint? :wink:

Posted: Fri Jan 26, 2007 10:32 pm
by Trantor
I just realized that I haven't commented on this yet, so I'll do it now. First of all, it's cool to see you working on something new that seems to be customizable in the highest possible way. What I am wondering is how "technical" this will get for someone who doesn't know zilt about programming (IE: me). Will building a dungeon more or less result in direct programming? I just looked briefly over the tutorials linked by ian_scho, and while Lua seems to be quite an easy language to learn, I still wonder how designing will actually work. I suppose you can do practically anything you want to if you program it yourself, but what about dungeons that only use a few more or less complicated features that are possible in CSBWin or RTC?

Posted: Fri Jan 26, 2007 10:52 pm
by Sophia
It's not exactly programming, but kind of like the early days of RTC hacking, there's no GUI editor (as such) and you'll probably have to poke around in the text files. The text file is technically a Lua program, but I do provide most of the basic DM functionality, so it's not terribly complex. For example, here's how to make a door+button:

Code: Select all

dsb_spawn("doorframe", 0, 9, 3, CENTER)
targ = dsb_spawn("door_portcullis", 0, 9, 3, CENTER)
tmp = dsb_spawn("doorbutton", 0, 9, 3, CENTER)
exvar[tmp] = { target=targ }
What this means is: spawn a doorframe, spawn a portcullis (and store its id number in "targ"), spawn a doorbutton (and store its id number in "tmp"), and then set the target of the doorbutton (stored in tmp) to the door (stored in targ). The whole "exvar" thing simply refers to using an external variable, which is how DSB stores a lot of data not stored directly by the engine... hopefully this idiom will become familiar with use fairly quickly.

And hopefully it's not too awful. :)

Posted: Sat Jan 27, 2007 12:46 am
by Tom Hatfield
Two editor options:

ConTEXT (free, enables highlighting)

VSLua (not free, requires Visual Studio, full-blown IDE complete with IntelliSense)

Posted: Sat Jan 27, 2007 4:10 am
by Sophia
I use a Lua editor called, rather logically, LuaEdit.

It's free, not too fancy, but it's obviously quite optimized for Lua. :)

Posted: Fri Feb 16, 2007 1:17 pm
by Joramun
That's cool to see a new clone, and fully editable by the way :o !

I'll look into lua coding language. I learned it is also used by supreme commander so it will be one stone two hits :P

If it's not too soon, and lua is not too messy, I'll be glad to help you. (I'm a C++ user...)

Does this also means that :
1/ There can be a plugin system (using some additional pieces of code to get new things or not --> simple way of having "mutators" for the game) ?
2/ Anyone can specify his own way of coding a dungeon (like, diverse way to write maps for dungeons, to specify some functionalities...) ?
3/ Anyone can mess up with "core" things, like graphical engine, or (less deep but still core) game mechanics like party [more than 4 char / inventory etc.] / movement / spells / fight / monsters AI ?

:arrow: You'll need a whole forum and code sharing capabilities !

I suppose this also means it will be able to compile under linux, which would be a big progress :) at least for me, would-be Ubuntu user.

Posted: Sun Feb 18, 2007 12:34 pm
by DSE
Sophia/anyone - recommended lua editor to use ? thanks.

Posted: Mon Feb 19, 2007 3:56 am
by Sophia
Joramund wrote:1/ There can be a plugin system (using some additional pieces of code to get new things or not --> simple way of having "mutators" for the game) ?
I don't see why not, though are you saying they would be added by the player, not the dungeon designer? I'm not sure if this wouldn't make cheating too easy, and kind of defeat some of the uniqueness of each dungeon.
Joramund wrote:2/ Anyone can specify his own way of coding a dungeon (like, diverse way to write maps for dungeons, to specify some functionalities...) ?
Right. Dungeon.lua is not properly a dungeon itself, but rather, a program that when run generates a dungeon. This means it can do all sorts of things.
Joramund wrote:3/ Anyone can mess up with "core" things, like graphical engine, or (less deep but still core) game mechanics like party [more than 4 char / inventory etc.] / movement / spells / fight / monsters AI ?
Some aspects of the graphics engine can be messed with, others are hardcoded. I'll see about adding new functions if people find they want to be more creative, though. 4 party members is pretty solidly hardcoded, I don't see that changing ever. Movement, spells, fighting, and monster responses are all very flexible, though.
Joramund wrote:I suppose this also means it will be able to compile under linux, which would be a big progress :) at least for me, would-be Ubuntu user.
Hmm. The main libraries I'm using are cross-platform. The Windows API functions I'm using aren't, but they may not be that terribly hard to replace. I'll have to see how this one goes.
Tom Hatfield wrote:Crash report!
This one is the one I've been dreading. It happened to me once, in all my testing-- I was hoping it was cosmic rays. I can't reproduce it. I looked the code over and I don't know what might cause it.
DSE wrote:recommended lua editor to use ?
I use something called, rather fittingly, LuaEdit. Notepad will do in a pinch, but things like syntax highlighting spoil us pretty fast, don't they? ;) There were a couple of other editors mentioned earlier in the thread, but I've never tried them.

Posted: Mon Feb 19, 2007 8:21 am
by ian_scho
The LuaEdit official Website, designed for the version 5.0 of Lua, where the editor can be downloaded from here.

Posted: Mon Feb 19, 2007 11:29 am
by DSE
thanks guys.

Posted: Mon Feb 19, 2007 3:10 pm
by Joramun
Sophia wrote: I don't see why not, though are you saying they would be added by the player, not the dungeon designer? I'm not sure if this wouldn't make cheating too easy, and kind of defeat some of the uniqueness of each dungeon.
Yeah, I was thinking about the normal DM dungeon, and things like modify mechanics. This means releasing a "modular" code for the DM dungeon.
Of course you need something cheat-proof for custom dungeons :) like some sort of compiled version.
Some aspects of the graphics engine can be messed with, others are hardcoded. I'll see about adding new functions if people find they want to be more creative, though.
Great... Well for now, I suppose getting a working dungeon is already a time-consuming goal :P
Hmm. The main libraries I'm using are cross-platform. The Windows API functions I'm using aren't, but they may not be that terribly hard to replace. I'll have to see how this one goes.
Didn't thought of those damn' libraries... Well, there're always emulators...