Looking for some tricks and scripts to make gameplay easier

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.
Zaidyer
Novice
Posts: 11
Joined: Tue May 01, 2012 6:14 pm

Looking for some tricks and scripts to make gameplay easier

Post by Zaidyer »

I've been looking around a bit, and I think DSB is the most flexible engine for building a custom Dungeon Master adventure, isn't it? At least I don't see any way to implement some of these features in RTC...

What I want to do is use it to build a game closer to the style of Lands of Lore, which is one of my all-time favorite games in this genre, second to Stonekeep. LoL wasn't as big a leap away from DM as Stonekeep was, so it should be fairly easy to reach with just a few tweaks and additions.

There's a few things I'd like to do to with scripts that so far have been talked about, but never shown:
  • a full-screen automap. In LoL, this was accessible from a dedicated gui button, in Stonekeep you could bring it up with the Tab key. In my opinion this is the most important feature ever introduced by DM imitators. There seems to be a thread here about an automap script having been written, but it was never posted.
  • No Death, only "KO" status. Curable only by HP-restoring items or magic. Mostly for plot convenience, and to save the player the busywork of lugging the body around and picking up every single inventory item off the ground.
  • Single-purpose weapons. You click it, it does its thing immediately, no menu choices to make. If that's too difficult, I'd at least like to bind some hotkeys to reduce repetitive mouse motions and clicks.
  • This one is a little bit more out there, but it'd be nice to try... fake "smooth movement". LoL did this by zooming or panning the viewport between each step. It has no actual effect on the gameplay or the timer, it just a pretty little visual trick that in some cases makes it easier to see where you're going.
  • Some kind of graphical indication in the viewport that a monster is taking damage.
I have some higher ambitions, but frankly I'm more interested in working with a simple baseline and going from there. If nothing else I'd like that automap!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Looking for some tricks and scripts to make gameplay eas

Post by beowuuf »

Have you played Legend of Grimrock yet? It has those five features! No idea how long the editor will take for it, but it is now in development.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

I'll chime in with my thoughts on each point.
Zaidyer wrote:a full-screen automap
I have a copy of the automap, but I'm not sure if Parallax would approve of it being distributed.
DSB includes quite a few ways to query your surroundings (and the engine keeps track of whether a square is visited) so an automap isn't terribly hard to implement, truthfully. It's more the tedium of making sure that it renders properly.
Zaidyer wrote:No Death, only "KO" status.
By writing a new version of sys_character_die that doesn't drop items and bones (and probably changing the upper graphic to something less morbid than a skull) it'd be pretty easy to make this change. Of course, at that point, DSB would disable the ability to feed the character items or potions, so that part would have to be changed separately.
Zaidyer wrote:Single-purpose weapons
An object archetype's methods property can, itself, be a function. This is intended to allow it to have dynamically-defined attack methods (it's supposed to return a table equivalent to a standard obj.yourweapon.methods) but there's no rule that says it has to work this way. You could always return nil and do everything directly in the methods function.
Zaidyer wrote:fake "smooth movement"
This would require significant hacks to the engine. No plans for this at the moment.
Zaidyer wrote:Some kind of graphical indication in the viewport that a monster is taking damage.
This is not hard to do in a variety of ways. You could spawn a short-lived cloud, use dsb_set_tint to momentarily flash the monster, or, if you're graphically ambitious, make a second version of the monster that looks like it's wincing and momentarily display that one. Now that I think about it, it would take some doing, but it wouldn't even be that terribly hard to dynamically draw a little flash of the amount of damage taken and have that pop up on top of the monster.
Zaidyer
Novice
Posts: 11
Joined: Tue May 01, 2012 6:14 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Zaidyer »

I have indeed seen Grimrock, and it's part of what got me here.

Anyway, Parallax posted in this topic about the automap last year:
Beo and Ian_Scho have it, and anyone else who wants it is welcome to it. Just PM me for the zip file until someone hosts it somewhere (I have no server).
Caveat #1: It's for DSB, not RTC.
Caveat #2: It's a full-screen, cutscene-type automap a la Lands of Lore, not the automap scroll from CSB. I think Joramun made that, but again for DSB...

Edit: Oh and if I coded it properly (I certainly believe so) it's ready to be dumped in the DSB dungeon of your choice.
I haven't checked to see how often he posts here, so I haven't messaged him yet.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

I tried to load the version of the automap that I have and it no longer works with the current version of DSB.
I can send it to you as-is, if you want. Otherwise, it'll take me a little while to investigate the problem and get it running again.
Zaidyer
Novice
Posts: 11
Joined: Tue May 01, 2012 6:14 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Zaidyer »

I'd prefer to use a fixed version that works.

How is DSB on GUI adjustment? I'd like to rearrange the location of the viewport and GUI elements to make it a little more like Lands of Lore, but the default script setup isn't so easy to figure out... Even if I can't do that, I'd like to re-skin the interface, as RTC allows you to do.

I'm also thinking of adding a complicated puzzle... One of the most memorable (even infamous) moments in Lands of Lore was the third floor of the White Tower, where the player was pitted against powerful ghosts and wraiths who can pass through walls. When I first played that game, I assumed the wraiths were triggered by noise, so I lightened my inventory and tried to use the sneaking armor set to avoid "waking" them. I'd love to find some way to implement that in DSB, where ghost spawners are activated every time the player pulls a switch, pushes a button or toggles a door, or even so much as moves if anyone in his party is carrying more than 40% of their weight limit.
I'm not sure "hearing" is in DSB yet, but could it be done with some simple editor tricks? ESB is quite easy to work with, and I think most of this could be worked out with simple Targets and OpBys, I'm just not sure how I'd do the "your footsteps are too heavy" trick...
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

The DSB GUI is pretty flexible. You can already change the entire layout. I don't think it's currently possible to change where on the screen each major GUI element is located, yet, but that wouldn't be a terribly difficult thing to implement. It'd just take me a bit of time to look into it.

Your puzzle is also quite doable. You could look at the hook function h_party_move in base/hooks.lua. By overriding this function, you can do all kinds of things when the party moves.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Gambit37 »

Sophia wrote:I don't think it's currently possible to change where on the screen each major GUI element is located, yet, but that wouldn't be a terribly difficult thing to implement. It'd just take me a bit of time to look into it.
Aah, wow, I'd be so jazzed about this! I really wanna change my default layout...
Sophia wrote:You could look at the hook function h_party_move in base/hooks.lua. By overriding this function, you can do all kinds of things when the party moves.
I must have missed this file! I've been looking for a on_party_move function -- I want to see how it plays with a footstep sound effect, like in Grimrock :-)

EDIT: He he, I grabbed some footstep effects from Thief & Unreal and slapped them in: works great! :-)
Zaidyer
Novice
Posts: 11
Joined: Tue May 01, 2012 6:14 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Zaidyer »

Hmm, but the engine can't scale or pan the contents of the viewport? If you're telling me I can rewrite h_party_move, then theoretically it would be possible to intercept every keypress, pause the game, quickly scale or pan the contents of the viewport, and resume. That's basically what Lands of Lore did; no other calculations were made during the smooth scroll as far as I can tell, unlike DM2.

Or is it more complicated than that?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

Zaidyer wrote:Hmm, but the engine can't scale or pan the contents of the viewport? If you're telling me I can rewrite h_party_move, then theoretically it would be possible to intercept every keypress, pause the game, quickly scale or pan the contents of the viewport, and resume. That's basically what Lands of Lore did; no other calculations were made during the smooth scroll as far as I can tell, unlike DM2.

Or is it more complicated than that?
It's more complicated than that, I think.

While you can change a lot of thing by editing the Lua, you don't really have control over the contents of the viewport on that level. I mean, you could probably hack something in using an overlay, but it would probably feel really, well... hacky. There isn't currently a function to scale an image, either; there just wasn't a need until now, admittedly.

For the most part, it's probably simply too low-level. It would have to be something I added to the core.
Zaidyer
Novice
Posts: 11
Joined: Tue May 01, 2012 6:14 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Zaidyer »

I'm actually getting lost in my own dungeons... The sooner an automap, the better. Why is the old version broken?

Also, I'd like to get the standard graphics and use them as templates for new replacements and wallsets. As far as I can tell they're not stored in any directory, so I'm assuming they're compressed in the graphics.dat file. How can I extract and edit them?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

The old version includes a bunch of code that isn't needed from the old test_dungeon and some of that code doesn't work any more.
I'll have to sort through it and remove it.

The standard graphics are not easily extractable from graphics.dat.
Like it says on the Download DSB link, you can get the files here.
User avatar
ian_scho
High Lord
Posts: 2806
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Re: Looking for some tricks and scripts to make gameplay eas

Post by ian_scho »

I tried to load the version of the automap that I have and it no longer works with the current version of DSB.
Was it version 0.2?
I just found the 'automap_v0.2.zip' file by Parallax... In my Inbox staring at me for the past year and a half! Let me know if anyone would like a copy. Beo?
-- Custom item: Automap v0.2 FINAL.
-- Created by Parallax, November 2007.
-- Thanks to Joramun, whose magic map was an invaluable reference in the early stages of development.
-- Thanks to Sophia for DSB, as well as for her help and advice.
-- Thanks to Gambit37, whose beautiful Conflux maps inspired the default background.
-- This item was designed with modularity and adaptability in mind. Some comments are interspersed throughout the code
-- to try and make the process a little bit more transparent. I hope they help.
-- Feel free to use this item as is in your own dungeon and to modify it to suit your needs. If you do use it, please
-- acknowledge me in the credits.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Looking for some tricks and scripts to make gameplay eas

Post by beowuuf »

Yes please, and I can host it on DM.com aswell.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

The version I have doesn't have a version number. It's probably an earlier beta.
As long as that version works, it's probably a better choice to use. :)
(Saves me some work, too!)
User avatar
ian_scho
High Lord
Posts: 2806
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Re: Looking for some tricks and scripts to make gameplay eas

Post by ian_scho »

Email sent to your yahoo address, Beo. Not even tested the contents :O
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Looking for some tricks and scripts to make gameplay eas

Post by beowuuf »

Cool, will check it out and upload it!
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Gambit37 »

Oooh, nice, is this working as-is, or does Sophia still need to update it?
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Lunever »

It'd be very cool if there was an automap that records, what the magic map item has shown.
Parting is all we know from Heaven, and all we need of hell.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Looking for some tricks and scripts to make gameplay eas

Post by beowuuf »

Not sure where to put this link, and if it is something that should be linked to:

http://dmweb.free.fr/Stuff/files/automap_v0.2.zip
Zaidyer
Novice
Posts: 11
Joined: Tue May 01, 2012 6:14 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Zaidyer »

Error on Line 17,

attempt to call global 'dsb_bitmap_height' (a nil value)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

I guess that one needs fixes, too.
I'll get to it when I can. :)
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Lunever »

How's the automap working?
Parting is all we know from Heaven, and all we need of hell.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

Lunever wrote:How's the automap working?
Sophia wrote:I guess that one needs fixes, too.
I'll get to it when I can. :)
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Lunever »

I mean, what does it do exactly, currently (in theory)? I havent seen it so far.
I would prefer, if the automap would just record everything the magic map has shown so far.
Parting is all we know from Heaven, and all we need of hell.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

Here are the fixes:
http://pastebin.com/05G6Kt9h
Just replace the contents of Automap.lua with the code there.

(For those interested, the problem was that some of the code didn't work in ESB, so the easiest fix was to just block that off behind a variable that won't be defined if DSB is running, but will if ESB is.)

To use this automap, add the following code somewhere in your objects.lua:

Code: Select all

dsb_import_arch("Automap.lua", "automap")
An automap arch will show up in the "SCROLL" class of Things and can be used in your dungeon.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

Lunever wrote:I mean, what does it do exactly, currently (in theory)? I havent seen it so far.
I would prefer, if the automap would just record everything the magic map has shown so far.
It records everything that has been visited.

Anyway, I fixed it, so now you can see for yourself. :mrgreen:
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Gambit37 »

Awesome!!! I had a very quick look at the code yesterday, and saw that it's all tied to an item you actually pick up. I'm sure it wouldn't be too hard to copy out the core mapping code and attach it to a button instead... say, if you want the automap to be part of the interface, for example...
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Re: Looking for some tricks and scripts to make gameplay eas

Post by Lunever »

Cool. It'd be a good default feature for DSB imho.
Parting is all we know from Heaven, and all we need of hell.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Looking for some tricks and scripts to make gameplay eas

Post by Sophia »

Gambit37 wrote:Awesome!!! I had a very quick look at the code yesterday, and saw that it's all tied to an item you actually pick up. I'm sure it wouldn't be too hard to copy out the core mapping code and attach it to a button instead... say, if you want the automap to be part of the interface, for example...
Due to the way dsb_msgzone works, there might still be some advantage to tie it to an actual item. But it could always be a flooritem off in some inaccessible part of the dungeon, and it would work the same way in practice. Or you could define your own system message and write your own sys_system_message to handle it, I guess.

The short answer is, yes, it wouldn't be that hard. Just a little tricky if you're unfamiliar with how DSB works. :mrgreen:
Post Reply