Home‎ > ‎


This section is dedicated to a game engine I am working on.

Powerful text-based scripting engine supports:
-Controls all aspects of the engine like loading maps, tilesets, editing the HUD, etc
-Asynchronous Multi-threaded scripts where each object (ie: the map, and each NPC, player, event) is given it's own synchronous thread (where commands like moveobject wait until the NPC has arrived at it's destination before executing the next line)
-Keyboard/Mouse/Controller mapping

DirectX 8 based graphics engine supporting:
-2D sprite/tile maps
-animated background tiles
-objects that can face 4 directions, and have an animation for each (though the facing right animation is the left one flipped horizontally)
-tweening for object/map positions and color effects

Syntax of the scripting engine:
Based on VB/VBscript for the most part

A line starting with either # ' or /, then a space is a comment and will be ignored by the command line interpreter (CLI)

Wait until a command is finished before continuing:
Waitif [expression]
Expressions must result in either true or false.
Example: Waitif temp = 4
if temp is 4 then it will wait
The current time to wait is set at 1 second, though this may change in the future to allow customization
ie: Wait 1 frame if [expression]

Select case:
Select [expression]
    case [test value 1]
    case [test value 2]
    case else
end select
-[expression] is tested, if any of the test values match the code under it is executed. Once the code is done, it will either encounter another case [test value] line, case else, or end select. In either case it skips to the line after end select

If [expression]
elseif [expression]
end if
(The elseif/else parts are obviously optional)
The elseif/else stuff acts similar to select case above. Though with Select Case [expression] is only tested one. With this one you can have different [expressions] and each are tested


While [expression]
end while
As long as [expression] evaluates to true, the code will be executed

Until [expression]
end until
As long as [expression] evaluates to false, the code will be executed

For [variable] = [initial value] to [end value] step [increment]
end for
The step [increment] part is optional
1-[variable] will set to the [initial value]
2-the code will be executed
3-[increment] (default is 1) will be added to [variable]
4-if [increment] is greater than 0, and [variable] is equal to or smaller than the [end value] or
if [increment] is smaller than 0, and variable is equal to or greater than the [end value] then
go back to stage 2

Exiting a loop/function prematurely:
Exit ___
(where ___ is the type of loop (for/while/until/function)

On objectname_eventname
end objectname_eventname
-When objects do certain things, they will automatically call certain events

On Functionname
end functionname
-Just like events really, only the engine won't automatically call them when things happen

Calling a function:
call functionname (or objectname_eventname)

Declaring a variable:
declare [variable] as [type (number, text enclosed in quotes, or boolean)]
-not recommended. There is an interface to use the savedata, as variables have no scope

Functions available:
set, 1, txt txt
 Minimum Parameters Parameter list [p#]
 set 1 txt, txt Sets the variable [p1] to value [p2]
 msgbox 1 txt Opens a windows messagebox with the contents of [p1]
 save 0  saves the game
 getswitch 1 txt returns the value of switch [p1]