Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: Blizzard on January 07, 2008, 09:31:07 pm

Title: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on January 07, 2008, 09:31:07 pm
Scripting in RGSS Ruby for Intermediate and Experts
½th Edition
Author: Boris Mikić alias Blizzard



This is the ½th Edition! There might be typing and other mistakes!

Contents:

1. Introduction2. Compatibility3. Data Processing and Storage4. Windows5. Lag-weg6. Wannabe-Cool Scripting7. Hints and Tricks8. Useful Links
9. Summary



1. Introduction

Are you reading this to learn how to script? Then this is NOT for you. If you want to understand this e-book fully, you need basic scripting knowledge. You can read this, of course, but you'll end up wasting your time by not understanding even half of it.
Instead, this e-book will teach you how to become a better scripter. There are far too many scripters who know just a few basics and in the best case they can make a CMS. I will teach you how to handle data, how to make windows look nice and handle them efficiently, how to avoid lag, how to hunt down bugs and how to not be an idiot when scripting. At the end of each chapter there is a little summary, also teaching you how to choose between RAM and CPU specific for that chapter.
Note that I will explain you several things, but these are only the basics. You can't become a better scripter just by reading this e-book, it will only give you a head start in becoming a better scripter. You simply can't become a better scripter without practical experience.


2. Compatibility

This chapter will show you how to make your scripts work with scripts of other scripters more conveniently. If you don't make your scripts compatible, most won't be used. If a user has three cool scripts from three other scripters that work together just fine and yours just won't fit in, he will kick yours most likely and keep using the other three. Another reason for compatibility is to save your time and effort. If your script doesn't work with another one, you will need time to merge it with the other ones for that user.
If your script can be configured and/or has options, make a working precondition and turn off all critical options that need to be first set up correctly by users. It's always a good idea to make your script work Plug 'n' Play as most people don't bother reading instructions.


3. Data Processing and Storage

In this chapter you will learn how to handle data and data processing. In other words, this chapter IS RAM or CPU. You will learn how you can decrease the number of coded lines.


4. Windows

No, it's not the operating system. This chapter will teach you how to handle windows, since they are actually consisting out of several sprites and sprites are the ones that can cause the most lag, especially if they are large.


5. Lag-weg

This chapter will teach you about the worst archenemy of every programmer and scripter: Lag. Lag-weg literally means Lag-away as weg means away in German.


6. Wannabe-Cool Scripting

You are a scripter/programmer, but before all, you are a human being like everybody else. There just are people in the world who seem to believe they would be better than other for either no real or some really idiotic reason. You won't come over as cool if you're being an idiot and rude to people. In this chapter we will work on your relations to the world around you, since it doesn't evolve around you: You evolve around it.


7. Hints and Tricks

This chapter will show you some interesting ideas how to make your scripts work faster, be more compatible, be shorter and on top of that have a cool and professional looking code. Most probably you will enjoy this chapter most as it teaches you actually something to script and doesn't teach you the theory behind all of it too much. This chapter also includes a lot of practical experience.


8. Useful Links

Since this e-book explains just a few basics, here are several links for those who are eager to learn more.

Ruby
http://en.wikipedia.org/wiki/Ruby_(programming_language) (http://en.wikipedia.org/wiki/Ruby_(programming_language))
Stack
http://en.wikipedia.org/wiki/Stack_(data_structure) (http://en.wikipedia.org/wiki/Stack_(data_structure))
Recursion
http://en.wikipedia.org/wiki/Recursion_(computer_science) (http://en.wikipedia.org/wiki/Recursion_(computer_science))
Interpreter
http://en.wikipedia.org/wiki/Interpreter_(computing) (http://en.wikipedia.org/wiki/Interpreter_(computing))
Compiler
http://en.wikipedia.org/wiki/Compiler (http://en.wikipedia.org/wiki/Compiler)
Machine Language
http://en.wikipedia.org/wiki/Machine_language (http://en.wikipedia.org/wiki/Machine_language)
CPU
http://en.wikipedia.org/wiki/Central_processing_unit (http://en.wikipedia.org/wiki/Central_processing_unit)
http://en.wikipedia.org/wiki/CPU_design (http://en.wikipedia.org/wiki/CPU_design)
Object-oriented programming
http://en.wikipedia.org/wiki/Object-oriented_programming (http://en.wikipedia.org/wiki/Object-oriented_programming)
RAM
http://en.wikipedia.org/wiki/Random_access_memory (http://en.wikipedia.org/wiki/Random_access_memory)
Array
http://en.wikipedia.org/wiki/Array (http://en.wikipedia.org/wiki/Array)
Hash
http://en.wikipedia.org/wiki/Hash_table (http://en.wikipedia.org/wiki/Hash_table)
HUD
http://en.wikipedia.org/wiki/HUD_(computer_gaming) (http://en.wikipedia.org/wiki/HUD_(computer_gaming))
Algorithm complexity
http://en.wikipedia.org/wiki/Complexity (http://en.wikipedia.org/wiki/Complexity)
http://en.wikipedia.org/wiki/Computational_complexity_theory (http://en.wikipedia.org/wiki/Computational_complexity_theory)
Logarithm
http://en.wikipedia.org/wiki/Logarithm (http://en.wikipedia.org/wiki/Logarithm)
Boolean Algebra
http://en.wikipedia.org/wiki/Boolean_algebra_(structure) (http://en.wikipedia.org/wiki/Boolean_algebra_(structure))
Call by Value/Call by Reference
http://en.wikipedia.org/wiki/Evaluation_strategy (http://en.wikipedia.org/wiki/Evaluation_strategy)


9. Summary

Don't compare yourself with other scripters. You might lose your motivation by thinking "I will never get as good as him..." On the other hand you could also DO compare yourself with other scripters. You might be the type of person who says "I want to do better. I can do better. I will do better." instead. It's up to you. None of the good and known scripters today was just born with his skills. He has earned them through work and experience. This e-book is a part of my knowledge as a gift to all of you. It's not only what I have learned from scripting in RGSS, it's also what I have learned from programming in general, from what I have been taught in college and from life itself. Every scripter is unique and his experience and skills are incomparable with the experience and skills of any other scripter. One day you will just realize "Hey, I became better than that other guy..."
The RPG Maker XP help file is always a big help when you get into a dilemma asking yourself "Can I do that?" or "Does that class support that?" or... That's why I have included an enhanced English help file with an extra chapter by an unknown author and the Scripts.rxdata with English commented code, improved iteration coding, recoded to avoid the built-in RGSS bug with conditioning and overworked code to shorten the and improve the code. Many of you might not have a legal copy of RPG Maker XP and therefore not the English files. But this does not mean that I encourage illegal copies! I only give support regardless of the fact that your copy is legal or not! If you like the RMXP editor and engine, buy it! Reading through the help file once completely will help you a lot. You will find many useful methods that can give you results, instead of using your own code for that. I also included a copy of the RGSS102E.dll
By reading this e-book I hope right now you got the itches to make something more than just a CMS. And even if it's a CMS, I hope its moving windows that move from behind a window to the side and then back over the other window will look cool, since they don't lag at all.


10. Download

Full e-book download link (https://downloads.chaos-project.com/Scripting in RGSS Ruby for Intermediate and Experts.zip)
e-book PDF ONLY download link (https://downloads.chaos-project.com/Scripting in RGSS Ruby for Intermediate and Experts PDF ONLY.zip)
e-book DOC ONLY download link (https://downloads.chaos-project.com/Scripting in RGSS Ruby for Intermediate and Experts DOC ONLY.zip)

If you have problems, you can also try the .txt file download:
http://www.megaupload.com/?d=18E7942R
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Fantasist on January 08, 2008, 12:38:25 am
When will this be complete? (the 1st edition)
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Nortos on January 08, 2008, 03:00:29 am
can't wait for it I still haven't finished reading this one
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Zeriab on January 08, 2008, 05:44:25 am
Quote from: fantasist on January 08, 2008, 12:38:25 am
When will this be complete? (the 1st edition)

I am afraid Blizz is waiting for my review >_>
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Fantasist on January 08, 2008, 09:11:11 am
Then please hurry :D
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Nortos on January 10, 2008, 09:43:47 pm
How would I be able to make this a .txt file as my new mp3 only uses these ones to read and whenever I try to put it on notepad and save it as .txt says it can't use certain things in it and I save anyway and there's only two letters on the document CC...
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on January 11, 2008, 07:30:28 am
Just paste it into a .txt file. The formatting will be lost, but you're gonna hear it, so who cares about the formatting. xD
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Nortos on January 12, 2008, 12:18:28 am
you don't hear it unless I'm gonna put it in text to speech but I would prefer to read it on MP3 screen :P I can't understand those microsoft voices...lol but if it's hard then I guess I'll just makedo unless it's just a quick 2-5minute thing
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Juan on January 13, 2008, 01:16:30 am
@Blizzard I can't open the Scripting in RGSS Ruby for Intermediate and Experts from the download. Something about can't load graphics message.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Calintz on January 13, 2008, 01:35:50 am
I can't wait until I'm a high enuff lvl scripter to use this!!  ;D
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on January 13, 2008, 08:39:15 am
Updated topic links. Try downloading the pdf instead, Juan.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Juan on January 18, 2008, 06:23:14 pm
@Blizzard 
I can't even open pdf file at all. Anything I need to download to view this?
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on January 18, 2008, 06:30:11 pm
You can either opne the doc or the pdf. You can open pdfs with Adobe Acrobat Reader or docs with Microsoft Office or Word Viewer.

Adobe Reader (http://www.adobe.com/products/acrobat/readstep2.html)

Word Viewer (http://www.microsoft.com/downloads/thankyou.aspx?familyId=95e24c87-8732-48d5-8689-ab826e7b8fdf&displayLang=en)
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Nortos on January 18, 2008, 08:17:26 pm
if u want me to upload the .txt document just ask
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Juan on January 18, 2008, 08:21:04 pm
@Nortos Yea that would help.

@Blizzard I'm a limited account. I would need my dad to approve the download.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on January 18, 2008, 08:59:26 pm
Ouch! I see... Alright, wait for Nortos' text version then. =/
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Nortos on January 18, 2008, 10:40:23 pm
here it's :) you can put in first post maybe Blizz, it's only the actual document so it won't have the other files Blizz put in it
It's megaupload sorry sendspace wasn't working for me atm
Rggs Blizz's Tut .txt file download (http://www.megaupload.com/?d=18E7942R)
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Juan on January 18, 2008, 11:07:21 pm
@Nortos Thanks.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Nortos on January 18, 2008, 11:09:54 pm
it's cool if need it hosted on different site just ask
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on January 19, 2008, 06:44:00 am
Added. :3
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Juan on July 05, 2008, 11:30:46 am
Quote from: Blizzard
10. Download

Full e-book download link (http://chaos-project.com/downloads/scripts/Scripting%20in%20RGSS%20Ruby%20for%20Intermediate%20and%20Experts.zip)
e-book PDF ONLY download link (http://chaos-project.com/downloads/scripts/Scripting%20in%20RGSS%20Ruby%20for%20Intermediate%20and%20Experts%20PDF%20ONLY.zip)
e-book DOC ONLY download link (http://chaos-project.com/downloads/scripts/Scripting%20in%20RGSS%20Ruby%20for%20Intermediate%20and%20Experts%20DOC%20ONLY.zip)


The links quoted don't work.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on July 05, 2008, 11:44:28 am
The first one really doesn't work, but I have no problems the other two. O_o *uploads the first one again*
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Juan on July 05, 2008, 01:40:58 pm
the first two download file but theres a file corrputed error when I try to open them.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on July 06, 2008, 09:50:50 am
It's something with a version of Adobe Acrobat Reader. It just won't open some files. I've seen that problem on various PCs, even though they had the same version of the reader as I did. But I was never able to figure out what the problem is. I guess you specifically have to satisfy yourself with the .doc version. =/
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Fantasist on July 07, 2008, 06:57:45 am
Or try Foxit Reader, an awesome replacement for adobe.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: computerwizoo7 on December 01, 2008, 06:32:34 pm
this book is great!
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Ryex on May 16, 2009, 12:03:33 am
*Gasp* Blizz I've kept a copy of this book every sense i started to learn to script and it has been a great help even though I only understood about half of it at any one time (alias was by far the most confusing thing in there)
today I read it again an discovered something, I can understand just about every concept you talk about now! I might not under stand the more detailed descriptions of the inner-workings of the CPU andthe exact difference between hash and array is still a bit confusing too, but everything else is clear!

so I must extend my gratitude for providing me with a tool as wonderful as this, and I can say with pride that I can consider myself a intermediate scripter thanks to your help! :P Thanks Blizz!
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: Blizzard on May 16, 2009, 04:17:23 am
Thanks. ^_^

EDIT: *coughs* I should probably go through this once and improve it.
Title: Re: Scripting in RGSS Ruby for Intermediate and Experts
Post by: BetaGod on May 09, 2013, 12:08:14 am
I know this is old, but i couldn't resist the urge to post and say THANKS DUDE! You are awesom  :D