Chaosforge Forum

DoomRL => Modding => Topic started by: yaflhdztioxo on February 25, 2010, 15:43

Title: Level modding and syntax preference
Post by: yaflhdztioxo on February 25, 2010, 15:43
Just in case you didn't know, (http://blog.chaosforge.org/articles/47/sandbox-doomrl-modding-advent) modding is now open--in a limited form.  Already work is underway, creating new and exciting levels, and a tutorial is planned as well.  And an argument sort've broke out on this point which hopefully you, the community, can resolve :)

In Lua (the language mods are written in), almost every object is a table.  And Lua is fairly flexible with how you assign tables.  For instance, if I were to create an item, the following approaches are all valid:
Code: [Select]
-- C-style
local new_cell
new_cell        = {}
new_cell.name   = "object"
new_cell.ascii  = ":"
Cells(new_cell)

-- Table style
local new_cell
new_cell = {}
new_cell["name"]  = "object"
new_cell["ascii"] = ":"
Cells(new_cell)

-- Lua style
Cells{
  name  = "object",
  ascii = ":"
}

Which one do you, the community prefer?  It's the form that the wiki pages will use, so choose wisely!
Title: Re: Level modding and syntax preference
Post by: Malek Deneith on February 25, 2010, 17:27
Lua style. It looks clearer, and uses less space as your own example proves :P
Title: Re: Level modding and syntax preference
Post by: Deaven on February 26, 2010, 15:31
For the same reasons - Lua.
Title: Re: Level modding and syntax preference
Post by: thelaptop on February 26, 2010, 16:23
Scheme style.  Oh wait...

I suppose Lua works...
Title: Re: Level modding and syntax preference
Post by: GenTechJ on March 02, 2010, 16:51
LUA Style, for all the reasons listed above.
Title: Re: Level modding and syntax preference
Post by: yaflhdztioxo on March 02, 2010, 17:12
I am clearly outnumbered here.  Oh, woe for the days where coding was procedural and we all knew assembly by heart...
Title: Re: Level modding and syntax preference
Post by: Kornel Kisielewicz on March 02, 2010, 18:53
yaflhdztioxo, told you so... but you wouldn't listen :>

And as a matter of fact this is the style in which DoomRL lua files are written... so I guess that is final :)
Title: Re: Level modding and syntax preference
Post by: Madtrixr on March 07, 2010, 06:58
Damnit add. YOu couldn't get your IRC name or something?

Fine, I'm calling you Yaf.