In-game scripting and what should be done

BlitzMax Forums/BlitzMax Programming/In-game scripting and what should be done

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I'm currently giving my game the ability to read scripts
from a file during runtime, then execute them. This will be
used for cutscenes, etc. The script will activate events
which are hard-coded into the program. Events will tell a
character to go here or say this or kill that, etc. I have
almost completely fleshed out the system on paper, but
one question remains. How do I write these events into
the program?

Currently, the only system I can come up with is:

Repeat
	If event[1] = ACTIVE Then
		doSomething()
	EndIf
	If event[2] = ACTIVE Then
		doSomethingElse()
	EndIf
Forever

And Then have functions that correspond To them:

Function doSomething()
	make main character walk over there
EndFunction
	
Function doSomethingElse()
	turn the snow level And windspeed up
EndFunction


This is such a hack-job and I hate having to do it like this,
but I don't know how not to have events hard-coded.

Is this the sort of thing that Lua handles well? I'm
completely unfamiliar with it at the moment.