Ruby Tutorial: 10. Errors

February 15, 2010 at 8:38 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 10. Errors
Tags: ,

From common to most uncommon errors you can find in RGSS2 and Rpg Maker Vx:
SyntaxError: It happens when something in a script cannot process or is already being used… can also occur when there is a compatibility error…
NameError: It happens when a variable or string is being used that has not yet been defined.
NoMethodError: It happens when a definition is called that has not been defined in any script.
ArgumentError: It happens when there is an incorrect amount of necessary arguments.
RuntimeError: It happens when a script makes the game/cinema not respond.
NoMemoryError: It happens when the operating system can’t reach the required amount of memory. (Too Big of a Game/Cinema)
TypeError: It happens when a converting command or system command can’t be ran by the game/cinema
ZeroDivisionError: It happens when a variable is divided by 0. (INFINITE)

Ruby Tutorial: 09. Commenting

February 14, 2010 at 12:57 AM | Posted in Tutorial | Comments Off on Ruby Tutorial: 09. Commenting
Tags: ,

It is important when you make a script to organize and put instructions for users… in the manual of Rpg Maker Vx it says:

* When developing scripts to be distributed to the general public,
we recommend that you use redefinitions and aliases as much as
possible, to allow the script to run just by pasting it in this position.

The redefinitions and aliases they referred to is all made of comments… if you haven’t already noticed… comments are  made after you put # before text… that text will become part of your organization. It is highly recommended to use comments so that you will not lose your  place…

NOTE: Comments are not used in read by ruby syntax… so you can put anything in your comments… example.

# u9dmm39d00219

That line won’t be read by the engine but will be saved. Also… you can also input comments in another way… you can put in Rpg maker vx (maybe stand alone)  =begin to make a comment begin block… and =end to make a comment end block. Example:

=begin

* When developing scripts to be distributed to the general public,
we recommend that you use redefinitions and aliases as much as
possible, to allow the script to run just by pasting it in this position.

=end.

So this is the end of 09. Commenting.

Ruby Tutorial: 08. Rpg Maker Vx PRINT

February 13, 2010 at 7:54 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 08. Rpg Maker Vx PRINT
Tags: ,

Here you will learn what the heck PRINT is.

print “TEXT” — Puts “TEXT” into a separate window than the main window… can display errors and messages.

Ruby Tutorial: 07: Equations

February 13, 2010 at 5:09 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 07: Equations
Tags:

In this tutorial you will learn about equations….

= Make Value

== Is Value?

> Right Value Less

< Right Value Greater

=< Equal to or Greater than Right Value

=> Equal to or Less than Right Value

Ruby Tutorial: 06. Graphics Part 2

February 13, 2010 at 5:04 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 06. Graphics Part 2
Tags: , ,

This is a continued post from Graphics Part 1. In this tutorial you will learn about how to put special effects into your game… NOTE: these commands have not yet been tested on a stand alone ruby script… it has been tested on Rpg Maker Vx. These two commands that i will show to you are the most commonly used…. Graphics.fade_out(FRAMES) Graphics.fade_in(FRAMES)… these two commands are used to fade in the screen and fade out the screen… I know you can also do these commands in the second page of the event maker…. but these commands can be used in scripts… so you don’t have to worry about having to find out how to find common events… This is all until my next post about Graphics.

Ruby Tutorial: 05. Graphics Part 1

February 13, 2010 at 4:56 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 05. Graphics Part 1
Tags: , ,

Graphics in the game/cinema is important… that is why I am going to show you some commands. In this Tutorial you will learn about Frame Editing. You can edit the maximum frame rate by typing in the following code: Graphics.frame_rate = VALUE. Doing so can put side effects in the game/cinema. Here is a common side effect. Speeding the game up. Slowing the game. And crashing the game. Here is another command you will find mildly important: Graphics.frame_reset This will pre-load the next few frames and make the game/cinema go smoother. You will rarely use this.

Ruby Tutorial: 04. Conditional Branches

February 12, 2010 at 7:27 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 04. Conditional Branches
Tags: , ,

Conditional Branches are functions that require an expression to be true or false… or a variable to equal a certain value (Check Equations Tutorial for more information on having a variable for the condition.). This way you can program buttons and commands of your own. With conditional branches you can create the best games… without these conditional branches your game would just be a huge cinema. If you created a string ($vma) you could put:
if $vma == true
do something
end
You always have to put an end function at the end of a conditional branch… other wise you will come with a SyntaxError… and it will point to the last line of your script… I have done a bit of research over ruby while i was gone in the past few weeks…. I will update my materials soon. NOTE: If your string does not work… you may have to change it to a variable… ex. @vmp…

Ruby Tutorial: 03.module

January 24, 2010 at 6:01 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 03.module
Tags: , , ,

Command: Module

Syntax: Module $$$

Description: Used as a vocabulary or configurable script. Contains information that can be used ingame.

Example: module vocab

def self.ex

return 0

end # End def

end # End Module

Usage: vocab::ex or vocab.ex

Why and How: Modules are caches that don’t require functions… these caches are used commonly to give a more customized experience and allows the player that downloads the script to edit the scripts easily… it can be used to organize data or functions… for some reason there is a common error when using these caches… i don’t know if it is just a bug or something else… but you MUST put the first letter of a module a CAPITAL letter. Example… Myexample, myexample will give an error… you must have it Myexample not myexample….

Ruby Tutorial: 02.end

January 24, 2010 at 3:04 AM | Posted in Tutorial | Comments Off on Ruby Tutorial: 02.end
Tags: , , ,

Command: end

Syntax: end

Description: Ends a definition, module, or class

Usage: def start

command

end

class red

def something

command

end

end

When Used: This function is used after a conditional branch, definition, class, and module. Make sure that you use this function as much as necessary and never use this function when it is not necessary…

Ruby Tutorial: 01.def

January 24, 2010 at 2:39 AM | Posted in Tutorial | Comments Off on Ruby Tutorial: 01.def
Tags: , , ,

Code: def

Syntax: def $$$

Syntax2: def $$$.$$$

Description: Replace $$$ with a string ex def start or def self.start

Usage: Used as commands for Ruby Scripts to process the statement perfectly. USED IN CLASSES AND MODULES

Blog at WordPress.com.
Entries and comments feeds.