Submit Your Article Guild Wars 2 Forum RPG Maker VX.com
 
RPG Maker
 

 Username:
 Password:
   Not a member? Register!



Home > Tutorials > Ruby Game Scripting System 2 > The Guide to Scripting Volume 1

The Guide to Scripting Volume 1


The Guide of Scripting Volume 1
Introduction
Made by Polar Tier.
Table of Contents:

Chapter 1: Reading
Chapter 2: What is Attr?
Chapter 3: Design


Chapter 1
Looking a script may be illegible but once you figure it out everything starts coming together.
All you need to know for now is that each script will include at least 1 comment, that comment
can be in any language... most likely english, that comment will probably be the only thing you can read at this moment. They will look like this... # This is an example comment.... Since now you know what to search for when looking for references and instructions we will move on to math, when encounterering a mathimatical function you will see this color = + - += -= > < >= <= == . .., Each preform a major roll in scripts... we will move on to math in volume 2... When you encounter a number it will be this color, 100 1000 10000 100000 ect... this will also appear in most mathimatical functions. This is all for now... we will continue reading in volume 2.

Chapter 2
Many people wonder what attr functions are... the most commonly used attr function is attr_accessor :something, this function makes the game recognize the variable, making it classified as a global variable the attr allows the game to access it as read only, write only, or both. attr_accessor allows the variable to be both editable and readable. attr_writer allows the variable to be write only, attr_reader allows it to be read only. These variables are recognized as global after attr has taken place, when being refered to in the same class it is know as itself but in a different class refers to it, the variable is named self.variablename... self = the class name such as Scene_Map or Game_Actor... and variablename is what the variables name is, the attr formula is attr_(variable class) :(variablename). We will move on to using these in Volume 2...

Chapter 3
The design of a script can be simple, but can also be very complex... that is why Rpg Maker VX has included the search box in the script editor... to access it all you do is simply right click on the empty space and click find... it will ask you what to find, most of the time you will be sent to a comment... but then just click find again and you will go to the next finding. But enough with that... we will go on with design... the main roll in design is the function def... it allows the timeline to be warped, either to carrie on a function or to return a variable, Every script includes def, it gives a group a functions a parent... but the parent of def is class. Class carries on a scene, window, or even an operating system, to jump to a def is just to type the name of the def, but remember that a def is NOT global... it will not be there in any other script or class. You can only use a def inside the parent... that is all for this volume. Thank you for viewing.... This tutorial is only at www.rpgrevolution.com. 
Details
Tutorial: The Guide to Scripting Volume 1
Date Listed: Sun, 05 Sep 2010 16:31:00 -0400
Author: PolarTier
Total Hits: 2408


Embed
Short URL:

HTML:

BB Code:



RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

RPG RPG Revolution is an Privacy Policy and Legal