Let's Create a RPG in GAME MAKER!
Author: RukiriExclusive: RPG Dev, RPG Revolution
Engine: Game Maker 8 PRO
Okay, first off what you need to know is Game Maker Language or abbreviated as GML. If you don't than please kindly leave this tutorial(s) as I will not create a run down of all the commands and uses of GML.
Index
Part 2: Creating a RPG Management party
part 3: Creating Dialog and creating NPCs ( None playable characters )
Part 4: Designing the Battle system from the ground up. A-BS, Side View(Final Fantasy), Tales of..
Part 5: The Menu System
Part 6: Saving your Game and Check Points. Stay true to RPGs!
Part 7: Planning and designing your plot.
Part 8: Designing your world!
Part 9: Developing your characters
Part 10: Overview
Parts 7-10 do not need to be read if you're creating a fan based RPG.
Part 2: Creating a RPG Part
What's the hardest part of a RPG? The management system, followed by the equipment and inventory systems.
What do we need to know before we create a RPG Party?
- Variables
- Arrays
- Use of objects
But before I actually go into anything I'm ending the topic here with a scandalice amount of code, if you can figure it out you know what you're doing. If not, read up on GML.
scr_party_int
CODE
globalvar actor, level, party_member_removed, main_actor;
//Call actor names, and stats
scr_party();
//Call actor names, and stats
scr_party();
scr_party " This script is 100% completed but only 1 character is fully coded atm"
CODE
//Set Party Stats
global.maxparty = 0; // Max party variable.
//Son Goku
actor[0,0] = "Son Goku"; // Name
actor[0,1] = 1 // Level
actor[0,2] = 70; // HP
actor[0,3] = 70 // HP Max
actor[0,4] = 0 // SP
actor[0,5] = 20 // SP Max
actor[0,6] = 5; // Strength
actor[0,7] = 9; // Power
actor[0,8] = 5; // Defence
actor[0,9] = 4; // Speed
actor[0,10] = 0; // XP
actor[0,11] = 0; // Slot number
//Vegeta
actor[1,0] = "Vegeta"; // Bejita..
actor[1,11] = 0; // Slot number
//Handle Levels
/*
2D Arrays
0 = Goku
1 = Vegeta
2 = Kuririn
3 = Goten
4 = Trunks
5 = Piccolo
6 = Tienshinhan
*/
//Variables
global.glevel = 0;
{
level[0,1] = 500;
level[0,2] = 1200;
level[0,3] = 2000;
level[0,4] = 2800;
level[0,5] = 3500;
}
// Place all attack icon scripts below here.
scr_goku_icons();
global.maxparty = 0; // Max party variable.
//Son Goku
actor[0,0] = "Son Goku"; // Name
actor[0,1] = 1 // Level
actor[0,2] = 70; // HP
actor[0,3] = 70 // HP Max
actor[0,4] = 0 // SP
actor[0,5] = 20 // SP Max
actor[0,6] = 5; // Strength
actor[0,7] = 9; // Power
actor[0,8] = 5; // Defence
actor[0,9] = 4; // Speed
actor[0,10] = 0; // XP
actor[0,11] = 0; // Slot number
//Vegeta
actor[1,0] = "Vegeta"; // Bejita..
actor[1,11] = 0; // Slot number
//Handle Levels
/*
2D Arrays
0 = Goku
1 = Vegeta
2 = Kuririn
3 = Goten
4 = Trunks
5 = Piccolo
6 = Tienshinhan
*/
//Variables
global.glevel = 0;
{
level[0,1] = 500;
level[0,2] = 1200;
level[0,3] = 2000;
level[0,4] = 2800;
level[0,5] = 3500;
}
// Place all attack icon scripts below here.
scr_goku_icons();
scr_main_actor " using numbers to identify a character or person"especially pokemon" will make coding this script much much easier"
CODE
/*
actor cheat list
1 = Goku
2 = Vegeta
*/
if actor[0,11] = 1
{
main_actor = 1;
}
if actor[1,11] = 1
{
main_actor = 2;
}
actor cheat list
1 = Goku
2 = Vegeta
*/
if actor[0,11] = 1
{
main_actor = 1;
}
if actor[1,11] = 1
{
main_actor = 2;
}
scr_player
CODE
// This just gets the correct player.
globalvar main_player, ally, ally1, main_pos
if actor[0,11] = 1
{
main_player = 0;
}
else if actor[1,11] = 1
{
main_player = 1
}
// repeat for other characters
// set the x/y for the hero
main_pos = obj_hero;
globalvar main_player, ally, ally1, main_pos
if actor[0,11] = 1
{
main_player = 0;
}
else if actor[1,11] = 1
{
main_player = 1
}
// repeat for other characters
// set the x/y for the hero
main_pos = obj_hero;
scr_ally "Since pokemon has over 400 characters use identifiers such as numbers because there are soo many party slot abilities with a number that high"
CODE
// This just gets the correct player.
if actor[0,11] = 2
{
ally = 0;
}
else if actor[1,11] = 2
{
ally = 1;
}
// repeat for other characters
if actor[0,11] = 2
{
ally = 0;
}
else if actor[1,11] = 2
{
ally = 1;
}
// repeat for other characters
This is where the fun begins, adding and removing a player, I'll just give you my script names for reference.
scr_goku_add
CODE
/*
Usage:
scr_goku_add();
*/
//check to see if Goku is already in your party
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[0,11] >= 1
{
actor[0.11] = actor[0,11] // keep the same slot number
}
else
{
// check other slots.
if actor[1,11] = 0
{
actor[0,11] = 1
}
else if actor[1,11] = 1
{
actor[0,11] = 2
}
else if actor[1,11] = 2
{
actor[0,11] = 3
}
global.maxparty = global.maxparty + 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
gcur_icon = 0;
scr_main_actor();
if global.maxparty >= 3
{
global.maxparty = 3;
}
}
}
Usage:
scr_goku_add();
*/
//check to see if Goku is already in your party
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[0,11] >= 1
{
actor[0.11] = actor[0,11] // keep the same slot number
}
else
{
// check other slots.
if actor[1,11] = 0
{
actor[0,11] = 1
}
else if actor[1,11] = 1
{
actor[0,11] = 2
}
else if actor[1,11] = 2
{
actor[0,11] = 3
}
global.maxparty = global.maxparty + 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
gcur_icon = 0;
scr_main_actor();
if global.maxparty >= 3
{
global.maxparty = 3;
}
}
}
scr_goku_remove
CODE
/*
Usage:
scr_goku_remove();
*/
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[0,11] >= 1
{
actor[0,11] -=1; // remove 1 party slot
}
party_member_removed = true;
global.maxparty = global.maxparty - 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
if global.maxparty < 0
{
global.maxparty = 0;
}
}
Usage:
scr_goku_remove();
*/
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[0,11] >= 1
{
actor[0,11] -=1; // remove 1 party slot
}
party_member_removed = true;
global.maxparty = global.maxparty - 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
if global.maxparty < 0
{
global.maxparty = 0;
}
}
scr_vegeta_add
CODE
/*
Usage:
scr_vegeta_add();
*/
//check to see if Goku is already in your party
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[1,11] >= 1
{
actor[1.11] = actor[1,11] // keep the same slot number
}
else
{
// check other slots.
if actor[0,11] = 0
{
actor[1,11] = 1
}
else if actor[0,11] = 1
{
actor[1,11] = 2
}
else if actor[0,11] = 2
{
actor[1,11] = 3
}
global.maxparty = global.maxparty + 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
scr_main_actor();
if global.maxparty >= 3
{
global.maxparty = 3;
}
}
}
Usage:
scr_vegeta_add();
*/
//check to see if Goku is already in your party
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[1,11] >= 1
{
actor[1.11] = actor[1,11] // keep the same slot number
}
else
{
// check other slots.
if actor[0,11] = 0
{
actor[1,11] = 1
}
else if actor[0,11] = 1
{
actor[1,11] = 2
}
else if actor[0,11] = 2
{
actor[1,11] = 3
}
global.maxparty = global.maxparty + 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
scr_main_actor();
if global.maxparty >= 3
{
global.maxparty = 3;
}
}
}
scr_vegeta_remove
CODE
/*
Usage:
scr_vegeta_remove();
*/
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[1,11] >= 1
{
actor[1,11] -=1; // remove 1 party slot
}
global.maxparty = global.maxparty - 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
party_member_removed = true;
if global.maxparty < 0
{
global.maxparty = 0;
}
}
Usage:
scr_vegeta_remove();
*/
if global.maxparty < 3 // make sure you can't add more than 3 party members at a time.
{
if actor[1,11] >= 1
{
actor[1,11] -=1; // remove 1 party slot
}
global.maxparty = global.maxparty - 1; // add to the maxparty variable, so you can't cheat. Muahahaha!
party_member_removed = true;
if global.maxparty < 0
{
global.maxparty = 0;
}
}
The script below retains each slot.
scr_retain_slots
CODE
/*
This script does nothing more than correct a players slot
So if Goku was slot 1, and Vegeta was slot 2.
Than Vegeta's slot would be slot 1.
*/
// Correct Vegeta
if (!keyboard_check(vk_space))
{
if actor[0,11] <= 1
{
actor[1,11] -= 1;
party_member_removed = false;
}
if actor[0,11] >=1
{
actor[1,11] -= 1;
party_member_removed = false;
}
// make slots "0" if they were slot 1.
if actor[0,11] < 0
{
actor[0,11] = 0;
}
if actor[1,11] < 0
{
actor[1,11] = 0;
}
}
This script does nothing more than correct a players slot
So if Goku was slot 1, and Vegeta was slot 2.
Than Vegeta's slot would be slot 1.
*/
// Correct Vegeta
if (!keyboard_check(vk_space))
{
if actor[0,11] <= 1
{
actor[1,11] -= 1;
party_member_removed = false;
}
if actor[0,11] >=1
{
actor[1,11] -= 1;
party_member_removed = false;
}
// make slots "0" if they were slot 1.
if actor[0,11] < 0
{
actor[0,11] = 0;
}
if actor[1,11] < 0
{
actor[1,11] = 0;
}
}