Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / [OPEN SOURCE: Tier 2] RPGEngine

Author
Message
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 7th Oct 2012 18:41 Edited at: 7th Oct 2012 18:44
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.

Here's the documentation for it:

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 "IFNPRESS" - 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 )

Anyway, here are supported features:

Many maps
Whole player movement
Map collision
A* pathfinding commands for events. (There's a single command making the NPC go to the desired place)
Many commands as listed above
Animations and so on

What is left to be added:

Saves
Fight system
Party system
Inventory system (started, not finished)
Menu


The source alone:

Core.cpp
CoreForApp.h
template.cpp
template.h
main.cpp
player.h
player.cpp
event.cpp
event.h
event_handlecode.cpp
pathfinding.h
party.h

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.

Here is the video of that example I've done:



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

Let me know if something's wrong with this post / information.

PS.
RPGEngine was done on a earlier version of AppGameKit, so it might need some porting.

Have fun!

Follow me on twitter! @MotionStruct
Motion Struct blog

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 7th Oct 2012 18:48
Nice kamac !

Nice with another fellow agk user that releases some free source

But you should have stated in the title that its for tier 2

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 7th Oct 2012 18:55
Quote: "Nice kamac !"


Why thank you.

Quote: "But you should have stated in the title that its for tier 2 "


Well, I guess that wouldn't be a bad idea. Too bad we can't change topic titles

Follow me on twitter! @MotionStruct
Motion Struct blog
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 7th Oct 2012 19:36
Quote: "Well, I guess that wouldn't be a bad idea. Too bad we can't change topic titles "

I will see if i will have a goo later on with converting your code to tier 1

who made the lovely artwork ?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 7th Oct 2012 19:44
Wow, that's a lot of work! Thanks for sharing, very interesting.

kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 7th Oct 2012 20:40 Edited at: 7th Oct 2012 20:44
Quote: "who made the lovely artwork ?"


Oh, it's taken from a RPG Maker site. I think it's ripped from some GBA game. About the orcish characters, those are some origs made for RPG Maker aswell.

Quote: "I will see if i will have a goo later on with converting your code to tier 1 "


Sure, go on. Althrough, that's quite much work.

Quote: "Wow, that's a lot of work! Thanks for sharing, very interesting."


Thanks


PS. Oh, somebody went and changed the title of this thread. Thanks

Follow me on twitter! @MotionStruct
Motion Struct blog
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 7th Oct 2012 21:34
Nice work! Thanks for sharing!

I'd like to make an RPG too but more old school dungeon master style, this top down view is also very interesting and old school as well so I see the attraction.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 7th Oct 2012 21:44
Quote: "Nice work! Thanks for sharing!"


Thanks, and you're welcome.

Quote: "I'd like to make an RPG too but more old school dungeon master style, this top down view is also very interesting and old school as well so I see the attraction."


Well, you know, I based this RPGEngine on RPG Maker a bit.

Follow me on twitter! @MotionStruct
Motion Struct blog
Auger
12
Years of Service
User Offline
Joined: 21st Aug 2011
Location: Out There
Posted: 7th Oct 2012 21:58
Wow, really nice of you to release this to the community. I'm only using tier 1 atm, but it's still great to see. Thanks
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 7th Oct 2012 22:07
Quote: "Wow, really nice of you to release this to the community. I'm only using tier 1 atm, but it's still great to see. Thanks"


You're welcome

Follow me on twitter! @MotionStruct
Motion Struct blog

Login to post a reply

Server time is: 2024-03-29 12:29:21
Your offset time is: 2024-03-29 12:29:21