Hi Robert,
I have used Lua (www.lua.org) as a configuration language in the past.
One example was for an Abalone OpenGL 3d game I was making. See the saved game example text file below:
Code:
CreateBoard(
" 1 1 1 1 1 " ,
" 1 1 1 1 1 1 " ,
" . . 1 1 1 . . " ,
" . . . . . . . . " ,
". . . . 3 . . . ." ,
" . . . . . . . . " ,
" . . 2 2 2 . . " ,
" 2 2 2 2 2 2 " ,
" 2 2 2 2 2 ")
ClearActivePlayers()
AddActivePlayer(1,180)
AddActivePlayer(2,0)
SoundManager.LoadSound("Marble-Marble","Marble-Marble.wav")
SoundManager.LoadSound("Marble-Board" ,"Marble-Board.wav")
I linked routines in the Delphi program to Lua and called them like so above.
I have also used Lua for just simple stuff like:
Code:
ScreenWidth=320
ScreenHeight=240
FullScreen=true
where I have read in the global Lua variables and used them to configure the program
You can make it as simple, or as complex as you want really.
cheers,
Paul
Bookmarks