Scripting System

Hey all.

I’ve created scripting systems in the past for games using arbitrary commands in a .txt file, such as:

@start
if orientation player up
	release player
	textbox sign @1
	acquire player
endif
end

@1
Event 001 executed.
This is a sign textbox.
The last line in this paragraph.
A new paragraph begins!
Final line of this dialog.
end

When the player walks up to a certain tile (e.g. a signpost) and clicks the “interact” key, the instructions inside of this .txt file are parsed, fed into some custom script interpreter, then executed line-by-line. For those of you who have worked with this kind of scripting in your own games, how did you go about it? Does an easier method come to mind? Parsing everything properly and the logic general here is pretty complicated and takes a lot of time to implement.

1 Like

I’ve been playing with a specific DSL in Lua for my adventure game framework.
Still weighting its pros and cons, but so far I like it. A good starting point is here:

For a full blown interpreter this is also interesting:

http://lua-users.org/wiki/LuaInterpreterInLua
http://www.playwithlua.com/?p=66

5 Likes