murgaLua and other feature requests

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.
Post Reply
iGame3D
Novice
Posts: 28
Joined: Thu Dec 18, 2008 7:02 pm
Location: Hotel Colorado
Contact:

Post by iGame3D »

Hey wow, this is pretty neat.
Feature request, support .png files.
Oh and a key to enable a windowed mode, I'd like to debug , read and crash stuff while running the program. Ooh found it in the dsb.ini file, thanks!

Ok now please support creating/deleting items and saving the dungeon.

What are those Map/map00.pcx files for?
What makes pcx files?

Please check out MurgaLua
http://www.murga-projects.com/murgaLua/murgaLua.html

It might help to build interfaces and map makers with a lua based programming environment. I'll help, this looks fun.

Looking at a "dungeon.lua" I see that you could certainly design a simple murgaLua interface, thats spits out this file.
However the files are explicit, they are calling functions like "dsb_add_champion()", etc.

if some things were stored in tables, in separate files an editor could write and read data more efficiently/user friendly perhaps.

For instance, I'm looking at test_dungeon/dungeon.lua


a Characters.lua could look something like this
-- Something easy for a simple UI to write/read

Code: Select all

Champions={
{"port_chani", "TEST", "PLAYER", 2000, 2000, 2000, 500, 400, 650, 450, 450, 400, 500, 8, 5, 5, 5},
{"port_daroou", "TEST2", "PLAYER", 4000, 4000, 1000, 600, 500, 350, 450, 350, 360, 500, 9, 4, 2, 2},
{"port_mophus", "TEST3", "PLAYER", 3000, 5000, 2000, 500, 500, 550, 550, 550, 620, 500, 4, 2, 8, 7}
}
ChampionsSpawns={
{{"silk_shirt", "INV_TORSO"},{"abard", "INV_LEGS"},{"moonstone", "INV_NECK"},{"boots_speed", "INV_FEET"}},
{{"robe_fine_top", "INV_TORSO"},{"abard", "INV_LEGS"},{"boots_suede", "INV_FEET"}},
{{"robe_fine_top", "INV_TORSO"},{"robe_fine_bottom", "INV_LEGS"},{"boots_suede", "INV_FEET"},{"vorpal", "INV_R_HAND"}}
}

Then there could be run a function that works like the code below to create the required DSB lua function strings:

Code: Select all

local Q='"'
spawningString = ""
for i = 1,#Champions,1 do
local championvalues = "" 
who = i -- the character number
   
    -- make a clean string of the values
    
   for iii = 1,#Champions[i],1 do
   if iii < 4 then 
   -- quoted
   championvalues = championvalues ..Q..Champions[i][iii]..Q..","  
   else
   championvalues = championvalues ..Champions[i][iii]..","  
   end
    end
    
    championvalues = string.sub(championvalues,1,-2) -- remove the last comma

 -- dsb_add_champion
 spawningString = spawningString .. Champions[who][2].."_"..Champions[who][3] .."= dsb_add_champion("..championvalues..")\n"
 
    for ii = 1,#ChampionsSpawns[who],1 do
    local what = ChampionsSpawns[who][ii][1];
     local  where = ChampionsSpawns[who][ii][2];
     -- dsb_spawn
    spawningString = spawningString.."dsb_spawn("..Q..what..Q.." ,CHARACTER, "..Champions[who][2].."_"..Champions[who][3]..","..where..",0)\n"
    end
end
  print(spawningString)
end
Which gives the result:

Code: Select all

TEST_PLAYER= dsb_add_champion("port_chani","TEST","PLAYER",2000,2000,2000,500,400,650,450,450,400,500,8,5,5,5)
dsb_spawn("silk_shirt" ,CHARACTER, TEST_PLAYER,INV_TORSO,0)
dsb_spawn("abard" ,CHARACTER, TEST_PLAYER,INV_LEGS,0)
dsb_spawn("moonstone" ,CHARACTER, TEST_PLAYER,INV_NECK,0)
dsb_spawn("boots_speed" ,CHARACTER, TEST_PLAYER,INV_FEET,0)
TEST2_PLAYER= dsb_add_champion("port_daroou","TEST2","PLAYER",4000,4000,1000,600,500,350,450,350,360,500,9,4,2,2)
dsb_spawn("robe_fine_top" ,CHARACTER, TEST2_PLAYER,INV_TORSO,0)
dsb_spawn("abard" ,CHARACTER, TEST2_PLAYER,INV_LEGS,0)
dsb_spawn("boots_suede" ,CHARACTER, TEST2_PLAYER,INV_FEET,0)
TEST3_PLAYER= dsb_add_champion("port_mophus","TEST3","PLAYER",3000,5000,2000,500,500,550,550,550,620,500,4,2,8,7)
dsb_spawn("robe_fine_top" ,CHARACTER, TEST3_PLAYER,INV_TORSO,0)
dsb_spawn("robe_fine_bottom" ,CHARACTER, TEST3_PLAYER,INV_LEGS,0)
dsb_spawn("boots_suede" ,CHARACTER, TEST3_PLAYER,INV_FEET,0)
dsb_spawn("vorpal" ,CHARACTER, TEST3_PLAYER,INV_R_HAND,0)
Just like in the dungeon.lua.

BUT could be executed without writing to a file by using loadstring() if desired.

I guess what I'm saying is separate the data from the execution and it would be easier to edit the levels.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

iGame3D wrote:Feature request, support .png files.
I'll look into it...
iGame3D wrote:Ok now please support creating/deleting items and saving the dungeon.
You can do this already, unless I'm confused about what you're asking for.
iGame3D wrote:What are those Map/map00.pcx files for?
What makes pcx files?
Those files are the maps-- one pixel = one square of the dungeon. I thought this was a good idea. I still do, honestly, but nobody else seems to understand what I was going for. :P

Most paint programs can save .pcx I think.
iGame3D wrote: However the files are explicit, they are calling functions like "dsb_add_champion()", etc.

if some things were stored in tables, in separate files an editor could write and read data more efficiently/user friendly perhaps.

This actually isn't a bad point, though I will defend why it's all explicit--
iGame3D wrote:I guess what I'm saying is separate the data from the execution and it would be easier to edit the levels.
The point of dungeon.lua is that it's simply a Lua program that is executed to create the dungeon that is then played by DSB. It was easiest for me to code it this way and was also the most flexible.

Some additional architecture on top for an editor-created dungeon.lua might be an intriguing way to go, though. However, I'd like, if possible, an editor that can "speak Lua" and can import other dungeon.lua files. DDM was getting there but Remy seems to have left. :(
iGame3D
Novice
Posts: 28
Joined: Thu Dec 18, 2008 7:02 pm
Location: Hotel Colorado
Contact:

Post by iGame3D »

Yeah I tried DDM earlier today, impressive, sad that Remy has vanished. I've been trying to hack an editor like that together for ages, haven't gotten past making 3D blocks.
There just doesn't seem to be much in the way of "How to make a level editor from scratch" information out there.
My super simple map doodler looked like this
Image
It was actually drawing a 3D mesh like so:
Image
Which would in turn get a swab of mono-texture and look like this:
Image


Would love to be able to make something like DDM.
Something not .NET since I'm running your DSB through emulation on a Mac and .NET isn't supported in the emulator.

Ok Photoshop saves PCX.
But wouldn't it be better to save as a list of coordinates? Something that could be opened in a level editor or even read and edited by hand without some graphics to data conversion?

Something like

Code: Select all

Floors={{10,10},{10,11}.....etc}
Doors={{10,10,10,11}...} -- being at the junction of two floors
Monsters={{"Shrieker",10,10}...etc}
In this way an editor could be developed thats more open to community modification
than say a paint program or Remy's uber .Net extravaganza.

Here's a hacky bit of editor I made last winter to emulate mouse drawing with the 1982 Mattel Aquarius.
http://aquarius.residenteasel.com/aquapoke/AquaPoke.zip
Something like this for Dungeon Master certainly seems doable.
As long as there is some bridge between the editor and DSB.

You'd think by 2008 there would be a simple generic,
"Drop arbitrary assets on a grid, generate custom output" program.



You said there is a way to drop items and save the level?
While running DSB? What am I missing? Or did you confuse "drop items" with "drop robe on floor".
I meant add items to the level, then save the level, kind of the way say Halo 3 Forge works, on a low tech scale.

Perhaps there needs to be an editing mode and a play mode,
so that the save doesn't think its saving the current partied adventure.


Whats on your todo list anyway?
This project is a pleasant and inspiring destraction from my own.
There are days I sift the internet for projects built with Lua that I'm hoping will spark some flame of what direction to take next.
I found DSB by just checking to see if RTC would work in the emulator, what luck.


One last quick question, didn't the number keys 1 -4 at the top of the keyboard toggle your hero battle action and/or inventory modes in the original Amiga version? I'm pretty sure there was a quick way to activate character and attacks...perhaps I just had crazy fast reflexes in 1993.

A good feature would be to have a fully scriptable keyboard.
Could macro some spells and other tricks.
Post Reply