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….

Advertisements

Create a free website or blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: