Indenting and commenting

Indenting

Common errors can come from the lack of indenting in your script files.

E.G.

void MessyFunction()
{
int X;
int Q;
while (X = 0)
{
X = X + 1;
while(Q = 0)
{	
Q = Q + 1;
}
}
}


void CleanFunction()
{
	int X;
	int Q;
	while (X = 0)
	{
		X = X + 1;
		while(Q = 0)
		{	
			Q = Q + 1;
		}
	}
}

Notice on the indented version of the function, the curly brackets are much easier to use.

Each open curly bracket has it's close curly bracket directly below it.

void FunctionThatWontCompile()
{
int JIM;
int BOB;
if (JIM = 0)
{
BOB - 1;
while(BOB = 0)
{	
BOB = BOB + 1;
}

The above function wont compile because the compiler says "Went past end of file? pass one"
indent the function and you will spot what's wrong with it, trust me.
Go and try fixing that function!

Commenting

Commenting on your script files will help you remember what you were trying to do.


void game()
{
	'the variables S and Y are variables for my main character.
}

The compiler ingores all the text behind the '

But don't write novels.....

 

 

 

 

 

 

 

 

 

 

 

 

Remember:- It's your RPG so just make it so you like it, and therefore other people like-you will also like it.