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:
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.
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.