Good. Let's let RPG Maker aside for a while.
What you really wanna know is how to make programs.
You have to understand the steps of the process we make.
First of all a program might be also called an application (an app) or you might even see it called a "solution".
Programs solve problems. Thus we call them "solutions" sometimes.
So in order to write a solution, you must first know what the problem is.
That is what @Hudell told you and he is right!
So let's see, how do we start.
1] What is the problem?
Gee I want to make a number guessing game!
I don't know which programming language I will use.
But I know I wanna make a game that the player will guess one number.
So... what do we do?
Let's make a description of the problem, before we try to make a solution!
a)
The number that must be guessed must be from 1 to 9001. (IT'S OVER 9 THOUSAAAAAND)
Yeah! that's the one thing we wanna know...
What else?
What will the game do?
It will show a message "Please Guess the number" Or something, and ask for a number guess!
Okay.
Then?
If the number the player puts is bigger?
c)
It will show a message "This number is bigger, sorry" or something.
And for a smaller?
d)
It will show a message "This number is smaller, sorry" or something.
And what if he/she finds it out?
e)
It will show a message "GOOD JOB YOU FOUND IT!" or something.
Did we forget about something???
ZOMG!
The number! How will the program decide what will the number should be?
Let's change a) accordingly
a)
The program will choose a secret random number between 1 and 9001.
Let's put all these together.
The program will choose a secret random number between 1 and 9001 , then
*
it will show a message "Please Guess the number" or something, and ask for a number guess, then if the number is bigger it will show a message "This number is bigger, sorry" or something, if the number is smaller it will show a message "This number is smaller, sorry" or something and finally if the guess is right it will show a message "GOOD JOB YOU FOUND IT!" or something!
So you got a description.
Can you write a program?
Well, not yet...
Let's pause the problem solution for a while.
Let me talk to you about foreign languages.
I speak well my native language, that is not English and I try to be fluent in English, because English is the universal speaking language.
Many people can understand English. And that's a good thing.
Same goes for... programming languages.
Let's say I am fluent in Java.
If I will give you a program written in Java and you know nothing about Java... you might say...
http://i2.kym-cdn.com/photos/images/original/000/216/899/23608610-d0b9-4658-9740-f98463148d30.jpg
so...
in order everyone would understand a solution, people invented a universal programming language called pseudocode.
You can Google it. I will not teach you this here.
But I am gonna use it.
It is a mixture of good ol human English language and simple code.
So let's make a lame yet useful pseudocode:
ALGORITHM Guess_game_code
! Exclamation mark means this is a comment, not a part of code
! A <- B in pseudocode means that A takes as its new value, what B value is.
! So A <- 10 means that A now is 10!!! Got it?
! In programming you might have seen it as A = 10
Variable Declaration:
Variable A integer
Variable B integer
Variable F boolean
! This F variable was not expected from start. While I was writing the pseudocode, I saw that just an IF statement would run only once.
! So the player would have 1/9001 chances to win.
! So I wanted to make the program run forever until the player would guess the correct number.
! This is done using a loop. So I must left out of the loop the random number (so it remains unchanged) and loop the player input right?
!
I will color the loop with brown color. Notice that this loop was discovered that it was needed, while I started writing in pseudocode the solution.
! It wasn't on the description. This is a common mistake.
! The description should include the loop at the
* position like
"Until the user finds out the correct answer the program will do the !following:
!" Then the description would be ok. Ever wonder why I had an empty line with just that asterisk?
!Let's go on with the pseudocode:
A <- Choose a Random number between 1 and 9001
WHILE (F = 0) DO
Show message "Please Guess the number"
Show message "What is your guess bro?"
B <- User Input
IF B > A THEN
Show message "This number is bigger, sorry"
ELSE IF B < A THEN
Show message"This number is smaller, sorry"
ELSE
Show message "GOOD JOB YOU FOUND IT!"
F <- 1
END IF
LOOP
END Guess_game_code
So that was a pseudocode.
Now EVERYONE can understand how to make this right?
All turing-complete programming languages (most of them are) can do these things.
Anyone fluent in Visual Basic or Python or C++ or C or C# or Ruby, or Java, or Fortran, or whatever, can do that in that language.
Remember the asterisk that pointed a missing part on the problem description?
Describing a problem is the hardest thing to do right in programming.
If you make an algorithm written in pseudo code, then you can convert it in any programming language, having an idea what to do.
In our scenario
We needed three variables.
Two for integers and one for a boolean value.
Then we need a WHILE loop. How will we implement it in RUBY? Well, Ruby has a While equivalent under a certain syntax right?
Same goes for assigning values.
Ruby can also handle IF statements, using certain syntax rules right?
Also ruby can get input from the user and then show messages, right?
WE CAN DO THIS IN RUBY.
Since you know the programming concepts (tools)
IF
CASE
WHILE
LOOP
FOR
DECLARE VARIABLES
VALUE ASSIGNMENT
FUNCTION DECLARATION
FUNCTION CALL
you can actually do a lot of things combining them, in ANY programming language.
Now this example was a simple one, that will use the debug console of Ruby (VX ACE) to get and give info.
It is procedural programming concepts (also apply in object oriented programming).
These concepts are the fundamentals.
====================================================================================
If you wanna learn an object oriented language, like Java or Ruby, you have to learn a few more stuff.
CLASS
INSTANCE
MEMBER
METHOD
CONSTRUCTOR
DESTRUCTOR
ATTRIBUTE
ENCAPSULATION
INHERITANCE
POLYMORPHISM
OVERRIDE
EVENT
LISTENERS
====================================================================================
After understanding some stuff, you have to understand what RGSS is.
It is a game engine.
That means it is a script driven collection of code methods (functions) that can do stuff.
What stuff?
Well stuff like show a map made of tiles, move a hero in it, show events in it, according to the events in a map, use stuff from database to a map, create a battle screne (and use a battle engine) and show menus and change ,music and stuff....
So RGSS 3
Show graphics
Draws menus and other windows
contains a Battle system
it is actually a huge collection of small scripts.
Check out something I suggested that involves RGSS3 scripts
A copy paste from another reply I gave on another thread,
Script editor.
Under Windows group,
Script: Window_MenuCommand
Put a # in front of Line 40
# add_
save_command
This will remove the save command from the menu, because commenting out the command will not execute it.
See line 40 and the rest of them.
These construct the main menu.
See? There are places that you can understand.
Go slowly and not so deep into it.
And remember... Show message can be implememnted in just a debug console... but if you have an engine for game graphics, it can be implemented in a window. You actually do that while eventing in VX Ace...
