A Guide To Variables

Go down

A Guide To Variables

Post by Kyle? on Sun Oct 31, 2010 11:45 pm



Introduction: Variables are something new people usually don't understand, but Variables are quite easy although, new people think are are hard. What I will cover in this sort Tutorial I will explain the usage and how they work.

Usage: A Variable stores a number it can be from a number to a number or a set number, or it can be the ID of an Item, Weapon or Armour in the Database. Don't confuse a Variable with a Switch but they can have the same function in some case, you can set a new event page of an event to activate when a number of a variable is set to the same number. A variable can also store strings (Text) when scripting the main script, that uses this is KGC's Day and Night system and my Name System.

How they Work: Variables are storage devices from numbers and Text in some cases. They work by setting a number through the use of Ruby (The Scripting used in RMVX) it will set it to the desired number or Text. The only way to set to Text is through the use of Ruby.

Closing: See Variable are quite easy but maybe Hard to understand how they work.
Thanks for Reading!
avatar
Kyle?
Platinum Cookiez
Platinum Cookiez

Posts : 500
Gald : 418

Stats
Cookies: 5

View user profile

Back to top Go down

Re: A Guide To Variables

Post by Vectomon on Mon Nov 01, 2010 4:29 am

Maybe you could elaborate it more by giving some examples or simple excercises. Other than that, good job! Very Happy

__________________________________

...if you know what I mean. Wink

Vectomon
Resource Moderator
Resource Moderator

Posts : 1029
Gald : 3025

Stats
Cookies: 0

View user profile

Back to top Go down

Re: A Guide To Variables

Post by The Creator on Mon Nov 01, 2010 10:07 am

Beautiful... I never did understand variables and how to work them! This is of great help to me, thanks!
avatar
The Creator
Legendary
Legendary

Posts : 786
Gald : 920

Stats
Cookies: 0

View user profile

Back to top Go down

Re: A Guide To Variables

Post by IMP1 on Mon Nov 01, 2010 12:21 pm

Kyle? wrote:A Variable stores a number it can be from a number to a number or a set number...
This is incredibly badly put and confusing. I'm assuming you mean this:

In RMVX eventing, a variable stores a number.

I mean, by "from a number to a number" you mean a range of numbers (ex: 1-6 or 26-352), but you can't set a variable to a range using events...

Kyle wrote:Don't confuse a Variable with a Switch but they can have the same function in some case, you can set a new event page of an event to activate when a number of a variable is set to the same number. A variable can also store strings (Text) when scripting the main script, that uses this is KGC's Day and Night system and my Name System.
Hrrrrm. A switch *is* a variable. Just a boolean variable (one that only contains true (on) or false (off)). I realise that act slightly differently in RMVX Events, but it's still a variable. And when you talk about the "main script"... what do you mean?

Kyle wrote:How they Work: Variables are storage devices from numbers and Text in some cases. They work by setting a number through the use of Ruby (The Scripting used in RMVX) it will set it to the desired number or Text. The only way to set to Text is through the use of Ruby.
Hrrrrrrrrrm. I think going in to Ruby and how they're set should either not be included (as it's too confusing) or should be explained better.

Good idea and intentions. More details needed methinks.

__________________________________
Code:
"haystack".scan(/needle/)
avatar
IMP1
Coding Moderator
Coding Moderator

Posts : 503
Gald : 1399

Stats
Cookies: 5

View user profile

Back to top Go down

Re: A Guide To Variables

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum