home |
| the black hole's front page. all the latest vb rpg development and vbgaming news, as well as this week's feature rpg project! |
rpg projects
|
| vb rpg projects under development by members of the bhC. show them your
support, and check out their games! |
message board |
| a forum to interact with your fellow vb rpg programmers. you do *not* have
to be a bhC member to post! |
contact |
| you want to contact the guy behind the black hole? here's where to
do it! |
|
|
 |
|
<< Back to Category List
Simple Game Scripting Part 1: Storing/Reading Your Scripts - page 5 |
An explanation!
Hopefully the comments in the code for the
LoadScriptFile function are sufficient to explain
what the more confusing lines do. The use of
string manipulation functions such as InStr, Left$,
and Right$ can become very confusing if you have
not used them before, or don't know how they work.
Therefore, if you wish to truly understand how the
string parsing works, I suggest you read up on these
functions, and other related ones including Mid and
Split.
Until next time...
By now, you should understand how to load and store
your script files on disk and in memory. This is
the most important piece, and can be the most
complicated. The actual loading and splitting up
of the individual lines is integral to the use of
your scripting engine, and thus you have to make
absolutely sure that it is foolproof (or as close
to this as possible!). I suggest adding error
handlers, and using the return value of LoadScriptFile
to check whether the file was loaded correctly
when you call it.
In the next article in this series, the actual
use of your scripting will be discussed. The third
part of this series will then continue along that
theme and go into much more depth with the
implementation, including a section on interfacing
the scripting engine with a tile-based system in
order to create events.
Source Code
Though simple, if you would like the source code
to this part of the series, the class module is
available at:
[
http://blackhole.thenexus.bc.ca/articles/CScriptParser.cls ]
Contact + Future Releases
Updated versions of this article, as well as the
later parts of the series as they are written,
will be available from my website, the black hole.
[
http://blackhole.thenexus.bc.ca/ ]
I can be reached for comments or questions at
[
dgoodlad@junction.net ]
I sincerely hope you've gained from this article,
and look forward to the next part of the series!
David Goodlad
|
|