Making an RPG with AGS: Difference between revisions
Jump to navigation
Jump to search
→Turn Based Fights: Weapons, Magics, Enemies, and Enemy A.I.
(How to make RPG's with AGS) |
|||
Line 58: | Line 58: | ||
Another important thing for the RPG's: Weapons, magics, enemies and their artificial intelligence. | Another important thing for the RPG's: Weapons, magics, enemies and their artificial intelligence. | ||
[[Image:tuto-inv1.PNG]] | |||
I guess there are many ways to create weapons in AGS. But I will tell the weapon system used in Asporia. All the weapons and magics are actually inventory items, and you use them onto enemy characters (or hotspots represents them like in my RPG). | |||
[[Image:tuto-enemy1.PNG]] | |||
hen use these inventory items for the enemies. (The enemies in Asporia was actually hotspots, but you can use Characters as enemies.). | |||
The first scripts you should use for the fireball magic: | |||
''PlaySound(1); //plays the sound | |||
Display("You throwed a fireball to the undead."); | |||
SetGlobalInt (5, GetGlobalInt(5)-3); //enemy HP is decreased 3 points | |||
SetGlobalInt (2, GetGlobalInt(2)-1); //your MP (mana point) is decreased 1 point. | |||
SetGlobalInt (4, GetGlobalInt(4)+3);//gained 3 exp. for using magic.'' | |||
And the second step of the scripts (write them in the next "Run Script" hotspot command): | |||
''if (GetGlobalInt(5) <= 0) { | |||
GUIOff(4); | |||
PlaySound(9); | |||
NewRoom(30); //if the undead's HP is equal, or lesser than 0; then he dies and we go to another room in Asporia:Hidden Threat. You can use your own fight ending scripts. | |||
} | |||
else { | |||
GiveScore(-3); | |||
PlaySound(1); | |||
Wait(20); | |||
Display("Undead hit you"); //if you couldn't kill the enemy, it will attack you and you will lose 3 HP. | |||
}'' | |||
'''How to die in the game:''' | |||
If an enemy can attack you, then you should be able to die in the game. Type this scripts in the repeatedly_execute section: | |||
''if (game.score < 1) { | |||
StopMusic(); | |||
Wait(40); | |||
NewRoom(28); | |||
}'' | |||
The room 28 is the "Game Over" screen. You should also use the scripts in Players Enters Screen (before fadein) | |||
''PlaySound(4); // the sound which says the game is over | |||
GUIOff(0); | |||
GUIOff(4); | |||
'' | |||
And these codes in Players Enters Screen (after fadein): | |||
''Wait(240); | |||
RestartGame(); | |||
'' | |||
So the game will be restarted. | |||
'''Level Up:''' | |||
You can level up in the game after you have a definite exp. points. For example in the repeatedly_execute section: | |||
''if (GetGlobalInt(4)>=60) { | |||
Display("You leveled up and gained the magics of Cure +2, Fireball +2 and 6 mana points ."); | |||
AddInventory(10); | |||
AddInventory(11); | |||
LoseInventory(4); //losing the old Cure +1 magic | |||
SetGlobalInt(2,GetGlobalInt(2)+6); | |||
}'' | |||
The player will gain some new magics. Sure, you can use your own scripts for level up. | |||
''' | |||
Different Endings:''' | |||
You may also want to add different endings which is according on the player's decision in the game. For this, add this code to game_start: | |||
'' | |||
SetGlobalInt(12,0);'' | |||
This is the role-playing score in the game. If the player does something good, (for example, helping a villager) he gets a role-playing score: | |||
''SetGlobalInt(12,GetGlobalInt(12)+1);'' | |||
Then in the end of the game, | |||
''Wait(120); | |||
if (GetGlobalInt(12)>=3) { | |||
Wait(40); | |||
NewRoom(62); | |||
} | |||
if (GetGlobalInt(12)<3) { | |||
Wait(40); | |||
NewRoom(57); | |||
} | |||
'' | |||
The room 62 leads you to the good ending in the game. And the room 57 is to another ending which isn't good... | |||
'''And....cheats :)''' | |||
If you think your game may be found too hard by some players, then you can add some cheats. To on_key_press; | |||
'' | |||
if (keycode==13) SetGlobalInt(2,GetGlobalInt(2)+10); | |||
'' | |||
If the player presses Ctrl + M, his/her mana increases for 10 points. | |||
I hope this tutorial is useful for whom wants to make RPG's with AGS. You can ask me if there is something you couldn't understand here. | |||
akk13us@yahoo.com | |||
ahmetkeles_16@hotmail.com (MSN Messenger) |