Level modding and syntax preference

Started by yaflhdztioxo, February 25, 2010, 15:43

yaflhdztioxo

February 25, 2010, 15:43 Last Edit: February 25, 2010, 15:51 by Kornel Kisielewicz
Just in case you didn't know, 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:
-- 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!

Malek Deneith

Lua style. It looks clearer, and uses less space as your own example proves :P
Inquisition - saving your soul, one bolter shell at a time.
Hackmaster Kills

Deaven

thelaptop

Scheme style.  Oh wait...

I suppose Lua works...
I computed, therefore I was.

GenTechJ

LUA Style, for all the reasons listed above.

yaflhdztioxo

I am clearly outnumbered here.  Oh, woe for the days where coding was procedural and we all knew assembly by heart...

Kornel Kisielewicz

March 02, 2010, 18:53 #6 Last Edit: March 02, 2010, 18:54 by Kornel Kisielewicz
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 :)
at your service,
Kornel Kisielewicz

Madtrixr

Damnit add. YOu couldn't get your IRC name or something?

Fine, I'm calling you Yaf.
<Malek_Deneith> What is a PC? A miserable little pile of XP. But enough plot - have at you!

[B/S/G/P/D]
[19/8/5/0/0]