Hi there.
For a while I've been doing a RPG Engine with AppGameKit (Tier 2), but sadly it went discontinued after I had to take care of other things.
It has it's own scripting language (althrough, very poorly done) that let's it's users do events etc.
Quote: "
#################
## VALUE CAN ALSO BE ANOTHER VARIABLE. JUST ADD v BEFORE THE NUMBER. EXAMPLE:
## setvar:0:v1:
#################
none - Put this if there are no actions for given event.
if:onclicked - Put this if you want that statement to be true when user presses on the event.
if:ontouched - Put this if you want that statement to be true when user touches the event.
if:onparallel - This condition will only be true when parallel:active:number: is set. See below.
TODO if:onkey - Put this if you want that statement to be true when user is next to the event and pressed enter key. (Mac/Windows only!)
if:onauto - Put this if you want that statement to be true when the map loads in.
if:oncustom - Put this if you want that statement to be true on custom call from your script.
if:onpress - This condition will return true if the user pressed ANYWHERE on the screen. WARNING. It has to be put inside an if:onparallel to work!
#ADDITIONAL WARNING FOR "IF
NPRESS" - the faster parallel loop appears, the less buggy is that condition.
if:var:number:value: - Put this if you want that statement to be true when variable is set to a certain number.
if:var>:number:value: - Put this if you want that statement to be true when variable is set to higher than certain number.
if:var<:number:value: - Put this if you want that statement to be true when variable is set to smaller than certain number.
if:!var:number:value: - Put this if you want that statement to be true when variable is NOT set to a certain number.
if:dist>:value:
if:dist<:value: - All of those check if the distance from player to entity is either higher, lower or equal to certain value.
if:moving - Returns true when event is moving.
if:!moving - Returns true when event is NOT moving.
if:sprfaded:id: - Returns true if sprite image has already faded in/out.
if:dist=:value: - Reference: 31 is whole screen height. About 48-55 is whole width.
else - Speaks for itself. Used for "if"
setvar:number:value: - Sets a variable. Proper example: setvar:0:1:
addvar:number:value: - Adds to the variable. Proper example: addvar:0:1:
#############
# YOU CAN ALSO USE THE FOLLOWING SYNTAX:
# setvar:number:value1::value2: - Sets the variable to a random number between value1 and value2.
# addvar:number:value1::value2: - Adds to the variable a random number between value1 and value2.
#############
#######################################
# WARNING #
# This command work only in if:onauto #
#######################################
parallel:active:float_number: - Enables parallel loop for given event. Number is delay in seconds between every loop. Proper example: parallel:active:2.0:
WARNING, use it ONLY on the end of if:onauto!!!
#######################################
blockplayer } Block /
unblockplayer } Unblock player movement.
hide - Hides your event.
show - Shows your event.
turn:direction: - Turns the event to the given direction. Avaible options are left, right, up and down.
turnto:x:y: - Turns the event towards given X and Y position.
frame:number: - Set's frame progress on basing on the given value. Avaible number is between 0 and 2.
sheet:number: - Change event's sheet. Number between 1 and 8.
collide:number: - Turns the collision on/off. 0 for off, 1 for on.
getpx:variable:method: - Puts player X into given variable. Method of 0 returns position in cells, in 1 returns in pixels.
getpy:variable:method: - Puts player Y into given variable. Method of 0 returns position in cells, in 1 returns in pixels.
getcx:variable:method: - Puts event X into given variable. Method of 0 returns position in cells, in 1 returns in pixels.
getcy:variable:method: - Puts event Y into given variable. Method of 0 returns position in cells, in 1 returns in pixels.
goto:x:y: - Goes to an position on the map. (Absolute)
playsound:soundname: - Plays an sound. Example: playsound:speech.wav. Sound has to be placed in "sounds" folder.
teleport:mapid:x:y:method: - Teleports the player to another map. Method - 1 for black fade and 2 for white fade.
createspr:id:imgname:x:y: - Creates an overlapping sprite/image. Image must be placed inside "images" folder. Example: createspr:0:something.png:0:0:
sprpos:id:x:y: - Set's sprite position. Example: sprpos:0:10:12:
visiblespr:id: - Toggles sprite visibility. Example: visiblespr:0:
showspr:id: - Shows sprite.
hidespr:id: - Hides sprite.
sprfadein:id:speed: } Fade sprite image in/out with given speed. Example:
sprfadeout:id:speed: } sprfadein:0:5:
fixspr:id:x:y: - Fixes sprite image to screen. (making him follow it) Example: fixspr:0:200:100:
sprimg:id:imgname: - Changes sprite's image. Example: sprimg:0:newimage.png:
setspeed:float_speed: - Sets event's speed. Default: 1.0. Example: setspeed:0.5:
#######################################
## MESSAGE BOXES & DIALOGS ##
#######################################
message:text} - Simple message box. An example: message:lalala...}
dialog:var:text} - Dialog box. An example: dialog:0:Who do you want to be?@oA sailor@oA warrior@oA wizard}
\\\\Dialog explanation: Var is the variable that will hold your input. First option has ID 0, second ID 1 and so on.
\\\\ Separate options by using @o tag.
#####
##SPECIAL INPUTS FOR MESSAGE BOXES & DIALOGS
#####
@vNMB: - Puts in an variable. Instead of NMB place variable number. Example: @v0: would display variable 0.
@N - New line.
@c(r,g,b) - Colorize everything after this statement. Example: @c(0,0,0) would make the text 100% black.
@o - New option (DIALOG ONLY)
"
The maps are ought to be created with tiled map editor, but you could use anything actually, as long as it produces three files, containing map_collision (1 for collision, 0 for no collision), map_layer2 (containing additional objects..) and map_layer1.
I don't really remember what those files had to look like, but you can check for yourself if you dig into my code.
( TIP: For map_layer1 I think it was: width, height, numbers here. 0 for left-upper corner of subimages, 1 for the next one and so on )
A* pathfinding commands for events. (There's a single command making the NPC go to the desired place)
You can also download the attachment. It contains the whole source and an example which you should take a look at as it explains how to make it work actually.
I really hope that this can be any of use to you guys. Maybe somebody can learn on it, or even use it.
So, you can take this code and do whatever you want to it. You can even claim this as yours, but that would be mean
PS.
RPGEngine was done on a earlier version of AppGameKit, so it might need some porting.