RGSS scripting dissections and explinations
#35
I warn you that you might need to reread this post more than once in case you don't take long to comeback online...

Pseudo variables

Pffft, nothing to worry about, really.

self - A way to be lazy while scripting by preventing oneself from typing the current class's or module's name over and over and over again.

module M
def self.print_hello() print "Hello!" end
end

M.print_hello #=> Hello!

true, false, nil - Boolean pseudo variables (in Ruby but not in C or other languages), they're are actual classes, namely TrueClass, FalseClass, NilClass. Mandatory Warning! Leave them alone! Never alter them not even as a joke! They make comparisons possible, touch them, pervert those innocent pseudo variables and you'll get cursed!!

Nil or nihil - Latin term that stands for "nothing", 'non existing'. Terms like annihilation derive from it.

Numeric Literals... NUMBERS! Don't get your head busy learning this complex terms, just keep in mind that sometimes they are called Numeric in general. It's just one of those terms you'd only use rarely.

I think it's weird you never heard of Integers at all, but I guess it's still possible. The most common kind of numbers, those you learn in Kindergarten aka as kindergarden in English. You'd probably song a stupid song about them at an early age...

1, 100, 1294312340 - Integers
-25, -3567 - signed Integers or just negative values, part of the so called Real numbers (it was supposed to say that reality also included numbers below 0 or zero or null because of stuff like payments, overpayments, due payments, debts, loans, etc.)

1.5, 2135.9, -15739.87938793, 1.2e-3 - Floats
Aka Floating Point numbers in Ruby and other languages or doubles in C and C++ (standing for double precision numbers IIRC), call them numbers with decimals. Making a PC handle them through any PC or mobile application is a bit less convenient than Integers, they need more memory in general, perhaps they're a bit slower as well, but they are more PRECISE for sure and sometimes that's EXTREMELY CONVENIENT. Any mathematician or Physics or Chemistry teacher or Engineer of any kind will tell you so. A bridge may collapse in a timely fashion if an engineer's calculations aren't precise enough!!

1.2e-3 is exactly the same as 0.0012, it's just a more convenient notation for some professionals.
e-3 tells the system it's actual value isn't 1.2 but 0.0012 (1.2 pushed to the right hand side by three "spaces").

0xffff - hexadecimal integer

Well, Siletrea, if you like websites you gotta learn how to use hexadecimal integers. CSS (Cascade Style Scripting) is the web browser component that lets you modify how any website looks like, like calling it your personal web stylist. It uses hexadecimal integers (numbers with no decimals) to determine a color like red or green or blue or brown or silver or fuchsia or purple. Some can be called by their actual name, but sadly not all of them are available so it's a common practice to use hexadecimal values instead. Even software like Photoshop or GIMP use it as one of three alternatives I know about so far.

0b1011 - binary integer

Siletrea, I'm obliged to ask you this even if it's embarrasing, but since your avatar's a cyborg cat I don't know what to think... Are you a machine or a PC or an android with its own CPU aka processor?

If true, you gotta have been using it since day one. If not, don't EVER worry about it, it's just a series of on and off bit in a colossal array of bit. Only machines actually care about it.

0377 0o377 - octal integer

Half as convenient as the hexadecimal system for defining integers. AFAIK people in general rarely use it.

Numeric literals - Do you think reading a number with lots of digits is fine? 100000000 is the same as 100_000_000 or one hundred million of anything, dollars or euro or yen or hamburgers, etc. It just tells YOU not Ruby what it actually means, Ruby stumbles on it and removes them at once and keeps executing code, that's all.

String Literals - Additional stuff you can add to a string (some are automatically included by Ruby under some circumstances) to modify its literal meaning or visualization.

'Siletrea\'s pet cat' #' Single quotes or the floating symbol there normally think another ' single quote ends or starts with a new string or array of characters that conform a text (a word, a sentence, a paragraph, a chapter or a whole book). In order to make it behave as the so called apostrophe, it forces you to add a \ backslash to interpreter it as special and not as a system requirement that tells Ruby to open a new string or finish the current one.

In my KUnits GOSU project I DO USE backslash notation every so often, some of my RMXP projects do as well. If you are not considered to be an actual "gataza" (a Spanish term for a very skilled girl in this case, literally means a great female cat), you'd probably never gonna need it at all. People like me or DerVVulfman use it every other day to parse TXT files or strings. That's too complex for you now so skip it for the time being till you get more comfortable with scripting.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
RE: RGSS scripting dissections and explinations - by kyonides - 09-09-2017, 08:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Help iwth script (RGSS Player crash) Whisper 3 8,529 06-17-2017, 05:03 PM
Last Post: Whisper
  How can I use the cmd of "require" in rgss superegp 2 5,915 11-03-2015, 06:16 AM
Last Post: kyonides
   Scripting in VX vs VX Ace Miharu 5 9,090 02-21-2015, 10:10 AM
Last Post: Taylor
   Combat animations via scripting; How? ZeroSum 2 5,112 09-20-2013, 06:58 PM
Last Post: ZeroSum
Question  RGSS stoped to work Chaos17 5 7,747 02-14-2013, 05:13 PM
Last Post: DerVVulfman
   Ruby, RGSS & General Code Discussion Kain Nobel 6 10,884 12-22-2012, 05:11 AM
Last Post: MechanicalPen
   [Request] Tut. for RGSS Eldur 9 11,907 12-07-2012, 04:27 AM
Last Post: DerVVulfman
   [ASK-RGSS] Behemoth's CBS alike Getsuga_kawaii 0 4,227 04-29-2010, 03:07 PM
Last Post: Getsuga_kawaii
   Scripting I think spazfire 7 10,170 04-12-2010, 03:21 AM
Last Post: DerVVulfman
   Beginner Scripting Tuts? KDawg08 1 4,137 03-31-2010, 11:03 PM
Last Post: Hsia_Nu



Users browsing this thread: 15 Guest(s)