Making an RPG with AGS

From Adventure Game Studio | Wiki
Revision as of 17:52, 3 December 2005 by Gord10 (talk | contribs) (How to make RPG's with AGS)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

It is possible to make RPG's with AGS; but you will need some coding experience.

I'll tell you how to develop RPG games with AGS Scripting in this tutorial. Yes, there are some free other game developing tools which you could make RPG's, but you can add adventure elements to your game easily if you use AGS.

Firstly, I should say that there are many ways to script RPG's with AGS. I will tell the way I use while I was developing Asporia: Hidden Threat in this tutorial (all the screenshots are from the source code of the game.)

== The Variables Like Health, Mana and Exp. ==


We need these variables to develop our RPG game. Add this script to game_start section.

GiveScore(7); //Health. You can also use GlobalInt for this. SetGlobalInt(2,8); //Mana SetGlobalInt(3,0); //Exp-weapons. SetGlobalInt(4,0); //Exp-mage. This is what I used for Asporia. You can use only one variable for exp. if you want.

also if you want,

SetGlobalInt(5,5); //the enemy's HP is set to 5

So our health is 7 and mana is 8 units. We haven't got experience points yet. To decrease the mana points, use this script: SetGlobalInt (2, GetGlobalInt(2)-1); //We lost 1 mana point.


The GUI Which Shows The Health, Mana and EXP. Status

Let's prepare our GUI where we can learn how many health, mana and exp. we have.

Tuto-gui1.PNG We need GUI Labels for this. Create some GUI labels, let some of them be the texts like "Mana, Exp"; and let the others be "..." blank, which will show the number of the variables.

The "HP: @SCORE@" script: This is our health as we designated the game score as hit points. Type HP: @SCORE@ code in the Text blank of the label which you want to use as the HP status.

After preparing the labels with texts and the other labels with blanks, write this code to repeatedly_execute section:

string mana; string expweapon; string expmagic; string enemyhp; //this is the HP of your enemy. ignore it for now. StrFormat (mana, "%d", GetGlobalInt (2)); StrFormat (expweapon, "%d", GetGlobalInt (3)); StrFormat (expmagic, "%d", GetGlobalInt (4)); StrFormat (dusmanhp, "%d", GetGlobalInt (5)); SetLabelText (0, 1, mana); //so the mana points will be shown in the GUI 0, Label 1) SetLabelText (0, 2, exp); SetLabelText (0, 9, expbuyu); SetLabelText (4, 1, dusmanhp); //this code isn't too necessary for now. it is about another GUI, number 4.

So the variables in the game should have been displayed in the GUI.


Turn Based Fights: Weapons, Magics, Enemies, and Enemy A.I.

Another important thing for the RPG's: Weapons, magics, enemies and their artificial intelligence.