Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: TerranRich on Mon 03/05/2004 05:56:47

Title: AGS: Can I Make an RPG with AGS?
Post by: TerranRich on Mon 03/05/2004 05:56:47
The answer is yes. You can make an RPG with AGS.

Why not? What's stopping you? First of all, you can keep track of stats with global variables. Look them up in the manual. Look for "globalint".

Turn-based combat? Of course it's possible with AGS! With enough scripting knowledge, you can program turn-based fighting in your RPG game.

Any other RPG-related questions, please feel free to ask here. Anybody who has any other tips and pointers for making an RPG in AGS, post here as well.

(Any other "Can I make an RPG" threads will be locked.) :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .. on Tue 04/05/2004 21:10:38
Sprites
For sprites you just simply draw the overhead view of the character.

Items, Powers, Weapons etc....
For displaying items, healing powers, weapons, etc you can use an inventory or if you want seperate inventorys for each see this  (http://www.agsforums.com/yabb/index.php?topic=6498.0) thread.
The same theory as above could be used if you want a pokemon style game where you collect monsters, just have a new inventory with the monsters in.

Keyboard Movement
And of course if you want classic gameboy RPG feel you want the character to be controlled by the keyboard,  here  (http://www.agsforums.com/yabb/index.php?topic=8303.msg126079;topicseen#msg126079) is a usefull thread.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ginny on Tue 04/05/2004 21:32:19
I find this pretty straight forward, but one aspect of RPG, which is money, trading, shops, etc, can be handled by making each shop a character with an inventory, and using quite simple inventory adding/losing scripting, with a variable for the amount of money.

I was also thinking of making something that uses this, because it could be very interesting in an AG to have to think carefully what to buy. :) Personally, I'm less interested in the otehr aspects of RPG.

Great thread btw terran ;).
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moox on Sat 08/05/2004 23:12:34
You could also use the point system built in to ags as money
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: TerranRich on Wed 12/05/2004 01:29:10
Yes. Either the score system or an inventory item could act as money. You could actually use inventory items for every attribute. For the custom inventory GUI (search for this info somewhere else), you could list each "item" as an icon representative of the attribute. For example, health could be a heart, then clicking on it would display the health in a label somewhere else on the inventory GUI. This GUI could also be constantly on, replacing the Sierra-style action icons. Or something. It's an idea! :P
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Thu 13/05/2004 14:12:05
Using another characters inventory for this purpouse would leave the players inventory free...

character[CHARID].inv variables...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Thu 13/05/2004 17:13:08
Yeh, Im currently working on a Pokemon Style game.

Ive done everything using GlobalInts - Money, monsters, attributes and items.

I just used a different global int for each item and displayed in an item screen using rawprint functions.

The battling I did by Dialogs, that was rough - mainly cos of monster switches during battle.  If it was 1 character RPG I recon that would be quite straightforward.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Wed 19/05/2004 02:18:11
You say you are working on a Pokemon style game eh?
How exactly do you script the attacks? Or do you simply compare the monsters HP, Defense, Attack, etc. and decide the winner???  I ask only because I would like to make a similar game and cannot figure it all out!  Why is this so time consuming!!!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moox on Wed 19/05/2004 02:22:25
using the random comand store the result as a global int and subtract that amount from the hp
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Legge on Wed 19/05/2004 08:49:32
Could someone help me here? is the stats thing in: game / global functions, unitled, script language keywords or setting up the game? beacuse I'm not good on these names and so.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Wed 19/05/2004 12:33:38
I dont seem to understand your question, your asking how to use globalint?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Legge on Wed 19/05/2004 14:28:46
Well i searched for globalint but i didnt find any helpful tutorial...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Wed 19/05/2004 14:33:16
Battle script is roughly:

Reads what monster you have in battle, (done with global ints) then depending on that allows certain dialog options for the moves they can do. Each option runs script x in global script which minuses a value from the enemy HP Int. then enemy does random attack health bars change etc. then repeats until either enemy HP = 0 or you have no monsters left.

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: TerranRich on Mon 31/05/2004 06:44:17
Legge: You're absolutely right, there is nothing really in the AGS manual. I will be adding a BFAQ entry shortly.

GlobalInts, or Global Integers, are a set of 100 variables that can be accessed anywhere in the game using script. Set a global int with SetGlobalint() and get the value of one with GetGlobalInt().

SetGlobalInt(int variablenumber, int value);
Example: SetGlobalInt(47, 20); will set global int #47 with a value of 20.

GetGlobalInt(int variablenumber);
Example: GetGlobalInt(47); will return the value stored in global int #47. Note that this is not a complete command. Treat this like you would a variable; set it to something, or display it somehow. Use it as the object of a command, in other words.

Keep in mind that global ints, like just any other int variable, will only store numbers in the range of -32768 to 32767. There are also GlobalStrings. Look 'em up. :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gilbert on Mon 31/05/2004 06:53:35
Quote from: Moebius 5.18 on Mon 31/05/2004 06:44:17
Keep in mind that global ints, like just any other int variable, will only store numbers in the range of -32768 to 32767. There are also GlobalStrings. Look 'em up. :)

Terran, in AGS only short variables are of 2 bytes, an int variable occupy 4 bytes, so the range should be -2,147,483,648 to 2,147,483,647.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: TerranRich on Mon 31/05/2004 08:51:48
Ah. I always get the two confused. Sorry! :P
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Edwin Xie on Thu 03/06/2004 05:10:33
So...uh, what do you type in the script for fighting?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Edwin Xie on Sun 13/06/2004 03:31:38
Man, it's taking a looong time for a reply.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Isegrim on Tue 15/06/2004 16:14:06
That could be, because your request is a bit... "problematic" to answer...  :-\

To be straight, honest and exact: Find out yourself. The script for that will most likely be quite long and complicated. People have written about the general idea behind such scripts, so you can experiment in that direction.

Besides: I don't think that there is "the" roleplaying combat script. You will have to design one to your liking...

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Edwin Xie on Sun 27/06/2004 01:37:08
Lets see how I can make one like runescape.......
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sun 27/06/2004 19:58:05
Hello every one

I've been thinking about making a sort of RPG game with ages. My basic idear is to alow the player to "live" in the wourld for as long as thay wished. While still having a task to compleat.

So I was wondering if it would be possible to generate randome quests based on a nomber of templats. like one template could be to rescue a person or to find an item.

about the battle system you guys were talking about, I've always thought the one in Quest For Glory was realy good.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moox on Sun 27/06/2004 20:10:41
Im making one like runescape. neverwinter nights, and diablo currently Edwinxie

Disthron, You could script all the quests and use random to pick one
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Edwin Xie on Sun 27/06/2004 23:35:36
Umm, making one like runescape, neverwinter nights and diablo doesn't mean it has to be the exact same thing.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Mon 28/06/2004 08:19:21
LostTraveler : Could you use the random funktion to.... let's say put a random pre-defined charecter in a room.

Also could you use the random function to change the destination of a door way. Like if you maid a buntch of rooms that all fit together and so you can swop and change them?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moox on Tue 29/06/2004 20:23:13
Im not to sure about the char, but im currently making a random dungeon generator that swaps rooms

Use the random command and new room ex command
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Wed 30/06/2004 12:59:54
that's interesting LostTraveler. Are you planing to randomly generate the dungen as the player gows (so that the dungen will change) or are you going to generate the dungen before the player gets there. (so that all the rooms stay in place)?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moox on Wed 30/06/2004 21:58:21
the later
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sun 11/07/2004 15:49:46
If wanna make RPG games, you should use programs for make RPG's like RPG maker 2000 or RPG maker Advanced...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: JD on Mon 12/07/2004 18:43:59
http://home.quicknet.nl/qn/prive/jjj.dekker/rpg.rar Something me and Chrille made a long time ago. It's an rpg (just a start though) and it's a bit like those old console RPGs. You can walk around, and encounter random monsters and fight them. It just shows it is possible to make it in ags :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Fri 30/07/2004 20:04:05
i have succesfully completed a battle system in AGS.  I used an object that changes sprite slots to show your enemy.  And it is a one man RPG, so that makes things easier ;D.  I ran the attack commands through a GUI.  When the GUI is on, you chose your attack, and then the GUI script handles the damage, sounds, and overlays.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Thu 05/08/2004 13:25:38
Hmm, interesting topic... but AGS misses a tile engine, which would make the map creation easier... i wonder if it's possible to make a plugin to implement the tile engine...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gilbert on Fri 06/08/2004 02:42:26
You can make a tile engine with rawdraw yourself.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sun 08/08/2004 15:34:00
Thanks, I didn't think about it... Actually, at the moment I don't know the rawdraw functions and their possible applications. Maybe I'll work on it soon...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Sat 21/08/2004 19:57:49
Hello :) I'm also working on a RPG with AGS. I've made the battle script. The weapons and the magics are inventory items, and you use them on the hotspots.
if (ahmet == 0) {   
   NewRoom(12); 
      }   
ahmet -= 3;
PlaySound(1);
Display("You hit the monster."); 
Display("The monster's health reduced 3 units");
GiveScore(-2);
PlaySound(2);
PlaySound(3);
Display("The monster hit you and your health reduced 2 units");

"ahmet" is the health of the monster you fight.
But I have a problem. I want the mana and exp. info be written on the GUI. They are GlobalInt. The HP can be showed in the status GUI, because it's the game score. (@SCORE@)
Thanks :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mousemat on Sat 21/08/2004 21:25:40
i want to make an rpg but i have no idea were to start. maybe the next upgraded ags should have a battle making system.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Mr Jake on Sat 21/08/2004 21:33:32
it already has... its called coding
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Edwin Xie on Sun 22/08/2004 06:57:07
Can't @score@ be your HP? Or would the game end after your HP is full?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mousemat on Sun 22/08/2004 09:32:35
Quote
it already has... its called coding


......without coding
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Sun 22/08/2004 14:51:05
This is a really phenominal task if you think about it. There is no one kind of "battle system". There aren't even a couple of types, and within any types you can define, there are tonnes of variables/differences/etc in the way they work. This is why Hotspot said, "Coding". The only way to do it without using a completely generic battle system is to sit down, think about how you want it to work, and then work out how to code it yourself.

The other thing you have to keep in mind is that this is an adventure game engine, and we can't expect CJ to go to such an extent for people who want to try their hand at RPGs.

If you don't mind using a generic battle system then, your only option is to wait for someone else to release a template with their own, really.

Coding a battle system is frustrating (I'm doing one myself) but it's really worth it to see it working and know it's your own. For example, I'm trying to make mine taking all the individual components of other battle systems I've come across that I liked best and putting them all together. Hopefully, it'll work out well.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Mr Jake on Sun 22/08/2004 15:07:16
Yes, what I meant to say is, this IS an Adventure engine so we cant expect CJ to make a duel RPG/adventure engine.. If you want a battle system learn to code it or wait for someone to realease a plugin.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Sun 22/08/2004 17:22:46
Quote from: Edwinxie on Sun 22/08/2004 06:57:07
Can't @score@ be your HP? Or would the game end after your HP is full?
It's already so. I had been using @SCORE@ for HP. But I don't know what to do with the mana and exp. I want them to type on the GUI, too.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Sun 22/08/2004 17:34:24
I think it's something like this (but with the right GlobalInts, and GUI / Label numbers, of course):

(in rep_ex)
string mana;
string exp;
StrFormat (mana, "%d", GetGlobalInt (2));
StrFormat (exp, "%d", GetGlobalInt (3));
SetLabelText (0, 1, mana);
SetLabelText (0, 2, exp);

And make two blank labels on the GUI.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Edwin Xie on Sun 22/08/2004 22:57:02
Quote from: CoolBlue-Gord10 on Sun 22/08/2004 17:22:46
Quote from: Edwinxie on Sun 22/08/2004 06:57:07
Can't @score@ be your HP? Or would the game end after your HP is full?
It's already so. I had been using @SCORE@ for HP. But I don't know what to do with the mana and exp. I want them to type on the GUI, too.

Maybe trying multiple score?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Mon 23/08/2004 00:16:17
Thank you, Ashen :) It runs. Edwinxie, how can I script the multiple scores?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Mon 23/08/2004 18:58:35
For the future, a feature of AGS I found that could help people in coding battle system stuff is this littel bit:



You can include a couple of variables into global (and local) messages. You do this by inserting special tokens into the message. When the message is displayed in the game, the engine replaces the token with its value:

token   replaced by
@INx@  number of inventory item x that the player has
@GIx@  the current value of GlobalInt x (used with SetGlobalInt/GetGlobalInt)




Just a thought...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: BlackMan890 on Tue 24/08/2004 16:58:00
If you want to make an RPG without coding, i suggest using

rpgmaker 2000

or

rpgmaker 2003

NOTE, DONT and i mean DONT post for help in agsforum
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: PyroMonkey on Tue 24/08/2004 23:55:15
This is the real cool thing about AGS, its so adaptable, you can even, with proper scripting knowledge, create an RPG with Crono Trigger-ish battles, where monsters walk around and stuff, or just about any type of battle system.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moox on Wed 25/08/2004 00:07:35
Im long into the process of making an rpg/mmorpg. Its not that hard to do, untill I try multiplayer. Just practice...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Edwin Xie on Fri 27/08/2004 06:58:35
Quote from: CoolBlue-Gord10 on Mon 23/08/2004 00:16:17
Thank you, Ashen :) It runs. Edwinxie, how can I script the multiple scores?

How about doing a label that says Mana and exp and to change them use SetLabelText?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mousemat on Sat 28/08/2004 22:47:37
can i make a score go up and then when you reach a certain number the fight ends?
because i wanted to make a boxing rpg!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Sun 29/08/2004 15:49:25
if (game.score) > ...and so on...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mousemat on Sun 29/08/2004 20:12:36
hi everyone

i have a problem i can make my character atack the oponent but how do you make the oponent atack the my character?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Mon 30/08/2004 16:56:04
What kind of battle system are you using? A little more3 detail needed before I can offer any help...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Mon 30/08/2004 18:49:25
I hope it works

PlaySound(1);
Display("You hit your enemy."); 
GiveScore(3);
if (game.score) >= 8 {
  NewRoom(2); //Defeated enemy
  }
if (game.score) < 8 {
   SetGlobalInt (2, GetGlobalInt(2)+2); //GlobalInt 2 is your health
   PlaySound(1);
   Display("Your enemy hit you");

And you should add this to the repeatedly_execute
if (GetGlobalInt(2) <=0) {   //Health is over
    NewRoom(30); //The game over screen
}
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mousemat on Tue 31/08/2004 08:17:32
ok i will try out that script.Under what heading do i put the first script
kinoko  i am using ags of course
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Mr Jake on Tue 31/08/2004 08:21:16
lmao
she means what type of battle system, turnbased, realtime etc.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mousemat on Tue 31/08/2004 08:29:08
i would like to make an altime atck kind of one but it would be easier to do a turnbased one wouldnt it?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Mr Jake on Tue 31/08/2004 08:31:36
maybe, the main problem is that alot of people that seem to be trying to make a battle system haven't discovered 'SetLabelText' and how to use ints effectivly
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Tue 31/08/2004 08:33:00
For a realtime battlesystem:

All you need is a randomizer for the enemy attack, the scripts for the player attack (like, attack when space is pressed etc), and make sure the actions are not blocking...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mousemat on Tue 31/08/2004 08:36:26
how come there are no tutorials on making a basic rpg .
It would definitly come in handy.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Mr Jake on Tue 31/08/2004 11:47:38
There are non because no one has wrote one...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Wed 01/09/2004 08:06:47
It seems that everybody want's to make an rpg, but no-one actually has done yet, or if someone has, they are not that experienced or motivated to write a tutorial about it. I've been coincidering making a comical, short, first person rpg, but I'd have to be really bored to write a tutorial baut it, because I'm not a tutorial writing type person.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Wed 01/09/2004 17:46:46
An RPG is a difficult thing to write a tutorial because there's no one centralized kind of RPG. I'd be happy to write a tutorial on the style of RPG I'm doing -after- I make my game. There's no way I'm writing one on all the different ways it could be done though.
Title: What About Death
Post by: ags_newbie on Mon 06/09/2004 17:08:35
Suppose you wanted a realistic game. If your charachter were to die, how should you do it? One solution is just not to do it at all, just put them in a hospital or something. Another might be to restart the game, or restart the game with anothe charachter.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Wed 08/09/2004 15:58:59
You don't want to use the standard "Game over" after death? The hospital idea reminds me of 'It Came From The Desert' (great game!) and that worked quite well, allowing you to continue on in the game, albiet putting you in an annoying position, after you've screwed up or failed at something. Restarting the game with another character reminds me of Maniac Mansion or (and this is a far cry...) the Ninja Turtles game. In that, if you "died", you were actually captured by the enemy and the player got the pick a different character to play with. At one or two points fduring the game, you got the opportunity to 'rescue' your lost players which I always thought was a nice touch.

Still, I'm rambling. I'm not entirely sure what you mean, could you explain in more detail? In a typical RPG, if your character dies, it's just game over and you load one of your saved games.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Tue 14/09/2004 15:35:10
Quote from: Kinoko on Wed 01/09/2004 17:46:46
An RPG is a difficult thing to write a tutorial because there's no one centralized kind of RPG. I'd be happy to write a tutorial on the style of RPG I'm doing -after- I make my game. There's no way I'm writing one on all the different ways it could be done though.
A tutorial about making RPG's with AGS would be useful for the beginners. I'm thinkikng of developing a demo game with source code called "Quest for Blue Cup" which teaches the scripts for RPG's.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Mon 25/10/2004 15:11:00
Is there someone so kind and patient, to write me (or at least explain me) how to do something like: when you reach a certain amount of points (experience points, in the matter), it displays "level 2" then "level 3" etc.
Not only this, but a lot of other things, like the possibility to use some objects you couldn't, and other stuff.
The question is: how to make something change permanently, when you reach a certain amount of points (to change again when you reach an higher amount of those).

Thanks, to all who will answer (helpfully ;D)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Mon 25/10/2004 20:31:52
You need to set a GlobalInt for exp points. For example SetGlobalInt(10,0);  Then add this script to the repeatly_execute:

if (GetGlobalInt(10)>=60) {  //When you have 60 exp. points
   Display("You gained level and now you are Level 5.");
   AddInventory(11);  //A new weapon
   SetLabelText(0,7,"Level 1"); //Setting the text on the GUI.
    }

And let me tell you how to show the text on the GUI: First add a "GUI Label" on the GUI where you want to show the text. SetLabelText(0,7,"Level 1"); is the script for setting it. 0 is the number of GUI, and 7 is the number of the object.

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: poc301 on Wed 03/11/2004 02:44:28
Interesting reads..  I will be doing a RPG (began planning it out today), and I have pretty extensive experience in various programming languages, including C, so this isn't all that daunting.  However, I am unaware of any way to get back to the game after a fight...

For instance :

Meet a hostile creature and go to room 100 (the fight room)

room 100 has the fight script.  If the EGO loses, they go to screen 101 (the death script). 

But if they win, is there a command I can use to return them to the last place they just were in the game before they loaded room 100 for the fight?  I couldn't find anything on this in a search.

Thanks,

Bill Garrett
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moox on Wed 03/11/2004 03:30:18
You could check what room the char is before they teleport and then go there using newroomex command
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Wed 03/11/2004 06:59:12
NewRoom(character[GetPlayerCharacter()].prevroom);

If you need to tweak the coordinates, check NewRoomEx...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Thu 04/11/2004 04:05:31
Generally RPG's require a lot more variables than adventure games. You will want to have different int-values for monster default hps, attack skills, mana levels, gold possession, current prices in the marketplace, character xp and stuff like 'current ventroliquism-skill success probability' to mention a few.

I'm making an adventure game that has traits of both strategy and rpg (you do space battles against pseudorandom spaceships and hex-tiled ground combat with troops when boarding), and needles to say I ran out of GlobalInts early on. So for those of you who plan to make a complicated RPG, remember that you can add new globals, and that arranging them in arrays make them fairly easy to work with.

Say you have a band of four adventurers in your RPG, and that each of them need at least 10 global ints to store their data, Ã, say :

max_hp
current_hp
max_mana
current_mana
current_xp
xp_to_next_level
melee_attack_skill
melee_damage_category
ranged_attack_skill
ranged_damage_category

In this case you could make an array of 40 ints (10 for each 4 players):

//------------------------syntax
int player_ints[MAX]; // typed at the very top of the global script

export player_ints; // typed at the very bottom of the global script

#define MAX 40 Ã, //no semicolon!
import int player_ints[MAX]; // both last typed in the script header
//------------------------

Now you can assign the values for each character to the ints in the array. Say you want to start out with default Ã, values, you can go:

player_ints[0] = 20; //player one starts out with 20 max hps
player_ints[1] = 20; //current hitpoints are also 20 by default
...
...
player_ints[39]=10; //player 4 ranged_damage_category

Ã, 0-9 now holds the same values, in the same order, for player 1 as
10-19 does for player 2,
11-29 for player 3, and
30-39 does for player 4.

The smart thing about arrays (as they pretty much have to substitute the idea of 'structs' or 'objects' used in other programming languages) is that you can access them Ã, easily, if you arrange them nicely (like above). This is handy, because somewhere in your game you're going to have a function called something like

function player_take_damage(int player, int damage)
//where player is player 1,2,3 or 4 and damage is expressed in hps
{
//this is the cryptic part
player_ints[(player * 10) - 9] -=damage;
}

The cryptic part, (but the smart one when you get it Ã, 8) ), is doing calculations inside the array-brackets. If the 'int player'-argument passed to this function was 1, you would get: Ã, 
Ã,  Ã,  player_ints[(1 * 10) - 9] -= damage;
The calculation is done inside the brackets and equals:
Ã,  Ã,  player_ints[1] -= damage;

As you will remember from above, player_ints[1] stores the current number of hps for player 1. If we had passed 2 as the 'int player'-argument to the function,we would have:
Ã,  Ã,  player_ints[(2 * 10) - 9] -= damage;
equals:
Ã,  Ã,  Ã, player_ints[11] -= damage;
11 being the array-index that stores player 2's current hps.

Thus the damage is subtracted from the right player's hps (as long as you pass the right argument t the function), without using hard-to-debrace if-statements or worse: separate functions for same calculations on different players.

In a RPG that uses many characters, monsters. treasures or random-rolls, you will want your functions to be able to do the same calculations for different entities, and structuring your arrays like this, which allows you to do calculations inside the array-index-brackets, can almost substitute features of more object-oriented programming languages. You can make different arrays to hold the values for monsters, randomly generated rooms, treasure-types, spells and so forth. You can even use the calculated indexes inside other calculated indexes' brackets eg.
int a = player_ints[ monster_ints[3+b] * 10 ];

Good luck making your RPGs, I'm sure it's possible this way, even without objects or structs (although they may soon become officially supported by ags), besides AGS comes with a bunch of graphics features that will give you a good headstart compared to coding your RPG A-Z in C, Java or C++.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Thu 09/12/2004 14:52:35
I thought I'd post this here in case anyone else was interested in a way to get that classic SNES RPG HP display. You know, the one where the damage appears atop the character's head and animates in some way? I've got it appearing above the damaged character's head and dropping down (with a little bounce) before disappearing. Of course, tweak this code to suit your own needs.

First of all, create a function like this:


function DamageChar (int hurtchar) {
  sit=0;
  int it=0; //running index, to check if there's a free slot for text
  while (it<10){
     if (damchar[it]==0){ //if a slot is available
        damchar[it]=hurtchar; //set it to "occupied"
        damoverid[it] = DisplaySpeechBackground (hurtchar, dmgreport);
     if (sit == 0) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-30);
        it=20; //break out of loop
      } else it++;
    }  //end while
  }


Then, in repeatedly_execute (/_always):

--Put here whatever code you use for calculating the injury to a character at the time it is attacked--


  StrFormat (dmgreport, "%d", mondmg);
  DamageChar (XXX);


** Replace XXX with the character's name, and "mondmg" is the integer my calculated damage went into. If you'd like a word, for example "YOU MISSED", just use " StrFormat (dmgreport, "YOU MISSED"); "

Then elsewhere in repeatedly_execute (/_always):


int it=0; //checks all slots for whether the speechs had expired
while (it<10){
  if (damchar[it]){ //if there was a message for this character
    if (IsOverlayValid(damoverid[it])) { //Is it still displayed?
         sit++;
         if (sit == 3) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-27);
         else if (sit == 6) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-25);
         else if (sit == 9) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-22);
         else if (sit == 12) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-18);
         else if (sit == 15) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-14); 
         else if (sit == 18) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-9);
         else if (sit == 21) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-4);
         else if (sit == 24) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y);
         else if (sit == 27) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-7);
         else if (sit == 30) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-10);
         else if (sit == 33) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-8);
         else if (sit == 36) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y-5);
         else if (sit == 39) MoveOverlay(damoverid[it],character[damchar[it]].x,character[damchar[it]].y);       
    } else damchar[it]=0; //Expired, mark it as "free"
  }
  it++;
}


As I said before, that's just my own action of the text falling. You can do anything you want here. In fact, the more creative, the better! I'd love to come up with a way to make the text perform a movement, then actually fade out, or "fold in on itself" as happens in some RPGs. There are all sorts of things you can do.

Big thanks to Gilbot, Strazer and others for helping a LOT with this.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Sun 30/01/2005 17:00:13
Hey, I have written a RPG tutorial.

http://www.geocities.com/akk13us/rpg-tuto.htm
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: fred on Sun 30/01/2005 19:19:34
Good job, CoolBlue - I've read your tutorial, and Im sure it's gonna be helpful to people making rpgs with ags.

A little c&c: perhaps you could include more illustrations, maybe a shot from the finished game as the player would see it - because rpgs can be so many different things. 

Also, you write that player health is set to 7, when it's actually set to 5 with GiveScore(5); if I'm not mistaken.

That's about it - good job. I like to see people sharing their experience.

Btw. Isn't somebody on the forums making a collection of ags tutorials? Did you contact him/her?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Sun 30/01/2005 20:15:02
Thanks Fred :) Yeah, you're right. Player's HP should have been 5. I'll fix it.
Haven't contacted such a person yet.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Wabbit on Sat 12/02/2005 00:06:28
Quote from: Def on Mon 12/07/2004 18:43:59
http://home.quicknet.nl/qn/prive/jjj.dekker/rpg.rar Something me and Chrille made a long time ago. It's an rpg (just a start though) and it's a bit like those old console RPGs. You can walk around, and encounter random monsters and fight them. It just shows it is possible to make it in ags :)
Played your game. It was addicting. Will you release the source code? Thanks for the cool RPG game.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sun 13/02/2005 14:19:58
Could you make one work on clock ticks?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Mon 14/02/2005 03:47:01
I think you're going to need to flesh out your question a little more.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Freydall on Fri 11/03/2005 22:12:53
How do you make an second inventory for other things e.g. One inventory for your items and one 'inventory' for different attacks in fighting like thrust, slash, chop etc. that would only be available when fighting.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Fri 11/03/2005 22:24:43
Use an NPC character, or create a dummy character for the purpose. (Each character has their own inventory.)

With the newest (beta/RC) version (2.7), you can display NPC inventories, and have multiple character inventories displayed on the same GUI, which makes it easier than it used to be.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: JJJAC55 on Fri 18/03/2005 00:50:38
Is there any easy way to make as shop, using GUIS instead of a million dialog things
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Fri 18/03/2005 03:22:03
You could just create some GUIs for the different options (buy, sell, armour, weapons, whatever you want), with some List Boxes containing the items/options, and have said GUI(s) appear when you talk to the shop keeper.

That's pretty simple ^_^

To be honest, I would never consider using dialogue to create a shop system. GUIs are the way to go. I personally wouldn't use list boxes myself, but I like to be complicated.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Fri 18/03/2005 06:55:15
I've been thinking up a shop usinv GUIs, but I hit a wall with AGS handling two diffrent size inventory windows poorly... Better wait a bit and see then again.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: JJJAC55 on Fri 18/03/2005 22:18:30
alrighty then - i guess that helps alot.  but can u actually show me the GUI script or at least tell me basically how to do it because im still pretty basic in the language. thanks
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Fri 18/03/2005 23:01:06
The idea is that the shopkeeper characters have the items they can sell. Clicking the items on the inventory in the trade GUI runs the buying or selling action, whichever is in question. I have separate, invisible characters for the shopkeepers etc. which I move to the exact same coordinates and room as the player, and before opening the sell or buy GUI I change the player character to that character. When the trade is done, and the GUI is closed, I just return the player character to the original one. It's quite simple and works well, apart from that you can't see the stuff in the players inventory then. Atleast not in 2.62, haven't tried the 2.7 betas...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: JJJAC55 on Mon 21/03/2005 16:25:10
arg i dont know how to do that either, can you show me specifically how to do it?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sat 26/03/2005 06:05:35
You want a GUI based shop system huh?

Create a GUI with buttons "Buy" and "Sell"
If "Sell" is clicked open the inventory window.  The player chooses an item, then click on the shopkeeper with the item.  Money is added to the players bank/wallet and inventory item is lost.
If "Buy" is clicked open new GUI with buttons labeled "Item Whatever", "Other Item" and so on.  Player clicks on button and is prompted with a text box "Buy this item?" Player types "Yes" or "No".
If "No" is typed, return to "Buy" "Sell" GUI.
If "Yes" is typed, lose money from Bank/Wallet and gain inventory item.  Return to "Buy" "Sell" GUI.


It doesn't get much simpler unless you use text boxes.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Mon 28/03/2005 17:29:44
i understand that it sounds very easy, only, how do you type that into a script?
i used this for the sell button:

if (interface == the name of the GUI) {
  if (button == 2) { // show inventory
   show_inventory_window();

but i think that it doesn't matter if you use a special sell  button or just the inventory,  you just have to let the salesman interact with all the objects that could end up in you inventory (maby long work?)

I don't now how to write a script for the buying.
Can someone please explain that to me?

Thanks,
an AGS-beginner
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: TerranRich on Fri 08/04/2005 14:39:48
You really need to learn scripting before you even attempt to make an AGS. Check the manual, check the many tutorials available for you from the AGS home page, do everything you can (even learning programming basics about C and C++) to learn about scripting. We won't always provide your script for you.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Fri 08/04/2005 21:38:55
Quote from: TerranRich on Fri 08/04/2005 14:39:48
You really need to learn scripting before you even attempt to make an AGS.

Erhm... you gots a little typo there Mr. Rich, methinks... :=
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Scummbuddy on Sat 09/04/2005 12:58:10
well, of course he meant RPG, but it would still hold true for anyone attempting an AGS...  ;)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ishmael on Sat 09/04/2005 13:05:45
Quote from: Scummbuddy on Sat 09/04/2005 12:58:10
well, of course he meant RPG, but it would still hold true for anyone attempting an AGS...Ã,  ;)

Indeed :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: JD on Fri 15/04/2005 10:21:57
Quote from: Wabbit on Sat 12/02/2005 00:06:28
Quote from: Def on Mon 12/07/2004 18:43:59
http://home.quicknet.nl/qn/prive/jjj.dekker/rpg.rar Something me and Chrille made a long time ago. It's an rpg (just a start though) and it's a bit like those old console RPGs. You can walk around, and encounter random monsters and fight them. It just shows it is possible to make it in ags :)
Played your game. It was addicting. Will you release the source code? Thanks for the cool RPG game.

I don't think I have the source code anymore :( Chrille might still have it somewhere though.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: TerranRich on Fri 15/04/2005 20:20:23
Quote from: Ishmael on Fri 08/04/2005 21:38:55
Quote from: TerranRich on Fri 08/04/2005 14:39:48
You really need to learn scripting before you even attempt to make an AGS.

Erhm... you gots a little typo there Mr. Rich, methinks... :=

Heh, so I do. But yeah, I meant an AGS game, of course. ;)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Mon 23/05/2005 03:23:00
I am not very familiar with RPGs but I think I tried one recently (God of Thunder or something similar).   Anyway I noticed how this one did room transitions.   If you walk right, for example, when you reach the right edge of the room everything would quickly scroll left until the new room was fully on the screen.  This gives the illusion that it's one continous room.    So I guess  I have 2 questions:

1.  Is this behavior typical of RPG's or did I just get lucky and try out an oddball one?

2.  If AGS supported this kind of room transitions would it be helpful and/or desireable in making RPG type games?

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gilbert on Mon 23/05/2005 05:06:39
2. There're no built-in transitions like that at the moment (notice that some of the Sierra SCI games used scrolling for room transitions), it can be done to some limit, though, is that you can use a large scrolling room, and SetViewPort() for this behaviour (trivial), however, for large scenes or cases where you certainly need DIFFERENT rooms this won't work. As far as I remember, similar thing had been suggested before, however, it's been a VERY long time ago, I remembered one of my first posts in the forum was a suggestion thread including suggestions for more screen transitions (that includes cross-fading and scrolling, seeing that only 256 colour modes were suppported at that time I suggested something like hasing the screen palette to 16 grays for the transitions to work and then fade them back to colour afterwards), which was around AC V1.13 or V1.14, long lost post since it's posted in the last millenium...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Tue 24/05/2005 05:49:42
I wouldn't say it's typical, as such, of RPG games, but some do have it, certainly. The first one that springs to mind is Zelda. I wouldn't use it in my RPG personally, I'm just having normal rooms, not seperating my dungeons into a grid. As Gil said, it's been asked before and I think there are some complicated work-arounds but... more than I'd want to bother with. Some people would probably find it useful.

I'm curious myself as to how commercial games with this feature work it.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Tue 24/05/2005 06:33:23
Quote
I wouldn't say it's typical, as such, of RPG games ...
Do they then just fade from one room to another or do they do something entirely different?

Quote
I'm curious myself as to how commercial games with this feature work it
I'm not sure what you're asking but the way I envision the implementation would something like this:  When the new room is loaded the image of the previous room is retained temporarily.   The previous image is scrolled off the screen and the new image is used to fill the void left as the previous image moves off screen.   

Quote
I wouldn't use it in my RPG personally,...
Is it because it's currently not possible and/or other implementation issues or is it because of game aesthetics?  I'm just curious?

=========

I could also see this as being useful in doing map or driving type things.


I am also curious as to what other difficulties there are in making RPGs with AGS.  Do you have any thoughts about this?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: strazer on Tue 24/05/2005 06:41:38
As for the room slide transition, I tried the method you suggest a while ago (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=21310).
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Tue 24/05/2005 10:19:43
A lot of them just have big rooms and you go from room to room.. er, if you know what I mean. As opposed to a "grid" system. Just a normal transition.

I wouldn't use it in mine because of aesthetics, I guess. I'm basing my game on games like Secret of Mana and Terranigma... they just have rooms, you leave them, go to another room.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Mon 30/05/2005 04:15:16
Thanks for your reply.  I am looking forward to playing your RPG when it's finished. 
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: X-Hunter Blackzero on Sat 11/06/2005 01:41:09
I'm trying to make a turn-based system of combat.  Could someone help with the scripting?  I sort of have some figured out but not much...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Sun 12/06/2005 03:38:19
Well, what have you got figured out so far? Also, could you give some detail on how you want it to work?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 12/06/2005 03:50:01
I think you could do a room transition with an object, no?  You could change the default transition to "instant".  Then you make an object that is 320x200 or whatever your resolution is, then animate it starting with room1 graphics and scrolling into a room2.  You put said object in room1, then when player walks onto region that moves to room2, you animate the object using blocking, so when the animation is finished, the player is transported to room2.

Since the transition is instant, the only thing noticable is that the player character stays stationary.  (I'm assuming you've already made said object's baseline so character could be seen  ;D )  You could fix this by...well...I dunno maybe the character shouldn't be visable during the transition, either way you get my point.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Sun 12/06/2005 13:35:34
It's one waym but it would mean you would have to be sure nothing in either room could change. It wouldn't work in say a Zelda game with bushes you could chop down, or any scene with enemies that move or could be killed.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 12/06/2005 20:46:15
nonsense, if you set the object's baseline to the top of the sceen, and it is set as object 0, then everything will appear atop it, or if that wouldn't work (dunno I haven't actually tried it) you could have the objects default graphic set to 0 so it was transparent, then change it to the scrolling graphic when character stepped on region (again this would probably make everything dissapear during transition).  I think with CJ's next update he should add a transition function...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: X-Hunter Blackzero on Sun 12/06/2005 21:40:44
Well i have how the proagram will keep track of each monster, done with global variables so i could have the same monster in multiple rooms.  And i have how the program will keep track of stats and such..... i just have trouble with how turns will work....


I guess my question is "How would i make the combat system itself turn-based"  I have most everything else for a good combat script.   My system will be similar to Final Fantasy X sorta.....
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 12/06/2005 21:46:21
I'd suggest either comparing a speed stat for for determining the first player or always letting player go first, then using either a GUI or run-scipt X in dialogue commands so the player can choose his/her attack, then randomely choosing an attack for the monster (depending on which monster is out), and if all this is located in the room's repeatedly excetue,you could go ahead and put your "dead check's" after each monster/player turn and since it repeats it would go on until someone died!!!

can't breathe.....all one sentence!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: theswitch on Sun 19/06/2005 19:09:49
Quote from: Def on Fri 15/04/2005 10:21:57
Quote from: Wabbit on Sat 12/02/2005 00:06:28
Quote from: Def on Mon 12/07/2004 18:43:59
http://home.quicknet.nl/qn/prive/jjj.dekker/rpg.rar Something me and Chrille made a long time ago. It's an rpg (just a start though) and it's a bit like those old console RPGs. You can walk around, and encounter random monsters and fight them. It just shows it is possible to make it in ags :)
Played your game. It was addicting. Will you release the source code? Thanks for the cool RPG game.

I don't think I have the source code anymore :( Chrille might still have it somewhere though.

WOW, this is THE RPG demo for AGS, I got really pumped when I tryed the demo, it seems even better than RPG Maker stuff, I'm not interested in the retro console look but who cares, it actually works and it works well, I'm interested in if there could be any notes on how you made it, any pointers I mean. not a tutorial, this is very cool, it kinda makes you go "man AGS is the way to go" with rpgs. I guess the reason I say that is with 2.7 the coding seems much easyer (I'm a newb but experenced with other easy languages, java etc)

I am also very interested in making a game with random stuff, a space trading game actually, you know elite, freelancer etc but 2D and not flashy 2D, somthing similar to this. . . if your interested http://www.nielsbauergames.com/smugglers3.html
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Thu 14/07/2005 01:55:19
I think that the BEST advice is to learn for yourself. What I mean is come up with an idea, try it out, find out why it doesn't work, correct it, try again, and so forth until it does work, go on with the next idea...

Then you will have learned everything so that when you get an error you'll know exactly what & where the error is...
Besides you'll will have learned for yourself that you can do it.
It is the best way.
P.S. If you get stuck, then ask someone for some help, but you will get more out of it if you do it yourself.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Tue 20/09/2005 20:21:07
This is merely a question, but did someone already think of making (a few) tutorial(s) about making an RPG? I know about the tutorial from the guy who made Asporia, but I'd like to see more RPG tutorials around. I'm just a beginner, so I can't do that myself...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Wed 21/09/2005 06:43:22
As I've said before, the problem is that there's no one kind of RPG. It would be a heck of a task to write a tute on RPGs in general. Realistically, you have to write about a specific kind of RPG, or even just the mechanics of one aspect of an RPG. Much like how different a 90's Lucasarts adventure game is from an old text adventure.

I just want to say that Law's advice was spot on. Think of what you want in your RPG, try to work out how you could script it, try it, and if it doesn't work, try to fix your mistakes etc. In the end, ask for help/advice.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Sun 09/10/2005 15:42:00
I'm currently searching for a turnbased scripting tutorial. I'm also searching for GUI's with character display (Portrait, HP, MP, XP) for about 4 or 5 characters, or at least for codes which I can easily add in one.

See, I'm already setting up plans for a second (RPG) Elestian Tale, but I'm not the best coder... Don't worry, I'll finish Bittersweet Sanity first.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 09/10/2005 16:46:59
I believe I have a pretty simple code for your turn based GUI's.Ã, 

-Make A GUI called...um...YOU
-Two buttons, button 0 is simply the image of your character's portrait.
-Button 1 is just going to sit there for the moment.
-Make a label and place it over button 1.
-Okay, here comes the code...

In repeatedly_execute:


string health;
string maxhealth;
string magic;
string buffer;
StrFormat (health, "Health: %dÃ,  /", GetGlobalInt (?));Ã,  //replace "?" with your health globalint
StrFormat (magic, " Magic: %d", GetGlobalInt (?));Ã,  //replace "?" with your magic globalint
StrFormat (maxhealth, " Max Health: %d", GetGlobalInt(?));Ã,  //replace "?" with your maxhealth globalinlt
StrCopy (buffer, health);
StrCat (buffer, maxhealth);
StrCat (buffer, magic);
SetLabelText (YOU , 2, buffer);



Also, if you don't want to mess with globalints, I believe you can also use 32-bit strings like this (but I'm not used to these)

At game start:


int health;
int maxhealth;
int magic;


In repeatedly_execute:


string guihealth;
string guimaxhealth;
string guimagic;
string buffer;
StrFormat (guihealth, "Health: %dÃ,  /", health);
StrFormat (guimagic, " Magic: %d", magic);
StrFormat (guimaxhealth, " Max Health: %d", maxhealth);
StrCopy (buffer, guihealth);
StrCat (buffer, guimaxhealth);
StrCat (buffer, guimagic);
SetLabelText (YOU , 2, buffer);


Either way, GUI YOU should come out something like this:

PORTRAIT HEREÃ,  Ã,  Ã,  Health: 20 / Max Health: 40 Magic: 33

Hope that helpsÃ,  :)

-Regards, Akumayo
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Tue 11/10/2005 16:50:43
Thank you so much! I'm going to test it right away!

EDIT: Oh, before I forget, how can I get experience done?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Wed 12/10/2005 23:52:10
Hrm...Ã,  Experience is pretty easy, but depending on how you do the fighting system, the code changes.Ã,  Create Globaints for Current Exp and Target Exp.

Ex:

LetÃ,  MPC=MP Current Exp globalint
Ã,  Ã,  Ã,  Ã, MPT=MP Target Exp globalint
Ã,  Ã,  Ã,  Ã, MPL=Current MP Level globalint
Ã,  Ã,  Ã,  Ã, DAMAGE=The damage you just did to enemy globalint

GameStart:

SetGlobalInt((MPC), 0);


Repeatedly_Execute:

SetGlobalInt((MPT), (GetGlobalInt(MPL)*5);
if (GetGlobalInt(MPC)==GetGlobalInt(MPT)) {
//code for leveling up
}


Then when you do damage:

SetGlobalInt(MPC, GetGlobalInt(MPC)+(GetGlobalInt(DAMAGE));


This is just an example, it would make a system where you had to collect 5 times your current level in experience, and got experience every time you did damage, Runescape uses a system similar to this.Ã,  I hope you get the idea, I know my coding was pretty sloppy this time.

-Regards, Akumayo
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Thu 27/10/2005 13:49:35
Thanks!

By the way, is this code up to date with AGS2.7? I'm using that version, and the StatusGUI code I received didn't work fully because it was a bit outdated.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Fri 28/10/2005 00:56:07
No, that code wasn't up to date, sorry...Ã,  Here's the best way to do it in 2.7:

Beginning of Global Script:

int health;
int maxhealth;
int magic;
export health, maxhealth, magic;


In script header:

import int health;
import int maxhealth;
import int magic;


Now create a label over your status GUI called Lstats.

In reapeatedly_execute:

string guihealth;
string guimaxhealth;
string guimagic;
string buffer;
StrFormat (guihealth, "Health: %dÃ,  /", health);
StrFormat (guimagic, " Magic: %d", magic);
StrFormat (guimaxhealth, " Max Health: %d /", maxhealth);
StrCopy (buffer, guihealth);
StrCat (buffer, guimaxhealth);
StrCat (buffer, guimagic);
Lstatus.SetText(YOU , 2, buffer);


I am almost positive that this script is up to date with 2.7, sorry for the earlier inconvinienceÃ,  :-[

This should again display something similar too:
Health: 20 / Max Health: 40 / Magic: 33

-Regards, Akumayo
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: strazer on Sat 29/10/2005 16:54:19
The last part which of course can be shortened to:


string buffer;
StrFormat(buffer, "Health: %d  / Max Health: %d / Magic: %d", health, maxhealth, magic);
Lstatus.SetText(YOU, 2, buffer);
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Tue 01/11/2005 23:06:30
Thanks, I hadn't realized, still living in old v6  :P
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Thu 24/11/2005 12:59:17
Thanks! I appreciate your help!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Wed 30/11/2005 00:56:32
It was no problem.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: mwahahaha on Wed 28/12/2005 12:54:26
I can somehow see this as becoming quite arduous, but possible nonetheless.  Say, wouldn't real-time combat also work... somehow?

Anyway, I think I'll leave massive coding projects to other people, I'm fine with the standard stuff.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Fri 30/12/2005 02:12:55
Yes... Real time would work, but it would work off of characters acting as projectiles and collision detection that would have to be modified for further leniency (as right now, AGS's collision detection is a little off-balance when it comes to projectiles).  I was considering making a real time combat system... maybe I should act on my ideas...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Fri 30/12/2005 19:28:24
After seeing that Hammerite was having difficulty with random battles, I thought I'd pitch in with a simple random battle script that is hotspot based.  This script assumes that you have already coded a battle system.

Create a hotspot that you want the player to find enemies on.  Under the "While player stands on hotspot" script, place:


int findenemyornot = Random(399);
if (findenemyornot == 0) {
  int whichenemy = Random(9);
  if (whichenemy >= 0 && whichenemy <= 3) {
    //code for fighting an enemy that appears 4/10 of the time
  }
  if (whichenemy >= 4 && whichenemy <= 8) {
    //code for fighting an enemy that appears 5/10 of the time
  }
  if (whichenemy == 9) {
    //code for fighting another different enemy that appears only 1/10 of the time
  }
}


This code says that about every 10 seconds, there will be a fight.  Three possible enemies will appear, one 1/2 of the time, one 2/5 of the time, and one 1/10 of the time.  The code should be modified to meet the standards of the area the player is in.

-Regards, Akumayo
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Fri 30/12/2005 19:54:07
Now, this is one useful code, Akumayo!

Have you ever made RPG's yourself with AGS? If so, do you have a link to it? (Sorry is offtopic, but that game can be some kind of example to me.  ;D)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Fri 30/12/2005 19:57:14
I have started a few, but never finished, the best demo of one can be found here:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23809.0

It is pretty sloppy, and mostly abandoned by now, but you may find it useful for ideas.  It uses most of the code I've posted in this thread, plus a little more.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Hammerite on Sat 31/12/2005 11:45:08
some1 should make a module or a plugin for this sort o' thing.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sat 31/12/2005 17:07:21
This thread covered that, making a module/plugin would narrow down the capabilities.Ã,  An RPG is best made by hand, by practice, so that every one is unique, and we don't come off looking like cloners.

EDIT:

Come to think about it, if you had the Advanced Randoms Module ( http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23175.msg285799#msg285799 ), you could shorten my earlier code by quite a lot:

int findenemyornot = Random(399);
if (findenemyornot == 0) {
  int whichenemy = RandomWeightedDice(1, 50, 2, 40, 3, 10, 0, 0);
  if (whichenemy == 1) {
    //script for fighting enemy that appears 50% of the time
  }
  if (whichenemy == 2) {
    //script for fighting enemy that appears 40% of the time
  }
  if (whichenemy == 3) {
    //script for fighting enemy that appears 10% of the time
  }
}


This code would make an enemy appear about every 10 seconds, have three enemies, one that appears 50%, one 40%, and one 10%, but without the nastiness of finding out things like:

if (a >= b && b <= c)

etc.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Hammerite on Sun 01/01/2006 09:52:27
HURRAH!! THANKS!
One more question and I can get started...
how do I make it so if I press the 'x' key when standing next to an NPC, I start a conversation?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 01/01/2006 16:31:39
Assuming you want to be about 20 pixels from the NPC:

if ((player.x <= (cNpc.x + 20) || player.x >= (cNpc.x - 20)) && (player.y <= (cNpc.y + 20) || player.y >= (cNpc.y - 20))) {  //if the player is around 20 pixels from the cNpc
  if (IsKeyPressed(88)==1) { //if they pressed 'x'
    cNpc.RunInteraction(eModeTalk);
  }
}


You'd have to repeat that code for each NPC you wanted the player to talk with, replacing the "cNpc" value with the names of your npc's of course.  As for the first if statement, you'll have to try it out, because I'm pretty sure it will work, but not positive.  So give that code a whirl, and tell me if it works okay.  Oh, and you might find this useful also (I made it out since the manual doesn't give exacts on key presses):


IsKeyPressed(x) where x =
65=A
66=B
67=C
68=D
69=E
70=F
71=G
72=H
73=I
74=J
75=K
76=L
77=M
78=N
79=O
80=P
81=Q
82=R
83=S
84=T
85=U
86=V
87=W
88=X
89=Y
90=Z


-Regards, Akumayo
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Mon 02/01/2006 20:24:47
I think the manual is quite exact: ASCII Codes (http://www.adventuregamestudio.co.uk/manual/ASCIIcodes.htm).
It's nice to have the letters broken down like that, but - although it's not mentioned - letters, numbers and space can be refered to without using the exact code - just surround them with apostrophes (') e.g.:

if (IsKeyPressed('X') == 1) {

NOTE: As it says in the manual, all letters must be uppercase. Although you can use lowercase letters in strings e.g. with StrSetCharAt() (they're 97 - 122), all keypresses are handled as uppercase - 'x' wouldn't work. And, obviously, things like backspace, Ctrl-Q, return and so on can't be used this way.


Akumayo, I'm not sure if it'll work properly with those OR operators (||), I think they all need to be &&. At least, that's the way I've always done it, and it works - feel free to ignore me if ORs work as well.

To make it simpler than checking every possible characters, you could use a while loop, e.g. (off the top of my head, and totally untested):

//on_key_press
if (keycode == 'X') {
  int who;
  while (who < MAX_NUM_CHARACTERS) { // Set the number as needed, use a define, or GetGameParameter
    if (character[who].Room == player.Room) { // Make sure they're in the same room
      if ((player.x <= (character[who].x + 20) && player.x >= (character[who].x - 20)) && (player.y <= (character[who].y + 20) && player.y >= (character[who].y - 20))) {
        //If character[who] is within 20 pixels of player, talk to them, and stop checking.
        character[who].RunInteraction(eModeTalkto);
        return;
      }
    who ++;
  }
}


You could possibly add a check to see it the character has a talkto interaction. And you might also want to check which way the player is facing, in case you have a situation where more than one character is near enough to the player to trigger the interaction. (NOTE: Currently, it'll only talk to the character with the lowest number - if character[4]
and character[7] are both there, 7 will be ignored - another good reason to add those checks.)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Mon 02/01/2006 20:33:30
Quote from: Ashen on Mon 02/01/2006 20:24:47

if (IsKeyPressed('X') == 1) {


Now... how... in the world... do you find out something like that?!  The manual clearly isn't exact enough.  :P .  ( -Logs away information in quote... -)

Anyway, I prefer mixing || and && together to create more complex (if only on my end) statements.  It's all about practice for me.  Anyway, I haven't tried the ||'s, but the statement seems logical to me.  As for your while function, it probably would work faster than mine, because even in mine, NPC's that were within 20 pixels of one another, would both be talked to, one at a time.  So I assumed Hammerite would move them apart.  Still... with some tweaking, your's would be more useful I think.  Oh well, I tried  :D

-Regards, Aelte Akumayo
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Wed 04/01/2006 00:46:24
Quote from: Ashen on Mon 02/01/2006 20:24:47


//on_key_press
if (keycode == 'X') {
Ã,  int who;
Ã,  while (who < MAX_NUM_CHARACTERS) { // Set the number as needed, use a define, or GetGameParameter
Ã,  Ã,  if (character[who].Room == player.Room) { // Make sure they're in the same room
Ã,  Ã,  Ã,  if ((player.x <= (character[who].x + 20) && player.x >= (character[who].x - 20)) && (player.y <= (character[who].y + 20) && player.y >= (character[who].y - 20))) {
Ã,  Ã,  Ã,  Ã,  //If character[who] is within 20 pixels of player, talk to them, and stop checking.
Ã,  Ã,  Ã,  Ã,  character[who].RunInteraction(eModeTalkto);
Ã,  Ã,  Ã,  Ã,  return;
Ã,  Ã,  Ã,  }
Ã,  Ã,  who ++;
Ã,  }
}


hey ashen, this looks very similar too what i use in Kludden. Except in place of the big ugly check i call a function:


function intersect(int px1, int py1, int px2, int py2, int cx1, int cy1, int cx2, cy2) {

Ã,  // check if player above npc
Ã,  if (py2 < cy1) return false;
Ã,  // check if player below npc
Ã,  if (py1 > cy2) return false;
Ã,  // check if player to left of npc
Ã,  if (px2 < cx1) return false;
Ã,  // check if player to right of npc
Ã,  if (px1 > cx2) return false;

Ã,  return true;

}


replace the big if with:

if (intersect(player.x-10, player.y-10,player.x+10,player.y+10,character[who].x-10,character[who].y-10,character[who].x+10,character[who].y+10))


It's slightly more efficient.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Tue 17/01/2006 13:39:53
Just found this thread again, here's my two cents of incredible efficent scripting ;)

if (Maths.Sqrt((player.x-cEnemy.X)^2+(player.y-cEnemy.Y)^2)<=20) {
Ã,  ...
}


This only replaces the distance-if, of course.

EDIT:
Damn, ^ can't be used like that, true. I've confused it with another language.
This simply calculates the absolute distance in pixels, so the area is circular, correct.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Tue 17/01/2006 14:07:28
Positively Pythagorean!
Can you actually use the ^ operator like that, though? If so - or if you used Maths.RaiseToPower - that'd give you the advantage of a circular checking area (wouldn't it? my maths is a bit rusty), which would probably be more accurate than the square.

buloght:
Would it not be more efficient still to pass the character(s) and a distance, and have Intersect() work out px1, py1, etc ...?


if (Intersect(who, 20) == true) {
...
}



function Intersect(int chara, int distance) {
  int x1 = player.x - distance;
  int x2 = player.x + distance;
  int y1 = player.y - distance;
  int y2 = player.y + distance;
  if (character[chara].x < x1) return false;
  if (character[chara].x > x2) return false;
  if (character[chara].y < y1) return false;
  if (character[chara].y > y2) return false;
  return true;
}


I know I've missed a few parameters out, but frankly they confused me some.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: SSH on Tue 17/01/2006 14:19:46
Quote from: khrismuc on Tue 17/01/2006 13:39:53
if (Maths.Sqrt((player.x-cEnemy.X)^2+(player.y-cEnemy.Y)^2)<=20) {
Ã,  ...
}


It would be more efficient to square the right-hand-side than to root the left hand side, especially where it is a constant.


if ((player.x-cEnemy.X)*(player.x-cEnemy.X)+(player.y-cEnemy.Y)*(player.y-cEnemy.Y) <= 400) {

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Wed 25/01/2006 20:41:51
Quote from: Ashen on Tue 17/01/2006 14:07:28
buloght:
Would it not be more efficient still to pass the character(s) and a distance,

Yes it would  :) and a lot cleaner!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Thu 09/02/2006 13:54:48
How do I do equipable items?

I have a few things I want to do:
- clothes, which can't be removed, only replaced
- talisman, weapon and shields which can be completely removed

I also don't know anything about skills...

How can I do skilltypes, of which you can choose 3 of 5?

Well, I've been thinking about the tutorial thingy, and I think there shouldn't be a tutorial about how to make the battle system, like you guys said.

I think this is what a good (and of course simple) RPG tutorial needs:
- More about how to get globalInts to work. Like, how can I get a globalInt done which says which monster I'm fighting for?
- How to deal damage to the party and enemies and get it on screen?
- How to get skills, skillcatagories, classes (in case this is optional), and abilities done.
- How to handle experience.
- How to handle a turn-based RPG with different rooms for battle and general exploring and how to use walkable areas (for example) for real-time RPG's.
- How to make GUI's which are used in battle. (Simple examples, of course, which can be expanded)

Simply said this would be a tutorial for the people (with only a tiny bit of experience) who want to make RPG's. This would be just a tutorial that gives a basic idea about how to get an RPG done. It's like making a template which you can expand with more advanced stuff. I'm convinced there will be RPG's which will look quite the same because they're basic, but there always are people which want to expand their basic system with some unique features.

I'd do this tutorial myself if I was more experienced with scripting, but I hardly get how I can get globalInts, strings, variables, etc. done all by myself, so I can't do it...

Don't get me wrong, I love this thread and I think you guys are right about having standart RPG's, but it's a lot of work to find what you search for in here.

Anyways, it's just an idea... I won't force anyone to make this.  :P

~Yurina
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 26/02/2006 17:52:03
Quote from: Yurina on Thu 09/02/2006 13:54:48
I have a few things I want to do:
- clothes, which can't be removed, only replaced
- talisman, weapon and shields which can be completely removed

As for clothes, just create different views for the character, each with he/she wearing a different set of clothes.Ã,  Then, make each set of clothes an inventory item, and set up an interaction so that if the player clicks the character with the set of clothes item, then the character's view is changed to the new set of clothes, and the player's inventory loses the new set of clothes, and gains the old set of clothes.

Talisman's, weapons, and sheilds are a bit harder.Ã,  You'll need to set up something like this:


int current_talisman;
int current_weapon;
int current_sheild;


Then, make talismans/weapons/sheilds inventory items, and when the player uses, say, Sheild 2 on the character:

current_sheild = 2;

Then in battle, the sheild could be called to determine how much damage NOT to take:

int protect;
int damage_dealt;
int attack_damage = monster_strength;
if (current_sheild == 1) {
Ã,  protect = 5;
}
if (current_sheild == 2) {
Ã,  protect = 8;
}
if (attack_damage - protect <= 0) {
Ã,  damage = 1;
}
else {
Ã,  damage = attack_damage - protect;
}
Display("You're hit for %d health!", damage);
health -= damage;


Not quite as easy as pie, but simple, nonetheless.

If you wanted multiple characters to have sheilds/weapons/etc. something like this could be set up.

In global script header:

struct Character {
Ã,  int talisman;
Ã,  int sheild;
Ã,  int weapon;
};


Then in global script top:

Character Amy;
Character Sean;
Amy.talisman = 0;
Amy.weapon = 0;
Amy.sheild = 0;
Sean.talisman = 0;
Sean.weapon = 0;
Sean.sheild = 0;


Then, when, say, Amy is clicked by Talisman 4:

cAmy.LoseInventory(iTalismanfour);
Amy.talisman = 4;


This way, you can have Sean and Amy carrying stuff by the same, easy to remember, variables.

I hope that this helps.

-Regards, Akumayo
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Sun 26/02/2006 19:21:31
Thanks, Alumayo!

I'll try it out for sure.

~Yurina
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Mon 27/02/2006 07:29:45
Is there a script module that supports RPG functionality?   If not is there any interst in creating/having one?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Wed 01/03/2006 10:27:17
I'm considering creating a template for my style of RPG after I've got all the bugs worked out of my own engine.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Thu 02/03/2006 18:08:19
It would be nice to have a template for RPG's, it shortens the time needed to program the basic stuff. I'll look out for Kinoko's for sure.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Thu 02/03/2006 22:28:03
I asked because there seems to have been many recent (4-5 months) requests for scripting help relative to RPGs.   I was thinking that a script module(s) that did many of the routine RPG operations would be a useful addition to AGS.   I would be willing to do most/all of the programming if there were a few people who could help figure out what is actually needed and who would be interested in testing and/or  using such a module(s).   Let me know what you think. Cheers;)



Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Thu 02/03/2006 22:49:01
I've been considering writing such a tutorial for a while now...  I'm still not sure if I want to go through with it though.  There are many reasons not too, but if it was written in the style you're talking about, just setting a scaffold of how to make stats, carry inventory, choose weapns/armor, make enemies, etc.  Then I suppose it would be acceptable.  I may produce one sometime.  We will see.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Thu 02/03/2006 23:32:18
Well my RPG-AGS engine has been complete for a while but it's not in a state to share, very foggy and unclean. Maybe when oneday Kludden is complete I'll try and make a template of what i did. I think for now Kinoko's the best bet for that.

EDIT: Mine is party-based, turn-based battle system that similar in interface to Chrono Trigger meets Suikoden 1 + 2. And all keyboard control, no mouse.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Fri 03/03/2006 02:29:04
I agree with Akumayo in that I'm never sure it's a good idea. RPGs are just very different creatures to adventure games. Most adventure games do fall into a few catagories, but RPGs -really- differ in the kind of engine's they use. I ultimately think it's better people sit down and decide the way they want their game to work, and code it themselves.

However, having mods to do very distinct tasks would certainly be useful to a lot of people. For example, the TypeLine function is something I could see being used in many RPGs, as it being used in mine. Perhaps even the crappy mod I made for having non-blocking text appear on screen with an animating border or something, but that's very specific. I have no idea if anyone will ever need that.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Fri 03/03/2006 02:51:17
You bring up a good point, and the reason I'm not crazy about writing the tutorial I mentioned.  Even in creating functions and modules, they do one of two things:

1)  Only be useful under certain circumstances
2)  Have games modeled around them so that all the games made with them look pretty much identical

Both of which are, of course, unacceptable.  Perhaps just the very most basic guidelines should be written out.  But of course, the manual did that for me.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Fri 03/03/2006 07:43:50
I was thinking about basics on a lower level than a template or engine.   I don't know that much about RPGs so you will have to forgive my ignorance but I believe RPG characters have many more characteristics than normal AGS characters, such as healty, weapons, power, etc. 

So for example it would perhaps be useful to have RpgChar objects (in the OO scripting style) where these traits could be included.    The normal AGS character  properties and functions would be included in the RpgChar.

So you would do something like the followng to create an RPG character named Vandor. 

// Declare character object (same as variable)
RpgChar  Vandor;   

// Let  RPG Vandor character use the AGS  character cVandor from
// now on you would be able to use Vandor the same way you use
// cVandor (more or less, I'm sure there will be some gotchas but
// shouldn't be impossible situation.
Vandor.SetCharacter(cVandor); 

// The you would be able to do things like
Vandor.Move()

// Or you could do things like
Vandor.Health = 100;
========

I suppose there are other aspects of an RPG type game that could be made similarily easier to script.  I hope this is making some sense.



Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Fri 03/03/2006 20:12:18
That makes sense. In Kludden everything is handled in OO style, items, characters, the moves for the battle system, monsters, etc, but not many people would understand such things so i think if someone has the time and will do the effort it would be worthwile setting up a base RPG template that handles all basic elements of any RPG, like mentioned above, shops, inventory, stuff like that.

A good tutorial can show how eveything should be used, then user's can concentrate on more game-specific aspects like battles (or someone, could make a module for each -> turn-based, realtime,timer battles). It might be worthwhile setting up different modules and than users can combine the modules he/she wants specifically. So in a sense, drop the template idea of a full RPG, create a base template and loads of different modules, etc.

I'm blabbering.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Afflict on Fri 03/03/2006 21:21:02
IMO, why in the hell make a full rpg template? Its been done we call it RPG Maker hehe...

There is of course the solution that buloght provided which IMO is the best option if you want to make a tutorial at all for RPG in AGS, code modules. The User can slap all the modules together to build his her own framework. Which of course if they wanted to could then be modified and altered in anyway.


Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Fri 03/03/2006 21:30:17
Quote
I asked because there seems to have been many recent (4-5 months) requests for scripting help relative to RPGs.   I was thinking that a script module(s) that did many of the routine RPG operations would be a useful addition to AGS.  ... 

I would be willing to do most/all of the programming if there were a few people who could help figure out what is actually needed ...

I was thinking about basics on a lower level than a template or engine. 
Apparently identifying what is actually needed is more difficult than I had originally assumed.  Thanks for your replies anyway.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Fri 03/03/2006 22:34:12
I'll quote myself if i wasn't lazy cause i identified what's needed.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Sat 04/03/2006 01:01:46
I'm not lazy so I'll take a shot at sumarizing what buloght says is needed:

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sat 04/03/2006 19:53:10
Turn-based module: Party or non-party based combat where the player party and enemy party attack in turns or according to speeds of individuals. Either way you can take your time deciding your units moves on the turn.

Realtime: Like Secret of Mana and any action game. Ask Kinoko hehe.

Timer: Like in FF8, Chrono Trigger, each units selects his next move when his timer elapses (almost like turn-based.)

- another one might be a shop module. (Ashen, you have one uberly cool one for that coding competition)

- Movement module (maybe) specifically for RPGs with option of turning diagonal movement off.

The Base template can include all basic character functions and data like basic stats for health, damage, defence, atc, movement functions, etc lots of useless functions most people won't use but some might. :)  Maybe include basic monster/inventory stuff as well.

- And a RPG dialoque module, you know like that moving text that can only be destroyed with a confirm button.

- Also i had to write extreme amounts of lines of code for having a keyboard GUI system (which makes me think i did it wrong) but something like this is useful since most RPG (snes anyway) don't have mouse at all.

I don't know?

I am willing to do some of the modules or even the base module, but when i've finished Kludden.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Mon 06/03/2006 23:07:19
I'm sure, that once all of these things you all are proposing are made, that a great deal of RPG making people will want to get their hands on them.  My question is this, how much would they actually be able to LEARN from such things?  I, personally, will never use anything but what I create, regarding RPG's that is.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Mon 06/03/2006 23:53:33
Quote from: Glacies Akumayo on Mon 06/03/2006 23:07:19
I'm sure, that once all of these things you all are proposing are made, that a great deal of RPG making people will want to get their hands on them. My question is this, how much would they actually be able to LEARN from such things? I, personally, will never use anything but what I create, regarding RPG's that is.

Well neither will I. I use all my own stuff too. See Kludden, it's engine is complete.

Don't worry about my strategy. I'm making one more game before i'm setting my sights in finishing Kludden. Once I have finished this game I'll try and design this base template and modules while I finish Kludden. This will probably be around middle of this year if not later when I start the template, but that's what I plan on doing. Then for people who need one that doesn't wanna make their own tempate can use it. I do agree that doing one's own work is much more rewarding Akumayo. but not everybody knows how.

If someone else wants to make a template in the meanwhile, it would be great. Sinitrena, I saw in your signature you're working on one? Would love to see it finished 
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kinoko on Tue 07/03/2006 01:24:48
Quote from: buloght on Sat 04/03/2006 19:53:10Realtime: Like Secret of Mana and any action game. Ask Kinoko hehe.

All I can say on the subject is that it's -hard- to get things tweaked the way you want.

Quote- Also i had to write extreme amounts of lines of code for having a keyboard GUI system (which makes me think i did it wrong) but something like this is useful since most RPG (snes anyway) don't have mouse at all.

I've done similar things and yes, I was shocked at how much code it took to get it right. I was also wondering if there was a way to shorten it, and admittedly, I keep going over my old code and I do find ways to, usually, significantly cut down on it. I did it recently for my inventory GUI code. I find inventory is a hard one to reduce the code with, because there are so many specific properties necessary for each item that I can't use maths or increments for. Just gotta write 'em all out.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: RickJ on Tue 07/03/2006 17:34:35
Hmmm,  A keyboard movement module would seem to be generally useful.    Can you guys explain what you have done so far or give me some code examples?  I would like to see what variability there is in operation and think about how to deal with it.  Maybe make it user configurable or at least designer configurable. 
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Tue 07/03/2006 18:06:27
There already is a KeyboardMovement Module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=22724.0) which seems to work OK, but the more the merrier I suppose - especailly if you can add to it somehow.

I think the current Coding Comp (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=25282.0) would've been a good place for some of these ideas - maybe whoever wins it can extend the RPG theme?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Thu 09/03/2006 23:23:18
Ahh, but if YOU enter Ashen, then YOU will win, no?  :=
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Fri 10/03/2006 10:38:59
I just got the most brilliant idea: why not make a site with stuff on it for designing RPG's? Since a lot AGSers like to make those too it would be great to have a central recource site.

As for the modules, I also have suggestions:

- Ranged attacks in realtime RPG's (if possible).
- A keyboard module with functions like: X to talk to somebody, Enter to open a menu, etc.
- Sub-inventory modules

Tutorials:
- Statistics and how to use them in e.g. fights and level-ups (HP, MP, Attack, Defence, Speed, Accuracy, Evasion, etc.).
- How to make using objects inflict or prevent damage.

I'll add more later.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Fri 10/03/2006 23:11:30
Hrm... an interesting proposal.  Like an AGS RPG resource site, dedicated to using AGS like an RPG maker...

Or... someone could make a site for using AGS for any genre of game other than adventure.  This way, it could be a resource site for RPG's, arcade games, shooters, etc.  Where people could learn from one another, and build a brighter future for AGS, one including a wide variety of game types.  I may actually agree with such a thing.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Mon 13/03/2006 09:14:45
That's exactly what I meant, Akumayo.

I'd love to design such a site, but I won't be able to maintain it. I still have my games to work on, and as soon as I create my own modules for my own games I'll contribute them. (Not that I'm a scripting wonder or something...)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 09/04/2006 05:38:38
http://185703.aceboard.net/index.php?login=185703

I had some spare time.  I hope you all can make good use of it.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Mon 10/04/2006 20:22:14
Erh... Akumayo... the link doesn't work...^.^'

EDIT: oops! it just was a long load...  ;D'
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: buloght on Sat 22/04/2006 01:12:00
That's pretty cool Akumayo! I registered :) I am very far with a non-adventure (not my RPG), I'll put it there when finished, should be soon. Great stuff Akumayo :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sat 22/04/2006 02:49:58
Thanks right back buloght, I was beginning to think that interest in such a place had died off.  I do hope it will help out.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Sun 23/04/2006 12:14:57
Currently I'm working on my battle system. I don't know yet wether I put it up or not, I don't like people using things I made fo a very personal project, but I do want to help... :-\

Anyways, as soon as I get coding a bit better I'll put some nice stuff up.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Sun 23/04/2006 12:43:23
That looks like it could shape up to be a nice little resource. Perhaps an official anouncement in General Discussion would generate more interest? However, can we leave any further discussion of it to PM or - wacky thought - to it's own 'Suggestions' forum.  After I have my say, anyway:

Yurina, maybe you could put up a stripped down version of the engine? You know leave the basics intact for everyone to use but remove any 'personal' touches specific to your game.

Akumayo, should I add my trade & turn-based battle engines from the coding comps? Or you're welcome to add them yourself, if you want.

Now, let us never speak of it again. Here, at least.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akumayo on Sun 23/04/2006 15:39:17
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26227.0

NOW, we never speak of it again...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: A�rendyll (formerly Yurina) on Sun 23/04/2006 15:51:15
Okay, mouth shut! :-X
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: buloght on Sun 11/06/2006 22:17:08
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26939.0

I put my kludden tech demo there, to showcase my RPG engine. Not sure when I'll coninue the actual game (which is much further than this demo) since I'm first working on an adventure game.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: DinghyDog on Sun 02/07/2006 01:12:09
Okay, to bring this topic back to questions about RPG-ness....

I've started what will probably be a long-term off/on project to make an old-style NES/SNES RPG. I've started coding my GUIs, getting keyboard control, etc, etc...but I have a few questions about problems I can see down the road.

There's a hell of a lot of math involved in an RPG. I can imagine that if you do the math wrong, the game could be too easy, too hard, etc. Leveling up and exp. for instance. Usually in RPGs, you get less experience for defeating a given enemy the higher your own level is. That would require a formula...it's things like this that I worry about. Not because I couldn't implement them - because I don't know what RPGs usually DO. What math governs how fast someone gains a level? How do the different attributes come into play? How would your enemy's Hit percentage interact with your own Evade percentage?

I doubt there's a resource anywhere that could help me with this....is there?

And then...supposedly there's only 300 GlobalInts and 50 GlobalStrings. Correct? Or something? I'm still FAIRLY new to the AGS language (but I've been coding for quite a while)....is there some way to expand this number? Or to, say, call a variable used in your global script from a room script, do something to it, and then return it with its new value? Otherwise, I see problems arising. I don't want to copy enemy code into every room they might pop up in.


-DD
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Tue 04/07/2006 00:49:10
Quotesupposedly there's only 300 GlobalInts and 50 GlobalStrings. Correct? ...is there some way to expand this number?

Actually, I think it's 500 GlobalInts.

Although not RPG specific, this BFAQ entry (http://americangirlscouts.org/agswiki/index.php/Scripting%2C_Code_%26_Interaction#Working_with_variables:_the_basics) deals with making Global variables, which will extend those limits nicely. (As well as allowing you to use the more intuitive Money = 3; instead of SetGlobalInt(437, 3);.)
Note that if you're using V2.7 or lower, you can't make global strings. You can however make a char array, that will work similarly. (char Name[30]; will give you the functional equivilant of a 30-character string.)

As for the maths, you could just fudge it, so it seems right to you - that's the joy of writing your own engine. Alternatively, Google up some sites relating to RPG engines, they'll probably have the formulae used somewhere in their resources.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: DinghyDog on Tue 04/07/2006 06:27:00
Ah, fantastic! Honestly, besides the unfortunate problem of having to export and import many, many separate variables, I would much rather use variables of my own naming than having to GetGlobalInt blah blah etc.

But yeah, I guess I'll just see what happens with my own math...ah well.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Wed 05/07/2006 18:39:49
Quote from: TerranRich on Mon 03/05/2004 05:56:47
The answer is yes. You can make an RPG with AGS.

Why not? What's stopping you? First of all, you can keep track of stats with global variables. Look them up in the manual. Look for "globalint".

Turn-based combat? Of course it's possible with AGS! With enough scripting knowledge, you can program turn-based fighting in your RPG game.

Any other RPG-related questions, please feel free to ask here. Anybody who has any other tips and pointers for making an RPG in AGS, post here as well.

(Any other "Can I make an RPG" threads will be locked.) :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Wed 05/07/2006 21:50:11
Damn, ice_sta, _that_ was helpful. ::)

DinghyDog: goto www.gamefaqs.com and look at the In-Depth FAQs of famous RPGs. Here's an example (http://db.gamefaqs.com/console/snes/file/chrono_trigger_mech.txt) from ChronoTrigger.
EDIT: direct link doesn't work, so copy & paste it into a new browser window.

And you should familiarise yourself with structs, here's a short example from a half-finished fight engine I did:

struct fighterStruct {
Ã,  // Stats
Ã,  int hpm;Ã,  Ã,  Ã,  // health max (1-999)
Ã,  int hp;Ã,  Ã,  Ã,  Ã, // current health (0-hpm)
Ã,  int mpm;Ã,  Ã,  Ã,  // magic max (1-999)
Ã,  int mp;Ã,  Ã,  Ã,  Ã, // current magic (0-mpm)
Ã,  String name;Ã,  // name
Ã,  int lv;Ã,  Ã,  Ã,  Ã, // level (1-99)
Ã,  int atk;Ã,  Ã,  Ã,  // attack (1-99) inflict damage
Ã,  int def;Ã,  Ã,  Ã,  // defense (1-99) get damage
Ã,  int agi;Ã,  Ã,  Ã,  // agility (1-99) likelyness of hit
};


Put something like that into the global script header, or even better, into the header of a module.

In the module script, you'd usefighterStruct party[4];
export party;
and thus you'll get three (4, I know) party members whose stats can be accessed by using e.g.party[1].name="Cloud";
// or
party[1].agi=40;
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: DinghyDog on Thu 06/07/2006 00:03:33
Yeah, um, basically I love you for that link. In a totally non-weird way. But it'll take some work to adapt it.

And yeah, I've got structs going for my items as well, but that's a great way to do the players, thank you!

I'm getting the GUIs out of the way right now, setting up functions and such for the keyboard navigation (especially in the menus), finding ways for it to read arrays into listboxes, etc, etc, and then I'm going to do the fight engine. I'll post again if I have problems...I have a feeling I can do the actual battle-ness pretty well, though. Correct my logic, but I feel like I should have one room designated as the battle room, and just have alternating backgrounds for it, and all the code for that should be in the room script?

-DD
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: buloght on Wed 12/07/2006 14:47:22
:) I also made my own structs for items, party members, enemies etc. For the fight engine I wrote seperate module (turn-based) but I didn't make the battles in only one room, I had mine in the global script with, so I think your logic is way better there than mine  ;D. It makes more than enough sense and would simplify things greatly, I think.

Here is the example of mine, a few weeks ago.

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26939.0
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akatosh on Fri 25/08/2006 15:22:47
Just postin' a link:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28009.0

do you think stuff like this (isometrical!) is possible at all or should I just climb down into that 2D-adventure gutter again?  ;)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: WackyWildCard on Sat 30/12/2006 20:55:18
Quote from: Kinoko on Wed 01/03/2006 10:27:17
I'm considering creating a template for my style of RPG after I've got all the bugs worked out of my own engine.

When you get your RPG in AGS Demo Game Template up and running, please let me know, ok?

I too am working on an Adventure Game/RPG. Well, it started as a regular Point & Click Adventure Game, but I wanted features like Life Strength, Armor Strength, Shield Strength, Water Supply, Enemy Strength...etc, etc.  The Game I'm working on is called Knight's Quest: Shield Search. It is a Science Fiction/Fantasy RPG Adventure I'm very excited about. You can see a VERY rough preview of it in the Games in Development section of the Forum.

Again. Please let me know when you have a working Template I could model my game after. I would be very grateful.

Thanks! :D

Wacky Wild Card ;D
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: WackyWildCard on Sun 31/12/2006 00:32:37
Quote from: Def on Mon 12/07/2004 18:43:59
http://home.quicknet.nl/qn/prive/jjj.dekker/rpg.rar Something me and Chrille made a long time ago. It's an rpg (just a start though) and it's a bit like those old console RPGs. You can walk around, and encounter random monsters and fight them. It just shows it is possible to make it in ags :)

I've seen and played a bit of your rpg game sample. I'm very impressed at what you guys have achieved!

I too am working on an Adventure Game/RPG. Well, it started as a regular Point & Click Adventure Game, but I wanted features like Life Strength, Armor Strength, Shield Strength, Water Supply, Enemy Strength...etc, etc.  The Game I'm working on is called Knight's Quest: Shield Search. It is a Science Fiction/Fantasy RPG Adventure I'm very excited about. You can see a VERY rough preview of it in the Games in Development section of the Forum.

Again. Please let me know when you have a working Template based on your game, so  I could model my game after it? I would be very grateful.

I should also mention that I may add your names to the long list of credits in the scrolling credits, when my game is complete.

Thanks!

Wacky Wild Card Grin
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moresco on Sun 15/04/2007 18:45:44
Very interesting discussion.  I'd like to add a few things.

There are Real-Time RPGs like Final Fantasy IV where characters on a screen sort through menus to pick a choice of action, while the monsters timer counts down to attack the characters repeatedly.

Then there are action-RPGs like Zelda or the Seiken Densetsu (secret of mana etc) games.  In this type of game, you freely move about while wielding a weapon of some type - swinging, throwing, whatever have you - at the monsters.  Collision detection is needed for this type of game, but not for the aforementioned style game.

In Zelda's style scrolling, you have rooms of a set size, made up of tiles.  When you move off screen, the room does not scroll as it appears, but rather the tiles are pushed over (or up/down/left/right depending) bit by bit while the new room's tiles (already loaded) are pushed onto the new area.   I believe in Zelda, your character either stands still during this, floats, or something similar.

I don't believe anyone mentioned Strategy-RPGs either.  Wonder if anyone would ever have the desire to work out some of that stuff...

There are several types of those as well.  There's the Warsong, Fire Emblem, Shining Force styled sRPG - almost like a board game where pieces are moved about a playing field.  Battles are sometimes randomly fought out, the computer computing the outcome (almost like a short movie).   Others allow choices between attacks and even more options come into play with games like Super Robot War.

And then there's realtime strategy, but that's not going to happen I fear. :p

I'd love to incorporate RPG stuff into a game.  Not saying I will, but if I do I will certainly make a tutorial of the process to add here.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 19/04/2007 02:31:31
The Gameboy-Zelda might use tile-scrolling, the SNES game doesn't. The moving things just freeze and the screen scrolls smoothly to the adjacent one.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moresco on Thu 19/04/2007 05:40:02
Hmm I have to disagree with you.  So many games use tile scrolling it isn't funny...  Maybe you're confused about what I'm talking about.  This is an example of tile scrolling:

tile scrolling (http://www.nonoche.com/imaging/en/index.html)

Refers to tile scrolling:
zelda_scrolling (http://hamsterrepublic.com/ohrrpgce/index.php/How_do_I_make_the_screen_scroll_like_a_Zelda_game_.html)

The gb/snes/nes and all subsequent zelda styles all pretty much work the same way.  Only the graphics/sound/gameplay improved, but the overall method used on the consoles were very similar if not the same.   In the snes version of Zelda there is scrolling 1 tile at a time as well as scrolling full screens full of tiles at once for transitions.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Sat 21/04/2007 15:04:20
You're right, I thought tile-scrolling meant that the screen doesn't actually scroll but the tiles are replaced column by column.

Btw, real-time strategy can be done using AGS, there was a Cannon Fodder clone in Production (by foz) once, but sadly he didn't finish it.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Akatosh on Sat 21/04/2007 15:26:40
And I have a strategy game planned in mind, but unfortunately, you cannot directly create characters in AGS, so I'm having a bit of a problem there, but it should be solvable with pointers. However, it'll either be RAM-wasteriffic or overloaded with cleanup and checking routines (e.g. before declaring a new pointer, check all pointers for null value and take the one with the lowest index).
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Moresco on Sat 21/04/2007 19:05:32
Quote from: KhrisMUC on Sat 21/04/2007 15:04:20
You're right, I thought tile-scrolling meant that the screen doesn't actually scroll but the tiles are replaced column by column.

Btw, real-time strategy can be done using AGS, there was a Cannon Fodder clone in Production (by foz) once, but sadly he didn't finish it.

Oh.  Well the screen never really scrolls as it appears to, it's just an illusion.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kaldeon on Wed 24/10/2007 22:28:38
No matter where I put ANY of what you guys say to add MP numbers like: String mana;
String exp;
String.Format (mana, "%d", GetGlobalInt (1));
String.Format (exp, "%d", GetGlobalInt (2));
SetLabelText (0, 1, mana);
SetLabelText (0, 2, exp);

And yes I had to change it because no matter where I put it it would always say: Unexpected StrFormat, Unexpected SetLabelText, then what would work went to Unsefiened properties of SetWindowGUI. You guys need to update because obviously AGS updated.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Wed 24/10/2007 23:33:02
Sorry, what? Previously made posts should be changed because the editor has moved on? If you read old posts, you're going to get old code - and issues with updating have been addressed many time before, if you look for them.

Perhaps you should read the manual (http://www.adventuregamestudio.co.uk/manual/String.Format.htm), or just some newer posts on the forums (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=29291.0), to see how to update it for yourself?

String exp = String.Format ("%d", GetGlobalInt (2));
String mana = String.Format ("%d", GetGlobalInt (1));
gui[0].Controls[1].Text = exp; // Look up 'Label.Text' and name the Label to make this easier.
gui[0].Controls[2].Text = mana;


Or, you could simplify that to:

lblShowExp.Text = String.Format ("%d", GetGlobalInt (2));
lblShowMana.Text = String.Format ("%d", GetGlobalInt (1));
// replace 'lblShowExp' and 'lblShowMana' with whatever you names the Labels.


If you're getting Unexpected (whatever) errors, then you're probably putting the code in the wrong place (like outside of a functon) - the original post should tell you where to put it to avoid those errors. 'Undefined properties of SetWindowGUI' is a new one to me - what exactly was the error message, and what (and where) was the line that caused it?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Kaldeon on Thu 25/10/2007 23:55:22
Error (Line 16): PEO3: Parse error at lblShowExp
(I'm going to try changing it's  position)
Error (Line 17): Undefiend Token 'lblShowExp'
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Fri 26/10/2007 00:10:45
'Undefined token' errors mean just that - the thing you're refering to (in this case a Label called 'lblShowExp') isn't defined (i.e. doesn't exist). Try a forum search, if you want more info.

Did you name your Label 'lblShowExp', or did you not see the last line of the code block:
Quote
// replace 'lblShowExp' and 'lblShowMana' with whatever you names the Labels.
(And yes, 'names' was a typo.)

Name your Label(s) in the GUI Editor, then update the code with the actual Script-name.

I can't see why that'd generate a parse error, or why just moving it one line down would solve that - what's the surrounding code when you get the parse error? (It might not matter, if you've gone beyond that, but it's usually handy to know why errors happen, to avoid them in the future.)

And, there was no need to quote the whole post...

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Fri 26/10/2007 09:41:42
It is  possible to do First person RPG too, something like      Asporia: Hidden Threat  but with hands (instead normal view of character) and with more items, like armors. There will be view of last used sword or spell in hands.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Fri 26/10/2007 23:19:55
If you just want stationary on-screen hands, that's easy - use a GUI background image. If you mean hands that animate with the action, like in (for example) Oblivion, or some FPSs? (Press the button to swing your sword, and the sword swings onscreen.) Doable, with a bit of coding. (Although also using GUI Backgrounds...)

'more items like armors' - more than what? Again, probably doable with a bit of coding. I think the Hidden Threat template used Inventory Items for spells, weapons, etc - it'd just be a case of adding more of them. If you're not using that template - what are you using? Ask a general question, get a general answer. Ask a more specific question, and you might get a reply that's more actual use.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Sun 28/10/2007 08:48:50
It wasn´t  a question, I just wanted to tell you my idea.
A view of character can have every loop for some type of action, for example loop 1 can be used for attacking a beast.
player.Animate (1, 5, eOnce, eNoBlock, eForwards);
Player is moving with his hands no matter what weapon he has in his hands.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Thu 15/11/2007 19:17:55
I have a problem with level- up. I wrote that code to repeatedly_execute:
[code] if (GetGlobalInt(8) < GetGlobalInt (5)) {
SetGlobalInt (6, GetGlobalInt (6) +1);
DisplayTopBar (28, 2112, 7, "Level up", "     You are on %d level!    ", GetGlobalInt (6));
gLevelup.Visible = true;
if (GetGlobalInt (6) < 4) {
  SetGlobalInt (7, GetGlobalInt (7) +3);
  }
else if ((GetGlobalInt (6) <7 ) && (GetGlobalInt (6) > 3)) {
  SetGlobalInt (7, GetGlobalInt (7) +6);
  }
else if ((GetGlobalInt (6) <11 ) && (GetGlobalInt (6) > 6)) {
  SetGlobalInt (7, GetGlobalInt (7) +9);
  }
else if ((GetGlobalInt (6) <16 ) && (GetGlobalInt (6) > 10)) {
  SetGlobalInt (7, GetGlobalInt (7) +12);
  }
else if ((GetGlobalInt (6) <21 ) && (GetGlobalInt (6) > 15)) {
  SetGlobalInt (7, GetGlobalInt (7) +15);
  }
else if ((GetGlobalInt (6) <30 ) && (GetGlobalInt (6) > 20)) {
  SetGlobalInt (7, GetGlobalInt (7) +18);
  }
else if ((GetGlobalInt (6) <31 ) && (GetGlobalInt (6) > 29)) {
  SetGlobalInt (7, GetGlobalInt (7) +25);
  }
}

GlobalInt:  5= exp
                  8= exp for next level
                  6= level of player
                  7=points for incerase players statistic

But When GlobalInt 5 > 8, GUI "Levelup" is still invisible.[/code]
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gilbert on Fri 16/11/2007 00:42:58
Since I don't see a gLevelup.Visible = false; line in your script that may be the problem, unless it's put in some other place. Remember you need to really tell the engine to hide it.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Mon 19/11/2007 16:36:07
Yes, it is in game_start. Do you see any other problems?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Gord10 on Mon 19/11/2007 18:33:00
*Cough cough*
I knew I have forgotten something. I forgot giving the news of something.

I had released the source codes (the AGS template, actually) of Asporia: Hidden Threat.
http://dosya.coolbluegames.com/gizlitehdit_kaynak.zip
But it is an old game; doesn't use the new object based AGS scripts.

This could be helpful to the ones who would want to make a RPG with AGS, though.

@Mirek
Maybe the problem is on GUI itself (like its Z coordinate being below any other GUI). Have you tried running this code on somewhere else (like a hotspot code) in order to see whether the problem is the GUI/GUI code itself or the block you use for repeatedly_execute?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Dualnames on Tue 20/11/2007 08:39:23
No trouble using it on AGS 2.72
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Tue 20/11/2007 12:26:41
Mirek:
The only problem I have running that as-is (in 2.72), is that there's nothing that stops GI5 being more that GI8, so it just repeatedly levels up until I Alt-X out of the game. But that might be taken care of in another block of code.
You said the problem was gLevelup staying invisible - does that mean everything else (e.g. DisplayTopBar and updating the character stats) runs OK? As Gord said, check the positioning of your GUI, to make sure it's not just hidden behind something, or is off-screen, etc. If it's not running at all, insert some Display commands somewhere (e.g. on_key_press to make sure your GIs are what you think they are (that is, that GI5 actually is greater than GI8 - and remember that it won't currently run if GI5 = GI8).

Slightly off topic, I prefer to use custom variables for this sort of thing. if (exp >= neededexp) is much easier to read, IMO, than if (GetGlobalInt(8 ) < GetGlobalInt (5))

Gord:
Nice, thanks for releasing. Shame it uses old-style code and (going on the tutorial files) the Interation Editor though.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Thu 22/11/2007 15:22:29
QuoteYou said the problem was gLevelup staying invisible - does that mean everything else (e.g. DisplayTopBar and updating the character stats) runs OK?
Yes, everything (except GUI) works well.
QuoteHave you tried running this code on somewhere else (like a hotspot code) in order to see whether the problem is the GUI/GUI code itself or the block you use for repeatedly_execute?
Yes, with hotspot, character and object it works well, so I really don´t know where the problem is.
QuoteI prefer to use custom variables for this sort of thing. if (exp >= neededexp) is much easier to read, IMO, than if (GetGlobalInt(8 ) < GetGlobalInt (5))
I didn´t know if the problem isn´t in bad number of GlobalInt.

[EDIT]: I fixed it now!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: beomoud on Sat 24/11/2007 17:57:35
Hi everyone. This is actually my first post here. I have been working on my first game which is a RPG using 3d models. So far i have completed the character creation, the stat board, the skill tests and i'm currently working on buying and selling but i've run into problems, can anyone help?

I created a second inventory GUI for the MERCHANT who i intend to change his wiew and his trades in each room so that it look like he is a different person. I have assigned BUY and SELL buttons and i want, when you click buy having a Merchant's inventiry item selected to give the player that inventory item, but as soon as he picks it i get a message that the item doesn't exist in the player's inventory (thus i cannot hold it). I haven't so far found a way to assign script on an inventory box click. With selling i have made it so that if you click it the Player's inventory box appears in the place of the Merchan't but haven't gone any further than that. any ideas? I have seen some suggestions as to ssign buttons that give the player an inventory item, but that way i wouldn't be able to just have one GUI and only give the Merchant different goods in each room, i would have to design many GUI's and other than that i get that there must be an easier way. Any thoughts?

(After that i'm going to work on the battle system, any thoughts on how to define the rounds, you know... how to have rounds changing)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Sat 24/11/2007 18:35:03
By default, AGS treats a eModeInteract click on an Inventory Item as 'set this as the Active Inventory' - and you've discovered what happens if you try to set as Active an item the player does't have. The most obvious solutions would be: change the Cursor mode to someting other the eModeInteract (and stop the player being able to change back while the shop GUI is open) or make the Merchant character the player Character while you're in the shop.

Quote
I haven't so far found a way to assign script on an inventory box click

Do a forum search for 'Handle Inventory clicks in script'. The manual is a bit vague, but it's been dealt with enough times that you should be able to find a decent description somewhere. (But just not using eModeInteract is much easier...)
If you've already got 'handle inv clicks in script' checked and didn't realise (e.g. from some template/tutorial), you should be able to edit the on_mouse_click function to react to what GUI is open, so it doesn't generate the error you're getting

Quote
but that way i wouldn't be able to just have one GUI and only give the Merchant different goods in each room, i would have to design many GUI's

Not quite true. You could set up conditions to change the Button graphics before opening the GUI (changing the 'stock' of the store), and within the Button Control functions to sell different items based on some other variable (Room number, Button graphic, etc), so it'd behave in a similar way to using an Inventory window. The Inventory method would be a LOT easier, though...

How to handle changing rounds... There're a couple of fighting game engines available already (e.g this one (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32833.msg426249#msg426249), Gord's Template a few posts up, or these Coding Contest entries (http://americangirlscouts.org/agswiki/Coding_Contest#Turn-based_battle)) - they probably won't be exactly what you're after, but they should give you a few ideas.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: beomoud on Sat 24/11/2007 20:59:29
I don't mean to tire you with these but it really looks hard to me. I defined a new cursor mode but i still don't seem to be able to get an "Active Inventory" with an inventory click. I run through the post you suggested but i seem to get the same problem as that guy. My code is:

#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else {   // right-click, so cycle cursor
    mouse.SelectNextMode();
  }

if ((button == eMouseLeftInv) && (Mouse.Mode == eModeTrade)) {
player.ActiveInventory=InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
character[EGO].AddInventory(player.ActiveInventory);
Mouse.Mode=eModeUseinv;
gStock.Visible = false;
Display ("You got new equipment");
}
}
============================================================

But the conditions never seem to come true (the cursor mode is on trademode by the way)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Sat 24/11/2007 21:32:12
OK, here's the most obvious problem with that code:

player.ActiveInventory=InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
character[EGO].AddInventory(player.ActiveInventory);
Mouse.Mode=eModeUseinv;


Remember, you can't set as Active an Item the player doesn't have, which is what you're still trying to do. You need to add the Item THEN set it as active. Try:

Item *Clicked = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
character[EGO].AddInventory(Clicked);
player.ActiveInventory = Clicked;
// Cursor mode automaticaly changed to eModeUseinv when ActiveInventory is set


Also:
* Do you really want to set the newly-added Item as active? You don't have to, to 'select' the Item from the shop, is there some other reason you're doing it?
* Is there no check for "Are you sure you want to buy (whatever)?" (or even whether the player can afford the item)?

There was a Coding Contest about Trading as well, maybe you could get some ideas from there?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: beomoud on Sun 25/11/2007 04:54:28
I'm sorry to have bothered you for this but i am a newb and this is my first game, it took me endless hours to find the mistake, but it turns out that one of the reasons was that i hadn't checked on the "handle inv clicks in script" option in the General Settings, it all works fine now, as i said i'm new to this. Anyway thanks for the input.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Fri 30/11/2007 19:45:09
You don't have to use buttons, you can create new inventory window with script name for example Buy_Sell and in game_start call
invBuy_Sell.CharacterToUse = cMerchant ; and when you need to have another items just use cMerchant.AddInventory (iScriptNameOfItem); .
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: ncw14 on Mon 17/12/2007 23:14:39
When i follow the instructions on the tutorial for rpg making it tells me

Error

there is a parse with:

and it tells me that with almost everything i script from instructions
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ashen on Tue 18/12/2007 01:03:45
We can't really help unless you tell us the exact error message(s), and the line(s) mentioned.
"There is a parse with" doesn't really mean anything, but if you give us examples of the actual errors and code you use, we should be able to tell you where you're going wrong.

Make sure you've checked the manual, BFAQ and search the forum for working code examples before you ask, though.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: ncw14 on Tue 18/12/2007 17:58:33
Fixed above problem,

3 things though the Gui only says "hp: @SCORE@" and stuff like i made it say but i want it to display the hp or score, i want to be able to display current hp and xp

also In scripting some of commands people type dont work, like Strformat. i have to use Sting.format instead is this cause i have an older version or something.

and last, can i make 2 hotspots with different commands in one area i dont know how
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Tue 18/12/2007 18:41:46
You need global variables storing hp and xp. Then add a line in repeatedly_execute in the global script:
  status.Text=String.Format("Score: @SCORE@     HP: %d      XP: %d", hp, xp);
In the GUI editor, look up the name of the text label, then use that name instead of "status".

The tutorial is probably for AGS 2.62 and older. String.Format is new code.
If you're using a pre-2.8/3.0 version, uncheck "Enforce object-oriented scripting" in General settings.

You can't make two hotspots in one area, no. How's that supposed to work?
If you want to change the reaction to e.g. interacting the hotspot after the player has done something, use variables.

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: ncw14 on Tue 18/12/2007 20:26:22
Khris i just did that it says parse error FindGUID line 37

this is line 37

STATUSLINE.Text=String.Format("Score: @SCORE@     HP: %d      XP: %d", hp, xp);}
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Tue 18/12/2007 21:25:02
You've got to use the name of the label, not the GUI itself. In the GUI editor, click on the label, you should now see the four corners marked with yellow dots. Now check the small properties window for the scriptname.

Btw, this is getting more or less off topic, so if you've got any other general technical questions (as opposed to AGS-RPG-questions), I guess it's better to open a new thread.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: firestarrules on Mon 31/03/2008 13:27:39
can someone tell me how i can put in the script for my guy fighting something else to hit random attack points between 0-5?im making a runescape like game,with a little pokemon,so it would also help if u could also tell me how to make seperate inventorys where i could put the monsters and where i could show my stats.



Thanks!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: derboo on Thu 01/05/2008 12:03:03
I'm trying to create a tile engine for AGS, thought it might fit in here as well.
What i'm doing right now is using a Black background, getting it as a Drawing Surface and use .DrawImage to get the tiles on it. This leaves me with 2 Problems:

1. Is it possible to define walkable areas through the script during runtime in a similar manner? I gave switching walkable areas on and off a thought, but since one is limited to 16 areas per room, that is not an option...

2. If I'm going to load a new black background image for every room, I'll be wasting a lot of space. Is there a possibility to use the same image for multiple backgrounds? Maybe like you use objects' graphics from the game's sprite pool?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Fri 02/05/2008 07:37:39
1. No. In my tile engine I use keyboard movement; as soon as the walking direction changes, the boundary of the actual (non-AGS) walkable area is calculated, then the char is moved using WalkStraight(end_x, end_y);
If your character's supposed to be sent around the usual point'n'click way, you have to calculate her path using one of the tons of A* tuts floating around in the net.

2. Why use a new AGS-room for every new game-room? You won't be using room-specific hotspots etc. anyway, right? Create a huge room by importing a, say, 1280 x 800 black pic (uniform black shouldn't waste too much space), then use it all the time.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: derboo on Fri 02/05/2008 10:18:39
1. I guess that might be the only way right now, though it would be nice to be able to go with the Engine, not against it...

2. Actually, I would like to use hotspots... though it certainly would be cleaner to be able to set the hotspots in runtime, too.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Fri 02/05/2008 11:17:03
1. Use RPGMaker then ;)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: derboo on Fri 02/05/2008 13:44:18
Actually, with the RPG Maker Engine, I'd have much more Problems to do what I'm imagining...

FIFE would be a good engine probably, but it seems far too complicated for me...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Sun 18/05/2008 07:52:40
Hi can I set one side of slider black? I have sliders fo displaying HP and Mana and they work OK, but if value is not at maximum, there is stil my red or blue background slider image. I want to right, empty side, will be black. Please, how to do it?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Tue 20/05/2008 15:58:41
You can't use different colors afaik.
However, you can use buttons and draw their images on the fly.
I'm too lazy right now to provide some code, basically you use a global DynamicSprite, draw the gauge image on its DrawingSurface, then set the DynSprite as the button's image.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: thom0512 on Wed 27/08/2008 05:35:31
I have an RPG-related question regarding a battle I am working on.  I am creating it similar to what was used in the MOTHER series.  Again, I did research this issue before I asked, and I am sure there is a much easier way to script this than the way I did, but oh well.

When my character picks a specific dialog option, he will trigger a fight and will change rooms to the "battle screen" room.  I am using default display messages to let the player know of what goes on during the battle.  I have a GUI off to the side of my room, displaying different actions for the player to pick...attack, defend, run, etc.  I made the main character's and the enemy's health bars with 4 GUIs each: full, 2/3 full, 1/3 full, and empty.  So that totals eight.  The GUIs are marked as gVitals; 1-4 is for the main character, and 5-8 is for the enemy.  Here is the basic script I have so far regarding the battle, with only the main character (Ron) being able to take damage:

function gRobber1_OnClick(GUI *theGui, MouseButton button)
{
Display("Ron throws a punch!");{
int ran=Random(2);
if (ran==0) Display("Just misses!");
else if (ran==1) Display("The robber dodges out of the way quickly!");
else Display("10 HP damage dealt to the robber!");
}
Display("The robber charges at Ron!");{
int ran=Random(2);
if (ran==0) Display("Just misses!");
else if (ran==1) Display("Ron dodges out of the way quickly!");
else Display("10 HP damage given to Ron!");
}}


Display("10 HP damage given to Ron!");{
  if (gVitals1.Visible == true) {
  gVitals1.Visible=false;
  gVitals2.Visible=true;
}
else if (gVitals2.Visible == true) {
  gVitals2.Visible=false;
  gVitals3.Visible=true;
}
else if (gVitals3.Visible == true) {
  gVitals3.Visible=false;
  gVitals4.Visible=true;
  Display("Ron loses the fight.");
  cRon.ChangeRoom(17);
}}

I realize that the bottom portion of the script technically does not fit.  I just threw it in there to show what I want to happen only when a character is hit by an attack.

I am using random effects for the moment until I think of something better.  My problem is that I want the "gVitals" to change only when the main character or the enemy takes damage, or when it is displayed that "10 HP dealt to **", etc.  Right now it just gives Ron 10 HP damage every turn he gets during the battle, and I want to fix this.  Hopefully this makes sense.

Any help would be greatly appreciated.  If I am not clear, please let me know and I'll elaborate as best as I can.  Thank you!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Wed 27/08/2008 08:33:47
In the function, there this line:
else Display("10 HP damage given to Ron!");

Replace that with:
  else {
    Display("10 HP damage given to Ron!");
    ron_gets_hit(10);
  }

Now put this above the function:
function ron_gets_hit(int damage) {
  ...
}


Put in there what you want to happen.

Btw, as explained in my previous post, you can use a single button to display a health gauge. Four GUIs is overkill.
Familiarize yourself with the DynamicSprite and DrawingSurface functions.

You'd do something like:
int ron_hp = 100;
DynamicSprite*ron_gauge;

function ron_gets_hit(int damage) {
  ron_hp -= damage;
  if (ron_hp < 0) ron_hp = 0;
  ron_gauge = DynamicSprite.CreateFromExistingSprite(btnHealth.NormalGraphic);
  DrawingSurface*ds = ron_gauge.GetDrawingSurface();
  ds.DrawingColor = 16; // black
  ds.DrawRectangle(0, 0, 99, 15);  // clear gauge
  ds.DrawingColor = Game.GetColorFromRGB(0,255,0); // green
  ds.DrawRectangle(0, 0, ron_hp, 15); // draw health
  ds.Release(); // end drawing
  btnHealth.NormalGraphic = ron_gauge.Graphic;
}

EDIT: fixed code


Now create a button 100 pixels wide and 15 high called "btnHealth" on a GUI.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: thom0512 on Thu 28/08/2008 01:00:38
Thanks, KhrisMUC, for your quick response.

I got rid of the GUI health bars except for one, where I put a button on it, called btnHealth.  I only want my character to start out with 30 HP, so I am assuming that a pixel is equivalent to a hit point in this case.  So I made the button 30 pixels wide and 5 high (a "landscape" health bar).

I copied and pasted the new code into the global script and, in some instances, the room script where the function was not recognized.  The game starts out okay, but whenever I run into:

ron_gets_hit(10);

...the game crashes.  It says that the error is "null pointer referenced" and that part of the problem is this:

DrawingSurface *ds = ron_gauge.GetDrawingSurface();

...which is part of the code that I tried out.  I searched the forum for what "null pointer referenced" means but didn't find anything that helped me with this situation.  What am I doing wrong?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 28/08/2008 07:27:01
Ok, alternatively you could make the button 60 pixels wide, then draw to ron_hp*2.

Regarding the second problem, I was already afraid that's gonna happen.
The problem is that the DynamicSprite is null, or nothing, an empty slot, if you will, so one can't call its .GetDrawingSurface() method.

Do this: draw a properly sized sprite, a green rectangle of 30x15. Import it, then assign it as the button's normal image.
Now directly above the error throwing line, add:
  ron_gauge = DynamicSprite.CreateFromExistingSprite(btnHealth.NormalGraphic);
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: thom0512 on Sat 30/08/2008 01:55:50
All right...I'm about there.  I'm able to have a health bar that can decrease based on the number of hit points put in a specific part of the script.  It all works fine, but my last question for now is how I am able to have the health bar run out of HP and therefore end in a "game over."  The script just keeps a single hit point in the health bar, no matter how much damage Ron takes, and I'd like to change this.

By the way, KhrisMUC, the DynamicSprite and DrawingSurface functions have been extremely useful.  I knew there was a way from the start to have a button serve as a health bar, instead of the GUIs, but there have been so many examples explained on the forum I was lost as far as how to place that into the global script.  I really appreciate the help.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Sat 30/08/2008 08:50:00
No problem :)

Here's some adjusted code:
function ron_gets_hit(int damage) {
  ron_hp -= damage;
  if (ron_hp < 0) ron_hp = 0;
  ron_gauge = DynamicSprite.CreateFromExistingSprite(btnHealth.NormalGraphic);
  DrawingSurface*ds = ron_gauge.GetDrawingSurface();
  ds.DrawingColor = 16; // black
  ds.DrawRectangle(0, 0, 99, 15);  // clear gauge
  ds.DrawingColor = Game.GetColorFromRGB(0,255,0); // green
  if (ron_hp > 0) ds.DrawRectangle(0, 0, ron_hp, 15); // draw health        only draw health if > 0
  ds.Release(); // end drawing
  btnHealth.NormalGraphic = ron_gauge.Graphic;

  // kill ron
  if (ron_hp == 0) player.ChangeRoom(666);    // or play death animation, or ...
}
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: thom0512 on Wed 10/09/2008 05:03:12
I have one last question for the moment.  The health bar is up and running and it all works great.  I would like to include some inventory items in my game that if they are used with the character, Ron gains HP.  I have created a first-aid kit, and here is the code I have to have Ron recover health, rather than lose it.

Code:
function ron_heals(int amount) { // function used to have Ron recover health
  ron_hp += amount;
  if (ron_hp < 0) ron_hp = 0;
    btnHealth.Width = ron_hp;
    ron_gauge = DynamicSprite.CreateFromExistingSprite(btnHealth.NormalGraphic);
    DrawingSurface*ds = ron_gauge.GetDrawingSurface();
    ds.DrawingColor = 16; // black
    ds.DrawRectangle(0, 0, 99, 15);  // clear gauge
    ds.DrawingColor = Game.GetColorFromRGB(0,255,0); // green
    ds.DrawRectangle(0, 0, ron_hp, 15);
    ds.Release(); // end drawing
    btnHealth.NormalGraphic = ron_gauge.Graphic;
}

The problem that I am encountering is this: When I use the first-aid kit on the character, the bar adds more green, showing that he is recovering health.  But if he takes damage after this, the healing is almost "disregarded" -- the bar lowers as if a first-aid kit weren't even used.  (Take this, for example.  Ron has 10 HP out of 30 HP.  The first-aid kit is used on him to recover 20 HP, which shows on the bar, equaling 30/30 HP.  But if he is hit after this, let's say 5 HP worth of damage, all of this "recovered" green disappears, showing in the bar that he now has 5 HP out of 30 just from that one hit.)  I hope I'm making sense.  What's the problem here?

I would really appreciate any help regarding this issue. Thanks!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Mon 15/09/2008 12:17:55
First of all, it isn't necessary to use all that duplicate code, all you need to do is pass a negative value as the amount of damage.
Then you'll need an additional line after those two:
  ron_hp -= damage;
  if (ron_hp < 0) ron_hp = 0;

  if (ron_hp > 30) ron_hp = 30;   // add this


This should solve your other problem, too.
I'm not sure how it is caused exactly, though.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: thom0512 on Thu 18/09/2008 03:24:08
I tried your suggestion by adding the extra line of code where it was needed.  The change didn't seem to do anything, however...it just still stays the same as before. ???

And to clarify, I did get rid of that extra bit of code I had before, added the one line of code from your last post, and am inputing health as taking damage a negative value.  It still isn't working for me...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 18/09/2008 16:30:31
Did you declare ron_hp outside the function?
By putting this above it:
int ron_hp = 30;
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: thom0512 on Fri 19/09/2008 03:51:18
I checked, and I already had that line up above the function.  I'm not sure what I am missing.  If you don't mind, let me show you what I've got so far.

This is the code I have in the global script.


int ron_hp = 30;
DynamicSprite*ron_gauge;

function ron_gets_hit(int damage)
{
  ron_hp -= damage;
  if (ron_hp < 0) ron_hp = 0;
  if (ron_hp > 30) ron_hp = 30;
  ron_gauge = DynamicSprite.CreateFromExistingSprite(btnHealth.NormalGraphic);
  DrawingSurface*ds = ron_gauge.GetDrawingSurface();
  ds.DrawingColor = 16; // black
  ds.DrawRectangle(0, 0, 99, 15);  // clear gauge
  ds.DrawingColor = Game.GetColorFromRGB(0,255,0); // green
  if (ron_hp > 0) ds.DrawRectangle(0, 0, ron_hp, 15); // draw health        only draw health if > 0
  ds.Release(); // end drawing
  btnHealth.NormalGraphic = ron_gauge.Graphic;
}


This is the code I have for a first-aid kit to recover health (with a sound playing when that happens).


function cRon_UseInv()
{
  if (cRon.ActiveInventory == iFirstaidkit) { // use first-aid kit on self
    PlaySound(19);
    ron_gets_hit(-20);
    cRon.LoseInventory(iFirstaidkit);
  }
}


...and here is an example of Ron taking damage from the first example I could find from my game (with the first code listed above shown at the top of the room script).


function hStove_Interact()
{
  cRon.Walk(269, 179, eBlock);
  cRon.LockView(15);
  cRon.Animate(2, 1, 0, eBlock);
  cRon.UnlockView();
  PlaySound(17);
  ron_gets_hit(15);
{
  if (ron_hp == 0){
    cRon.Say("&93 Uhh...");
    cJon.Say("Ron?");
    PlaySound(11);
    cJon.LockView(17);
    cRon.LockView(16);
    cJon.Animate(0, 0, eOnce);
    cRon.Animate(2, 1, 0, eBlock); // catch on fire
    cJon.UnlockView();
    cRon.UnlockView();
    cRon.ChangeRoom(17);} // obvious game-over
  if (ron_hp > 0){
    cRon.Say("&91 Ouch!");
    cRon.Say("&92 I know better than to touch a hot stove.");
    cJon.Say("Oh, c'mon Ron...");
    cJon.Say("That's so HOKEY!");
    cJon.Say("Getting burned by a stove?");
    cRon.FaceLocation(268, 0, eBlock);
    Wait(80);
    cRon.FaceLocation(268, 194, eBlock);
    }
  }
}


The animation pretty much shows Ron catching on fire from the stove once his HP has reached zero, or at least, that's how I'd like it to work.  The same problem seems to be here: I touch the stove and lose 15 HP.  Using the first aid kit (recovering 20 HP, but really only going to 30 HP, the maximum) I touch the stove again and Ron loses all of his health instead of another 15 HP.  What am I missing?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Wed 24/09/2008 00:42:38
Here's an actually tested version of the main function:
function ron_gets_hit(int damage) {
  ron_hp -= damage;
  if (ron_hp < 0) ron_hp = 0;
  if (ron_hp > 30) ron_hp = 30;
  ron_gauge = DynamicSprite.Create(30, 15);
  DrawingSurface*ds = ron_gauge.GetDrawingSurface();
  ds.DrawingColor = 16; // black
  ds.DrawRectangle(0, 0, 29, 14);  // clear gauge
  ds.DrawingColor = Game.GetColorFromRGB(0,255,0); // green
  if (ron_hp > 0) ds.DrawRectangle(0, 0, ron_hp-1, 14); // draw health        only draw health if > 0
  ds.Release(); // end drawing
  btnHealth.NormalGraphic = ron_gauge.Graphic;
}


Apart from some minor coordinate correction, the main fix is the line used to create the new sprite; I didn't assign a properly sized sprite to the button in the editor (and neither did you, I assume), and thus the sprite was too small and had wrong colors (my guess is AGS used the blue cup sprite 0).
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Zachski on Thu 16/10/2008 21:30:03
Actually, I have a question.

I'd like to do a semi-RPG combat style similar to that of Quest for Glory 1 (the VGA version).

With some personal tweaks, of course, which I'll figure out later.

Before I go charging into this and end up with a broken battle system and a mess of code, what should I do and what should I avoid?  I understand that it's gonna require some animate commands and checking for variables and stuff...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Fri 17/10/2008 00:29:48
Do:
-write nicely structured, properly indented, commented code
-use fitting variable names

Avoid:
-starting off unless you've got fair programming and AGS experience

On a slightly more serious note:
QFGs battle system is not _that_ hard to emulate, since it's relatively simple and uses real-time.
But it's still going to be a good deal of semi-complex coding.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Takyon on Sun 08/03/2009 03:42:14
If you knew the program well enough could you make a game to the standard of say monkey island 3 or broken sword 1/2? Hypothetically...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Trent R on Sun 08/03/2009 06:31:50
Shame. I saw a new reply to this thread and thought it was something exciting....

Actually, I was going to post some progress of my RPG/Hybrid, to give others ideas. Just have to take the time to do it..


~Trent
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Takyon on Sun 08/03/2009 12:56:48
lol sorry to disappoint Id just read most of the thread and felt I needed to ask the question :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sun 08/03/2009 13:07:53
And to answer it, yes you can. The technology is there, all you need to do is create quality content. I think I remember there is a Broken Sword 1 1/2 game available- made with AGS.

Sorry for the thread hijack.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Takyon on Sun 08/03/2009 13:20:00
Thanks Ghost sorry I'm very much a "newb" still. Oh yeah I think you might mean broken sword 2.5 www.brokensword25.com.
Looks very good but as you you get further in the game the plot becomes rather ridiculous lol
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Takyon on Sat 14/03/2009 03:30:23
Can I use voice overs and voice acting etc with AGS or do I have to download a new program to incorperate it with AGS?

E.G. I've recorded the voice in cubase etc and want it to work when I look.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sat 14/03/2009 12:26:59
Not too sure about cubase, but you can indeed use voiceovers with AGS. WAV, OGG and MP3 are supported. Basically you record your speech and, instead of simple Say commands, enter something like
cEgo.Say("&10 Hi! How are you?");
...where a file ego10.wav would be played.

Enter the keyword "speech" in the AGS manual to find a more elaborate description, but as you see, it's possible to do voice acting in AGS.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Takyon on Sat 14/03/2009 13:42:19
Thanks ghost great help :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Dualnames on Mon 16/03/2009 08:08:21
Quote from: J Skeng on Sat 14/03/2009 13:42:19
Thanks ghost great help :)

In a suggestion music thread (just a week topic) Chris said he'll put a function to play a certain speech file, so you might want to wait a bit before start numbering and all. Just a thought.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Takyon on Mon 23/03/2009 19:21:48
Ahh thanks dualnames I'll wait a wile then.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Shockbolt on Thu 26/03/2009 10:08:35
How would one go about, creating a game having a code that changed day into night and the other way around, and also having something that would allow for the game to change seasons (summer, autumn, winter, spring)?

The scenes will change accordingly to the above, and the player should be able to have an option to sleep/rest to speed things up.

I've gone through the tutorials, read up on several website (with old codes that don't help me much now)
I'm reading the manual now, but for a graphic artist, it's mighty tough to understand how it all fits together. I mean, I could aswell have been studying advanced chinese, I don't think it'd be much more difficult than this :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 26/03/2009 10:35:21
AGS allows up to five background frames for each room; instead of using them for constantly animating the background, you can switch between them, so that's how I'd go about having four seasons in each room.

The best way to accomplish a day-night-cycle depends on how sophisticated you want it to look.
A very easy way is to use a semi-transparent, black (or slightly bluish), non-clickable GUI.

If you want to use different background images for day & night, you have to use two rooms per location (since you'd need 8 background frames then).

The technical side is comparatively easy; each room has a before fadein event, in there you'd check the current season (stored in a global variable), then change the room background accordingly.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Shockbolt on Thu 26/03/2009 10:43:56
Quote from: KhrisMUC on Thu 26/03/2009 10:35:21
AGS allows up to five background frames for each room; instead of using them for constantly animating the background, you can switch between them, so that's how I'd go about having four seasons in each room.

The best way to accomplish a day-night-cycle depends on how sophisticated you want it to look.
A very easy way is to use a semi-transparent, black (or slightly bluish), non-clickable GUI.

If you want to use different background images for day & night, you have to use two rooms per location (since you'd need 8 background frames then).

The technical side is comparatively easy; each room has a before fadein event, in there you'd check the current season (stored in a global variable), then change the room background accordingly.


Thanks, but what if I wanted the game itself to handle the transitions between seasons and day/night, by how much real-time You're spending in the game:

For example 20 minutes in realtime would be the lenght of the day or night in the game, 4 hours in realtime would be the lenght of one season (I might end up using just summer/winter for the first version of the game)


I seem to remember that in the Quest for Glory 1 game, day and night occured on a regular basis.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 26/03/2009 11:28:29
There's a function called repeatedly_execute() in the global script that is called 40 times per second (40 is the default value, the current setting can be obtained using GetGameSpeed()).

You'd use a variable to count minutes:

// above rep_ex

int timer, minutes; // declare two variables, intial value is 0

// inside rep_ex

  timer++;
  if (timer == GetGameSpeed()*60) {   // one minute of real-time has passed
    minutes++;  // increase minute counter
    timer = 0;    // reset timer

    if (minutes%20 == 0) SwitchDayNight();  // cull custom function that handles day/night

    if (minutes == 60*4) {  // four hours of real-time have passed
      AdvanceSeason();   // call custom function that advances to next season
      minutes = 0;  // reset minutes
    }
  }
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Shockbolt on Thu 26/03/2009 11:36:49
Quote from: KhrisMUC on Thu 26/03/2009 11:28:29
There's a function called repeatedly_execute() in the global script that is called 40 times per second (40 is the default value, the current setting can be obtained using GetGameSpeed()).

You'd use a variable to count minutes:

// above rep_ex

int timer, minutes; // declare two variables, intial value is 0

// inside rep_ex

  timer++;
  if (timer == GetGameSpeed()*60) {   // one minute of real-time has passed
    minutes++;  // increase minute counter
    timer = 0;    // reset timer

    if (minutes%20 == 0) SwitchDayNight();  // cull custom function that handles day/night

    if (minutes == 60*4) {  // four hours of real-time have passed
      AdvanceSeason();   // call custom function that advances to next season
      minutes = 0;  // reset minutes
    }
  }


Thank You! Simply amazing, I don't know if I'll ever be able to do stuff like that.
I mean, my brain hurts just by looking at the codes above, trying to understand how on earth one is able to understand and know when to put everything together
and make stuff work like You want it to. *sighs*
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Shockbolt on Fri 27/03/2009 11:56:44
Well...I'm stumbling along after a computercrash last night which ruined my progress so far with my game..
Starting all over again is so fun :)

I've been going through the tutorials, manual, forum and other websites such as:

http://www.geocities.com/akk13us/rpg-tuto.htm

My problem is that I want my adventure/rpg to have a handful of stats that can be affected all over the gameworld.
These are : Alchemy, Coins, Fatigue and Hunger.
These should be GlobalInt's and be constantly updated and shown in the GUI 0 : gStatusline.

Lets focus on just one of the stats: Alchemy, as I'll be able to cope with the others based on the help I'll get with that one.

in GUI 0 : gStatusline , I've made two labels : label 1 shows text "Alchemypoints:" , label 2 shows "..."

In the Global variables I've defined : "myAlchemypoints" "int" and the initial value of "5"

The problem appears when I test my game using these codes in the rep_ex :

  String Alchemy;
  String.Format(Alchemy, "%d", myAlchemypoint);
  Label.Text(0, 2, Alchemy);

The error message I get is:
GlobalScript.asc(62): Error (line 62): must have an instance of the struct to access a non-static member


Whatr am I doing wrong here?

------
Edit:

I actually found out myself in a reply that had escaped me in the first searches:

LabelAlchemy.Text=String.Format("Alchemypoints: %d", myAlchemypoint);

-------

Problem solved :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Fri 27/03/2009 19:43:55
It should be noted that this tutorial is really old and wasn't exactly perfect when it was published, either (sorry Gord).
You did a good job of adapting it to current script though. :)

For reference: String.Format returns the first parameter with the following ones inserted. So it is exclusively used to the right of a "=" or as parameter of another function.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Shockbolt on Fri 27/03/2009 22:18:08
Quote from: KhrisMUC on Fri 27/03/2009 19:43:55
It should be noted that this tutorial is really old and wasn't exactly perfect when it was published, either (sorry Gord).
You did a good job of adapting it to current script though. :)

For reference: String.Format returns the first parameter with the following ones inserted. So it is exclusively used to the right of a "=" or as parameter of another function.

Thanks! a few days of studying code scripting for the first time can do wonders.
I just wish the manual would give more obvious examples as to what the more advanced commands do (going further than what's seen in the tutorial(s), examples that
are related to adventure games. Cuz frankly, it's a "hell" trying to imagine what the commands do, and which commands fit together and are appropriate for what You want to do.

That said, I think I've learned alot of what I need for my games just by visiting this forum for the last few days, and I guess I'll post some of the stuff I've made so far, if there's an appropriate thread for that in here somewhere.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: tanito0 on Sat 04/04/2009 14:09:00
Could you help me? I'd like to make a limited space inventory. And also, how could I make my character have more than one of the same item?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Dualnames on Sat 04/04/2009 23:00:36
Quote from: tanito0 on Sat 04/04/2009 14:09:00
Could you help me? I'd like to make a limited space inventory. And also, how could I make my character have more than one of the same item?

For the second question, there's a setting on the General Settings of the game, I can't recall, but it won't be tough to figure out, something with inventory items..Sorry for a non straight reply.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Trent R on Sat 04/04/2009 23:30:17
For a limited space, a simple way would be to create a Global var in the Global Variables Pane. (I've called it InventoryCount)

Then in your global script, in the on_event function (if it doesn't exist, type it in--this is one of the few functions you are allowed to simply type in) add the following.
function on_event (EventType event, int data) { //like I said, if you already have it...
  if (event==eEventAddInventory) {
    if (InventoryCount>=10) { //if you want a limit of 10
      player.InventoryQuantity[inv[data]]--; //this is in case you've reached the limit, it manually removes it
      return;
    }
    else InventoryCount++;
  }
}
  if (event==eEventLoseInventory) {
    InventoryCount--;
  }
}


If you read the manual entry of InventoryQuantity, it tells you that you should use AddInventory and LoseInventory, which you should. InventoryQuantity doesn't call the on_event, which is what you need to keep the limit. Therefore, if you need to add large amounts of Inventory (though I don't see why), you would need to use a while loop.


That should work. Another way would be to keep track of an InventoryItem array (I did that in my unreleased RingInv module, which replaces the normal InvWindow control into a SOM style Ring). But it is more complex, so only if you have a good reason.

~Trent
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: on Sun 05/04/2009 00:01:39
Quote from: tanito0 on Sat 04/04/2009 14:09:00
Could you help me? I'd like to make a limited space inventory. And also, how could I make my character have more than one of the same item?

More than one of the same item is simple, just set "display inventory items multiple times" in the general settings pane.

And for a limited space inv, I usually recommend this module:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28177.0 (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28177.0), which gives you a Diablo2-style, gridbased inv. Few remember it, but it works very well.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: tanito0 on Mon 06/04/2009 00:56:17
 ;) for your solutions, I'll make good use of them.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: krishaw on Tue 14/04/2009 19:49:40
I might be a little late to the party on this topic but RPG maker VX (go to www.phanxgames.com) makes great looking RPGs, is very easy to use and if you don't like writing your own script, you have the choice to just use a simple Ruby script program where you just have simple "turn switch on" or "add variable" without any real script (or you could just script yourself).

I sound like a bot don't I?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Tue 14/04/2009 22:56:16
You rather sound like you're missing the point of this thread... ;)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: krishaw on Sat 18/04/2009 20:11:46
Yeah I know but I'mjust saying that rather than complicating it with making an RPG with an adventure game studio, it would make more sense to make an RPG with an rpg studio.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Tue 21/04/2009 20:48:39
I think it´s good idea to write it here, because there are many people who wants to do an RPG without scripting and RPG maker could be solution. I have tried it, too, but I am accustomed with AGS.  ;)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Sat 25/04/2009 22:40:56
I created an RPG with AGS and having played about with RPG maker and its ilk before, I can tell you that AGS is a far better tool for it. Not wanting to start a flame war or anything but the RPG-centric creation tools are just too narrow-minded and it is very hard to create something unique or original. AGS is far more flexible.

On another note, I am currently working on a tutorial for creating a RPG with AGS. Watch this space...   
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Trent R on Sun 26/04/2009 01:13:50
Indeed. As the first post says, it very possible and we've seen a lot in the past. But if you're not willing to put in the work, RPGMaker is an excellent solution (though to say there's nothing unique is too much. I just started playing Exit Fate, and I love it!)

Also, I'm excited to see your tut bush_monkey. It'd be good to have another one, since newbies seem to gravitate to it like it's the Holy Grail of AGS/RPG Tutorials, despite it being very old and mediocre (but better than nothing)


~Trent
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Sun 26/04/2009 12:19:38
Here is the first part of my RPG tutorial:

http://opinionsandcreations.ning.com/profiles/blogs/ags-rpg-tutorial-part-one

Part 2 will be up this evening. I hope some of you find it useful.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Sun 26/04/2009 16:22:30
part 2 is now up:

http://opinionsandcreations.ning.com/profiles/blogs/ags-rpg-tutorial-part-two
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Sun 26/04/2009 23:34:10
part three of the RPG tutorial is now up as well:

http://opinionsandcreations.ning.com/profiles/blogs/ags-rpg-tutorial-part-three

Hi guys, sorry I haven't uploaded part four yet, I was having problems with my internet connection. Part four will be up later on today.

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Sun 03/05/2009 21:19:02
Part four of the tutorial is now up:

http://opinionsandcreations.ning.com/profiles/blogs/ags-rpg-tutorial-part-four

I have also rectified an error in part 3: References to globalint 53 should have been globalint 1, sorry if this stumped anyone  :P

Part five will be up tomorrow. 
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Trent R on Fri 08/05/2009 06:37:56
As of this posting, the linked thread is only minutes old. But the question was how to change backgrounds from day to night like Quest For Glory. Since this is a stickied thread, I figured I past the link here so it wouldn't be lost--and because it's super relevent to AGS RPGs.
Colour Cycling of day and night (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37717.0)


~Trent
PS-Bush_monkey, I've only looked at Part 1 so far, and it looks pretty interesting. However, I'd be careful not to quad-post and start editing your posts. Image (http://dl.getdropbox.com/u/837372/Big%20arrow.jpg)
PSS-I'm not a mod, just some friendly advice. :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Fri 08/05/2009 13:31:23
Thanks Trent R, I just wasn't sure whether 4 posts days apart should be in the same window or not. Consider this post my placeholder for all future parts of the tutorial  ;D

Part 5 will be up later today and is easily the most complex part of the tutorial.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Fri 08/05/2009 14:01:03
bush_monkey, while I appreciate the effort, it should be noted that you're using GlobalInts and even old style code, both of which are long obsolete.
You're also using a variable width font without indentations for the code snippets.

So, while I still do appreciate the work you're putting into this, teaching people unclean, obsolete code might do more harm than good.

I'm always a bit sceptical of the various tutorials floating around here in general since they usually contain small flaws, so don't take my opinion as the one of the forum.
But I think that a text that teaches people how to code an RPG should at least use OO code, with it being around since AGS 2.7 I believe.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Fri 08/05/2009 16:10:10
Hi KhrisMUC, I did think about this when I started but as I mentioned in the tutorial, the game the tutorial is based on was started before AGS 2.71 was released.

Whilst I am a big advocate of OO programming (being a C# programmer by trade), I did not want to write a tutorial in AGS 3.1 as I have not used AGS 3.1 yet.

I do think my tutorial will still serve as a good starting point for anyone wanting to create an AGS RPG . Some of the code might be obsolete but the underlying methodology is still correct.

As I am quite far in the tutorial, I don't really want to change the code at this time but if there is enough demand, I will create a 3.1 version of the code at a later date. 

As for the indentation, I've become lazy from Intellisense  :P I will amend the tutorials to make them cleaner.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: HammerBlade on Wed 17/06/2009 04:12:41
You are right about the underlying methodology of your tutorial; it's almost a carbon copy of the coding style I've adopted for the FF ATB-system rip-off I'm working on.  

Although your methods are a LOT less convoluted than mine (that's what you get when you make up standards for your code as you write it I guess  ::))

I'm tempted to volunteer to rewrite your tutorial to be AGS 3.1 compliant, if not for my excessive use of #define, export and import which might be regarded as poor programming practice.  (I tend to put incrementor variable declarations on the same line as while loops.  The scandal!)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Wed 24/06/2009 13:16:06
Actually HammerBlade, the reason why I haven't posted in a while is because I was foolish enough to try and redo the tutorial frm scratch in 3.1. This is taking me forever  :P

I have a semi-complete tutorial on the battle system for AGS 2.6 which I will tidy up and post soon.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: HammerBlade on Tue 30/06/2009 03:24:05
Alrighty then, if you're already on top of it, I see no reason to interfere.   :=

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bush_monkey on Sun 12/07/2009 00:27:22
Part 5 of my RPG tutorial is now up:

http://opinionsandcreations.ning.com/profiles/blogs/ags-rpg-tutorial-part-five

This is the hardest of all the tutorials as it discusses the battle system. I have checked it very thoroughly but if you find any mistakes, omissions or just do not understand certain parts, let me know. 
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: charliechuck on Wed 15/07/2009 13:02:20
Would anyone be interested in looking at the source code to Winterlong? Again it's similar to Final fantasy style combat. I've not touched it in years, I think it was written in AGS 2.72? If anyone is interested let me know which files to upload.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: jocke the beast on Sat 18/07/2009 18:42:45
Please do so. I would love to learn a bit from it.
Thanks!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: charliechuck on Thu 30/07/2009 12:32:41
It's here

http://donspillacy.googlepages.com/ac2game.ags (http://donspillacy.googlepages.com/ac2game.ags) if anyone fanices a look.

I think that's the only file you need to be able to see the code. The fights take place in room 2, so most of the code is there. I'm not sure if this will be much use to anyone or not probably not. It's not the cleanest written code and there's no instructions, it's been so long since I did it I wouldn't have a clue what bit does what anymore.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: HintBook user on Fri 28/08/2009 03:21:20
I'm making an RPG with health and stamina bars (using the DrawRectangle function), similar to the ones in Quest for Glory.

The problem is that the character will level up, and their maximum amount of health and stamina will change, but I want the bars to stay the same length.

I tried writing the DrawRectangle function like this:
a_hp.DrawRectangle(0, 0, ((Aaron_health/Aaron_health_max)*80)-1, 4);

It works fine for Aaron's health, but not for the other bars.

Anybody know what I'm doing wrong?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: monkey0506 on Fri 28/08/2009 03:30:56
Your code looks fine, what does the code for the other character's meters look like?

By the way, you can use [code] and [/code] to encapsulate your code like this:

a_hp.DrawRectangle(0, 0, ((Aaron_health/Aaron_health_max)*80)-1, 4);

Makes it a bit more readable here in the forums, and prevents any issues with formatting (such as 8 followed by a parenthesis resulting in 8)). ;)

Welcome to the forums as well.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: HintBook user on Fri 28/08/2009 04:13:58
Thanks for the welcome.

Here is the code for the other meters.

a_sp.DrawRectangle(0, 0, ((Aaron_stamina/Aaron_stamina_max)*80)-1, 4);

e_hp.DrawRectangle(0, 0, ((Enemy_health/Enemy_health_max)*80)-1, 4);

e_sp.DrawRectangle(0, 0, ((Enemy_stamina/Enemy_stamina_max)*80)-1, 4);


I basically copied and pasted the function for Aaron's health and changed the words around, so I'm not sure if this explains anything.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: monkey0506 on Fri 28/08/2009 04:22:20
Okay, again the code looks fine. Now then, what is actually happening?

One thing here I can think of is that perhaps you're not calling DrawingSurface.Clear on your surfaces before trying to draw the rectangle? Because obviously if you keep drawing them on top of each other in the same color you wouldn't see the changes (unless it was increasing of course).

Other than that where are the variables being updated at? Are you certain the values are what you think they are?

Where are you calling this code? Is it in the same place as the first code?

If all else fails you could always use some breakpoints to make sure that the lines are being called and some Display-s to make sure that the variables are the values you expect (such as):

Display("Aaron's stamina: %d", Aaron_stamina);
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: HintBook user on Fri 28/08/2009 05:23:52
What happens is that when Aaron_stamina is equal to Aaron_stamina_max, it fills the bar normally, but if Aaron_stamina is any less than Aaron_stamina_max, the rectangle shows as only one pixel wide.

All of the lines of code are part of seperate functions, which are called whenever their value is changed.

Just to check, I put in displays showing what the values changed to, and they are correct.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Fri 28/08/2009 08:03:59
With ints, if a is less than b, a/b is always 0.
You need to use

  if (Aaron_health > 0) a_hp.DrawRectangle(0, 0, ((Aaron_health*80)/Aaron_health_max)-1, 4);
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: HintBook user on Fri 28/08/2009 16:06:32
Thanks!

It works perfectly now.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: monkey0506 on Fri 28/08/2009 16:31:43
Quote from: KhrisMUC on Fri 28/08/2009 08:03:59With ints, if a is less than b, a/b is always 0.

D'oh! I should've caught that...of course.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: darkwolfe on Thu 03/06/2010 09:33:59
It seems most of the info concerns turn-based rpgs, but can a Legend of Zelda-style game be made--basically, something with real-time combat?

RPGMaker also seems to be intended for turn-based combat. If AGS isn't suited for a game of this type, I'd appreciate if someone can point me to a suitable engine that can be used commercially (thus, I'm not interested in the Zelda Classic/ZQuest engine).

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 03/06/2010 10:35:53
A suitable alternative would be GameMaker, but in theory, a (SNES) Zelda clone is perfectly possible to create with AGS.
You'd have to do a lot of scripting though since you can't really use much of the built in functionality. There's a TileEngine (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=40922.0) by abstauber that should diminish the workload a bit.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Tue 27/07/2010 15:29:14
Quote from: darkwolfe on Thu 03/06/2010 09:33:59
It seems most of the info concerns turn-based rpgs, but can a Legend of Zelda-style game be made--basically, something with real-time combat?

Yes, it is possible and even not too hard to create. If you want to do a game with real-time combat, I think it´s easier to do normal and combat rooms.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Lufia on Thu 30/09/2010 06:30:52
It might be easier to script your A-RPG engine in RPG Maker, actually. The base architecture of the project will be more adapted to an RPG and you can do whatever you want with Ruby. I've even seen passable A-RPGs done exclusively with event programming in RPG Maker.

Enterbrain also released Indie Game Maker, which is designed for platformers, shmups and A-RPGs.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Matagot on Tue 07/02/2012 07:31:53
How possible or difficult is it to design retro first person view style RPGs such as Eye of the Beholder, Dungeon Master, Wax Works, Black Crypt, etc with AGS where you click on arrows to guide your party of characters through mazes and fight wandering monsters?

Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Tue 07/02/2012 14:47:27
Very possible, there is a game like that in the works, I can't find the thread right now though.

Basically, all level info is stored in a grid, and the first person-view is generated by iterating through that grid from far to near, drawing pre-made walls.
I'd say the scripting involved is semi-complex. You'll need AI that moves monsters around and some short of shop system, I guess.

It all comes down to organizing a buttload of data well enough to not pull your hairs out continuously during coding :)

(In general, there's pretty much no limit as to what type of game can be created with AGS, except speed.)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Matagot on Tue 07/02/2012 22:44:21
Quote from: Khris on Tue 07/02/2012 14:47:27
Very possible, there is a game like that in the works, I can't find the thread right now though.

Basically, all level info is stored in a grid, and the first person-view is generated by iterating through that grid from far to near, drawing pre-made walls.
I'd say the scripting involved is semi-complex. You'll need AI that moves monsters around and some short of shop system, I guess.

It all comes down to organizing a buttload of data well enough to not pull your hairs out continuously during coding :)

(In general, there's pretty much no limit as to what type of game can be created with AGS, except speed.)

Brilliant! Please let me know via PM of any related threads or advice/codes/grid info on how to make such an RPG.

;D
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Tue 10/04/2012 20:04:29
Eye of the Tempest (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=35463.0) is what you migt be interested in, but it looks like it was cancelled long time ago.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: DBoyWheeler on Fri 04/05/2012 02:11:41
Concerning the RPG with AGS... someday I may want to do something Quest for Glory style.  I can find the Day/Night tutorial thread and the Hunger tutorial thread (and I'd probably do it in the style of the first four QG games where the hero would eat automatically if he had rations), and perhaps other things I can try to search for or ask for if needed, but I thought I'd ask this out of curiosity...

For some of these ideas, I'd probably need more than the 200 save state rooms alloted, so... I'm just guessing this, but for the non-save-state rooms, would they be best for the "overworld" areas?  I'm also guessing you'd need global variables to check if a monster is chasing you or not, and how many screens you'd have to run before the monster loses interest in you and leaves you alone.  If my guess is incorrect, feel free to correct me on this.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Fri 04/05/2012 11:09:11
You can have 299 state-saving rooms per game.

There are several ways to overcome this limit though. As you mentioned, rooms that are basically just scenery are best for non-saving ones. They can still have random events and the like.
Just to clarify, non-saving means that room variables' values are lost, and the state of objects, hotspots, regions and walkable areas. So if a room only has an NPC's shop (and no locked doors or the like), it's fine to use room 300 and above. Even if it did though, you could use global variables to store the state and re-init the room in its before fadein event.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: DBoyWheeler on Sat 05/05/2012 01:27:57
Cool!  Thanks.  It's a good thing this thread is in my bookmarks, so I can hunt for something here when I need it.  It may be a long time before I do such a game, but when I'm ready, I'll have the info I need.  Thanks again!  :)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: VVK on Wed 02/01/2013 20:14:15
I'm pretty new to this, but I've been playing around with the idea of something RPG-ish too, and there's one thing sometimes done in RPGs about which I'm not sure whether it could be done in AGS. I haven't quite found a proper answer to this anywhere. So: Is it possible to customise a character's appearance by combining different elements, like hair style and eye colour and such? Like when creating a custom player character, but it could also be used for creating stock NPC appearances and changing the clothes or armour someone is wearing. Even if customisation is just limited to the initial character creation, there would obviously be too many combinations of even just a few different options for it to make sense to make a different collection of sprites for each.

I suppose there are two separate questions here: whether it's possible to combine pre-made pieces within the game to (effectively or actually) create a new sprite, which is more important; and whether it's possible to colour the "pieces", eg. just create and import one image for a specific hair style (or, well, you know, one per needed frame of animation or whatever will be needed for other reasons) but then tell AGS to recolour it when needed.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Crimson Wizard on Wed 02/01/2013 21:24:40
Quote from: VVK on Wed 02/01/2013 20:14:15
I suppose there are two separate questions here: whether it's possible to combine pre-made pieces within the game to (effectively or actually) create a new sprite, which is more important; and whether it's possible to colour the "pieces" , eg. just create and import one image for a specific hair style (or, well, you know, one per needed frame of animation or whatever will be needed for other reasons) but then tell AGS to recolour it when needed.
This is most possible. There's a concept of "dynamic sprite" in AGS, which allows you to create a new sprites at runtime and draw what you like on them (including painting other sprites over).
Manual topic: http://www.adventuregamestudio.co.uk/wiki/DynamicSprite_functions_and_properties
Also this: http://www.adventuregamestudio.co.uk/wiki/DrawingSurface_functions_and_properties

After the sprites are created, you may assign them to character View frames.
The Character's Tint property may also be useful to some extent:
http://www.adventuregamestudio.co.uk/wiki/Character_functions_and_properties#Character.Tint
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Wed 02/01/2013 23:14:02
About recoloring sprites: tinting only works for the entire character's appearance; however one could dynamically recolor sprites on a per-pixel basis.
Say you imported a pants sprite; if you only used greyscale colors for the pixels that are supposed to change color, you could iterate through every pixel and recolor it based on the brightness value.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: VVK on Thu 03/01/2013 01:17:53
Excellent, thank you. I'd actually wondered if dynamic sprites were suitable for this earlier, but I couldn't really see the forest for the trees when I looked them up in the manual, so I wasn't sure whether they worked that way.

So... if you wanted to combine several elements to make a sprite, would the way be to import them as separate sprites, then create a dynamic sprite and draw the elements onto it with DrawingSurface.DrawSurface?

And could you use Tint anyway by creating a dummy character with a sprite only consisting of parts that are going to be the same colour on a given character, tinting that (with saturation 100, of course), and then somehow taking the result and adding it to the finished sprite similarly to the above? Sounds more complicated, though, since if I read this right, it doesn't affect the sprite, just the character, so the only way I can see right now to accessing the result with these commands is through DynamicSprite.CreateFromScreenShot (plus DynamicSprite.Crop). And if you used that, could you have transparent parts in the resulting sprite? Okay, so maybe that doesn't work.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 03/01/2013 01:30:11
I'm pretty sure that if you take a screenshot, areas colored in "magic pink" (255, 0, 255) will end up transparent, yes.
The problem is that this process is going to be visible to the player, if only for a fraction of a second.

What you could try is use a room that's bigger than the screen so you can have an object off-screen, set the sprite as object graphic, tint the object, then merge the object into the background (this should retain the tinting). Now you can grab the off-screen part of the background.
The problem here is that the object will "physically" disappear from the game, so you can only do this once for every object.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: VVK on Thu 03/01/2013 01:39:00
Oh. I always wondered what "magic pink" was. (I've been lurking here for months.)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Radiant on Thu 26/12/2013 01:08:49
Well, fellow adventure gamers, let me tell you a little story. Years ago, when I was new to AGS and all I had written so far were some action/puzzle games, I first came across this site and thought it was awesome (and by the way, I still think it is awesome, and more so every year). That's basically because I grew up with adventure games, and I learned English by playing King's Quest and Space Quest and figuring out what commands to type. So obviously I made plans to write a game in AGS, but since I was doing puzzle games I was also looking into other genres than just adventures. And then I noticed this thread or its predecessor: is it possible to design an RPG in AGS? I thought about it for a while and concluded yeah, sure. As far as I know, back then nobody had actually done any RPGs yet, so I decided I would go and write an RPG, and then make a post in this thread here containing just the word "yes" and a link to my game. Well, it took awhile; game design takes up quite a bit of time and real life has a tendency to interject itself every now and then, so it's now almost ten years after I first registered for bigbluecup. That means that there have been several RPGs made before, and nobody has to prove any more that something is possible in AGS because we've all seen how versatile the engine actually is. That said, RPGs are still great and so are AGS games, so there's always room for another AGSRPG; it was fun to write one and I hope other people remain inspired to write more. So without further ado,

(http://www.corbydesigns.com/hq/hqscreen4.png) YES! (http://www.adventuregamestudio.co.uk/site/games/game/1748)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Ghost on Thu 26/12/2013 08:58:39
Quote from: Radiant on Thu 26/12/2013 01:08:49
(http://www.corbydesigns.com/hq/hqscreen4.png) YES! (http://www.adventuregamestudio.co.uk/site/games/game/1748)

This made my day. Well done, sir!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: .M.M. on Tue 31/12/2013 12:13:09
Quote from: Radiant on Thu 26/12/2013 01:08:49
YES! (http://www.adventuregamestudio.co.uk/site/games/game/1748)
Great job!
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: EHEBrandon on Sat 07/02/2015 00:05:46
Hello I was wondering.. I want to make a all 2D game but I want it to be like Persona 3 and 4.. The reason I use Persona 3 and 4 as a example is because it has a unique feature that works quite well.. It has this system called the "Social Link System" Basically it adds slice of life and dating sim elements to the game.. So for example once you level up a social link up to level 10 you could start dating the characters and dialog changes and you could also take them on dates and they will do things for you that they couldn't do before.. You could also date multiple people.. I want this system but a bit more advance where you could marry and have kids and such.. Also there is a calendar system in the game where it goes a whole year. Also each day you do something in the morning afternoon, daytime, evening, and night. So for example say if you go to school that will take up your morning. Then comes afternoon its lunch time you could choose a friend to hang out with and have lunch with them, evening you could rank up social links or move on into the dungeons and progress in the story, then at night you work or you could study, or level up your social links.. Then basically after those events the day changes to the next.. So say if that day was April 11th it will now be April 12th and etc.. So I was wondering if you could do something like that? I want people to be able to interact with everything and every character so the world will seem lively. Also fusions.. Because its really cool how you could make stronger Personas through fusions so is that possible as well?

Dungeon Example:

https://www.youtube.com/watch?v=5Z_bsUVPq3A

Here is a example of the calendar system, social link, and fusion:

https://www.youtube.com/watch?v=YDEqEiUaLCs


Better Social Link example:

https://www.youtube.com/watch?v=p5iopEFHGM8

Better example of fusions:

https://www.youtube.com/watch?v=QV9q3VGTxtQ

So basically I kind of want to make a game like this but all 2D with a nice anime style.. So would this all be possible? Sorry for the long message.. I'm new and its my first post. :D
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: VVK on Sat 07/02/2015 10:58:32
Hello. It's nice to see someone continuing this thread, as it's always inspired me reading the ideas that people talk about here.  :)

I'm still pretty inexperienced with AGS specifically, so take all this with a grain of salt, and I don't know Persona, but I imagine all of that could be done, particularly as I've been planning how I'd do some things like that myself - especially adding a relationship aspect (not dating, but that shouldn't be a big difference) to a game that isn't all about it.

I can't give much coding advice, but as I see it, the basic idea of developing relationships with characters should be really simple at the core. As you interact with the characters, that interaction changes some variables (they probably need to be global) in the game - that gives you the "social link level" directly - and those variables change what interaction possibilities are available in the future. You'd check the variables in dialogues and scripts and have conditions for those to act accordingly.

Of course, this is basically the same advice I'd like to give to almost every query here about how to realise some general idea: there are some variables that determine the state of the game world, and you interact with the game by changing those variables within limits given by them, and then the game shows you a different state that you can interact with.

I also have an idea for how you might do the daily cycle thing: Make leaving some key rooms activate a script that offers you options based on what part of the day is going on. So, you might start in your own apartment in the morning. Then, when you leave it (walk to the edge of it, probably shown as a door), you're given a dialogue with options as to what to do next. You choose one thing and then go to a room or series of interconnected rooms. Then once you've been there long enough (determined by the game or your own choice) you can walk out of the front door or whatever and are given another dialogue giving you choices for what to do in the afternoon. I could see ways of making this differently and perhaps better, but this is one starting point.

Dates should be simple to keep track of using variables again.

That's where I'd start, the next step being figuring out how exactly to make AGS do it in detail. I'm sure the people who really know about this stuff can give better advice.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Anshinin on Tue 17/02/2015 03:36:29
I'm wondering, since I'm following the basic BFAQ guide to making an RPG (obviously updating the script) but he never made it very clear how fights would work. I know this much

> Fights take place in separate rooms
> Enemies can be either characters themselves or hotspots
> Items in your inventory act as a way to attack
> Enemy health is set using SetGlobalInt

The basic jist of making this seems simple enough for me, but my question lies in the enemy health. I don't want all my enemies to default to one health code. So I'm assuming I'd have to make multiple GlobalInt for different health levels. Would there be some easier way to define this variable, or is a GlobalInt for each specific health level an enemy would be set at be the best option?

I am new to this, and I'm trying my best with it but if someone could give me an idea or lending hand in general in constructing the basics of a turn style battle system that'd be really appreciated (making the enemy have an AI and whatnot) The basics of making it happen I can do, but making it more fleshed out is where I am uncertain as to if I can accomplish without 10 miles of bugs.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: phillipPbor on Wed 18/11/2015 21:13:37
do you have a sample for making an RPG earthbound game?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Khris on Thu 19/11/2015 22:46:16
No. Creating an RPG with AGS is not recommended for beginners. Most tutorials are outdated, and you'll need a solid grasp of advanced scripting stuff.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bendugames16 on Tue 12/07/2016 09:45:43
Hi, glovemaniac here just letting you know I'm a beginner here and found some pretty decently executed ways to make some of the classic
game functions happen including   heart meters/ balls left, score and rpg functionality.

One method that worked well for me as a simple solution, without having to know more than simple loops, was to think of the objects
and characters as real objects on a table or floor or area.   even like a small machine made of small moving parts.  its a cheat and
probably not very condoned in the field :) but it gets the job done to get the ball rolling in your game to some degree. and its fast.

Ex:  Hearts are an image or meter image [[[[[[]]]]]]       you can move it and have it collide with an invisible character to  mimic
health dropping and once the collision occurs..    game over... or whatever have you.     (Think like a caveman)
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: bendugames16 on Tue 12/07/2016 09:54:39
Gloveman (it is actually, the Bendu guy) here....       Or another example for creating battles,

after months of beating my head against script, I found this:    you can use dialogs, but its a bit hairy,  to set a couple timers back and forth
if characters are in the specific battle rooms, the timers will activate one another's dialogs, and your dialog starts the other after the
selection has been done.. or what have you.  the dialogs even let you trail an automation of actions every time the dialog is triggered,
it can be counted, giving you the ability to set how many times a player or monster can be hit before it plays your destruction animation.;)

it works, trust me.  AGs is the 'cool beans'
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Egmundo Huevoz on Wed 27/12/2017 05:07:50
Quote from: Radiant on Thu 26/12/2013 01:08:49
Well, fellow adventure gamers, let me tell you a little story. Years ago, when I was new to AGS and all I had written so far were some action/puzzle games, I first came across this site and thought it was awesome (and by the way, I still think it is awesome, and more so every year). That's basically because I grew up with adventure games, and I learned English by playing King's Quest and Space Quest and figuring out what commands to type. So obviously I made plans to write a game in AGS, but since I was doing puzzle games I was also looking into other genres than just adventures. And then I noticed this thread or its predecessor: is it possible to design an RPG in AGS? I thought about it for a while and concluded yeah, sure. As far as I know, back then nobody had actually done any RPGs yet, so I decided I would go and write an RPG, and then make a post in this thread here containing just the word "yes" and a link to my game. Well, it took awhile; game design takes up quite a bit of time and real life has a tendency to interject itself every now and then, so it's now almost ten years after I first registered for bigbluecup. That means that there have been several RPGs made before, and nobody has to prove any more that something is possible in AGS because we've all seen how versatile the engine actually is. That said, RPGs are still great and so are AGS games, so there's always room for another AGSRPG; it was fun to write one and I hope other people remain inspired to write more. So without further ado,

(http://www.corbydesigns.com/hq/hqscreen4.png) YES! (http://www.adventuregamestudio.co.uk/site/games/game/1748)
Why don't you write a tutorial instead? At least the basics of how to make one...
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: TimeTravellerR on Thu 23/08/2018 07:23:53
I made a couple of different RPGs with AGS, years ago using the earlier version.

The first one was a classical adaptation of the Marvel Superheroes rules, and used global variables. What messed it up for me and made me abandon it was the GUIs, which didn't work elegantly. Knowing now what I do, and with the newer version of AGS I am very confident this could be done. The character sheet could be handled two ways, in terms of display. The first would be paper doll style, with a variety of object positioned correctly over the basic "nude" or "blank" character, chosen from a variety at character creation. This character sheet would be a separate "room", one of the 300 that can store values. Global variables would determine what "page" of the room is displayed with objects turned on and off and "dialogues" used as the character sheet entries.

The other way would be to internalise away from the player most of the data about their character, and have a status bar at the bottom of the screen, a GUI that showed a health bar, XP bar, magic power bar, potion, weapon in use and so on. This works quite well whether you're using first person or just having a character move around the screen.

What I found frustrating to script was battles. Still now with what I am currently doing AGS is very clunky, and has some weird quirks in terms of detecting edges and collisions which in turn make things as simple as firing arrows in fast paced way quite difficult, likewise changing views and loops when characters approach each other or violently interact - for example swapping loops using .Animate during battles.

Other than that, it's a question of scale. Does your RPG generate a general and "endless" replayable world with locations or is it smaller scale, a detailed specific adventure where characters can buy potions, steeds, weapons and armour etc. ?
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: VampireWombat on Thu 23/08/2018 12:08:29
The thing with rpgs is that the term is kind of vague. There's the Ultima games, the Ultima Underworld games and other dungeon crawlers, there's Japanese RPGs like what RPG Maker is meant to make, there's the isometric type like Planescape Torment/Fallout/Arcanum, there's the Elder Scrolls type, and there's ones like Knights of Pen and Paper 1 & 2.
AGS could work fine for battle systems for some of them, but is ill suited for something like Elder Scrolls (which should be 3d anyway). Turn based battle is the type that AGS is most suited for. I tried it a couple months ago, but ran out of time and didn't know quite enough. I'm fairly certain I could do it now if I had time, though...
Of course you didn't mention what kind of battle you tried to script. But I assume it's real time since you mention fast paced, etc.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Retro Wolf on Mon 27/08/2018 16:08:53
The hardest part is creating a battle system which is balanced and fun to play. Things get complex when you try to create a formula with a bunch of stats such as strength, speed, luck, stamina etc etc.

I think if I were going to take a crack at it I'd try to keep it as simple as possible, limit it to three character class types and have a rock/paper/scissor kind of thing with bonus damage for every xp level greater than the enemy.
Title: Re: AGS: Can I Make an RPG with AGS?
Post by: Mandle on Mon 27/08/2018 16:24:59
Quote from: Retro Wolf on Mon 27/08/2018 16:08:53
The hardest part is creating a battle system which is balanced and fun to play. Things get complex when you try to create a formula with a bunch of stats such as strength, speed, luck, stamina etc etc.

I think if I were going to take a crack at it I'd try to keep it as simple as possible, limit it to three character class types and have a rock/paper/scissor kind of thing with bonus damage for every xp level greater than the enemy.

Tell me about it. I tried this with my game "Rat Playing Game" and everyone pretty much gave up because it was too hard.

I've replayed the game myself many times and always end up beating it, even though it can take many deaths and reloads to do so.

Balance is hard to find but also an RPG game that you can play through without dying many times and slowly figuring out the best straegy to beat it with is disappointing.