Posts: 4,634
Threads: 554
Joined: Dec 2009
I edited my previous message while you where typing your last reply...
"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.
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!
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
Posts: 325
Threads: 9
Joined: Feb 2016
(09-08-2017, 06:28 PM)kyonides Wrote: I edited my previous message while you where typing your last reply...
I realize that... oops...
I'm at work RN so I'll be back later!
new logo for Yesteryear created by Lunarberry!
Posts: 325
Threads: 9
Joined: Feb 2016
wow there is alot of stuff in this manual!
new logo for Yesteryear created by Lunarberry!
Posts: 325
Threads: 9
Joined: Feb 2016
(09-09-2017, 06:20 AM)Siletrea Wrote: wow there is alot of stuff in this manual!
ok been poking around the RPGXP manual and theres a few things that aren't compleatly clear so if you guys don't mind I'm gonna post them here
Pseudo Variables
self
The current method's execution constituent.
nil
The only instance of the NilClass class. Signifies NIL.
apparently Pseudo variables can't be changed...so they're like CONSTANTS?
afraid this doesn't make much sense to me...can someone clarify this a tad more?
Numeric Literals
123 0d123
integer
-123
integer (signed)
123.45
floating point number
Floating point numbers beginning with a decimal point, like .1, are not allowed. They must be written with a leading zero (0.1).
1.2e-3
floating point number
0xffff
hexadecimal integer
0b1011
binary integer
0377 0o377
octal integer
Numeric literals can contain an underscore. The Ruby interpreter simply ignores these underscores and does not interpret them in a special way. This can be useful as a thousands separator for large values. However, placing an underscore before and after a literal or connecting literals with an underscore will result in an error.
1_000_000_000 # => 1000000000
0xffff_ffff # => 0xffffffff
String Literals
Example:
"this is a string expression\n"
'this is a string expression'
String expressions begin and end with double or single quote marks.
Double-quoted string expressions are subject to backslash notation and expression substitution. Single-quoted strings are not (except for \' and \\).
String literals with white space on either side are treated as a single string literal.
p "foo" "bar" # => "foobar"
Backslash Notation
\t
tab (0x09)
\n
newline (0x0a)
\r
carriage return (0x0d)
\f
form feed (0x0c)
\s
whitespace (0x20)
\nnn
character at octal value nnn (n = 0-7)
\xnn
character at hexadecimal value nn (n = 0-9, a-f)
Expression Substitution
In double-quoted strings and regular expressions, the form "#{expression}" can be extended to the (string of the) contents of that expression. If the expressions are variables beginning with either $ or @, the surrounding braces may be omitted and the variable can be expressed as a #variable. The character # is interpreted literally if it is not followed by the characters {, $, or @. To explicitly prevent expression substitution, place a backslash in front of the #.
$ruby = "RUBY"
p "my name is #{$ruby}" # => "my name is RUBY"
p 'my name is #{$ruby}' # => "my name is #{$ruby}"
yeah there's alot of good information here but it doesn't make to much sense...are these used very often in scripting?
new logo for Yesteryear created by Lunarberry!
Posts: 4,634
Threads: 554
Joined: Dec 2009
09-09-2017, 08:21 PM
(This post was last modified: 09-09-2017, 08:50 PM by kyonides.)
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.
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!
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
Posts: 325
Threads: 9
Joined: Feb 2016
09-09-2017, 09:30 PM
(This post was last modified: 09-09-2017, 09:31 PM by Siletrea.)
(09-09-2017, 08:21 PM)kyonides Wrote: 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.
re-read this about 3 times!
so THAT'S what nil means! thank you!
staying away from integers! that's way to complex!
no I never learned any of that stuff...
and only using hexadecimal stuff if its colors because that's all that makes sense
Quote: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?
actually my avatar pic for the site is "Pod-Pod" who is the main character of Yesteryear!
(she's an AI who lives in a Ipod-like device with a mobile unit body)
Quote: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)
OI! I'm VERY skilled! in certain specific subjects! like 3D modeling 3D animation and character design!...just haven't fully grasped scripting yet!
new logo for Yesteryear created by Lunarberry!
Posts: 4,634
Threads: 554
Joined: Dec 2009
09-09-2017, 10:14 PM
(This post was last modified: 09-09-2017, 10:40 PM by kyonides.)
Staying away from integers is impossible! Even your bills have them! Even defining where a new window or sprite should be located on screen needs them! Labels displayed on screen like how much gold your heroes carry along need them! The catch would be that most of the time you'd only need to handle Integers (1, -2, 1000000 and such) and kind of rarely some floats like 1.2349 or Math::PI if you need to calculate angles and x and y coordinates with some help of Math.sin(x) and Math.cos(y) or angles and distances with Math.atan(dx,dy) and some details I skipped here on purpose because I know they're too complex for you XD
Don't tell me you didn't get the idea after reading my previous post about three times... -_-'
Expression Substitutions...
If you know what a substitution means then it won't take long for you to understand why they do exist.
@substituted_player = Player.new
@substituted_player.name = "Stan"
print "#{@substituted_player.name}, the kind of old hockey player, steps out right now and gets a seat in no time." # => "Stan, the kind of old hockey player, steps out right now and gets a seat in no time."
@substitute_player = Player.new
@substitute_player.name = "Ralph"
print "#{@substitute_player.name}, the hockey newbie, steps in." # => "Ralph, the hockey newbie, steps in."
I hope these two hockey related examples tells you something about what they actually do and how they work. Just in case I'll let you read what would have happened if we didn't "substituted" the @instance variable with its method name like I showed you above. (We're gonna make a mistake on purpose.)
print @substituted_player.name ", the kind of old hockey player, steps out right now and gets a seat in no time."
ArgumentError: wrong number of arguments (given 1, expected 0)
from (irb):3:in `name'
from (irb):3
from /usr/bin/irb:1:in `<main>'
Argument = Parameter = value you pass to Ruby via any specific method, here it's print.
On RMXP you've watched a pop up window furiously appear on sight to tell you something like the error message posted above and your game project would be shutdown immediately afterwards.
"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.
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!
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
Posts: 325
Threads: 9
Joined: Feb 2016
09-09-2017, 10:54 PM
(This post was last modified: 09-09-2017, 10:56 PM by Siletrea.)
(09-09-2017, 10:14 PM)kyonides Wrote: Staying away from integers is impossible! Even your bills have them! Even defining where a new window or sprite should be located on screen needs them! Labels displayed on screen like how much gold your heroes carry along need them! The catch would be that most of the time you'd only need to handle Integers (1, -2, 1000000 and such) and kind of rarely some floats like 1.2349 or Math::PI if you need to calculate angles and x and y coordinates with some help of Math.sin(x) and Math.cos(y) or angles and distances with Math.atan(dx,dy) and some details I skipped here on purpose because I know they're too complex for you XD
Don't tell me you didn't get the idea after reading my previous post about three times... -_-'
Expression Substitutions...
If you know what a substitution means then it won't take long for you to understand why they do exist.
@substituted_player = Player.new
@substituted_player.name = "Stan"
print "#{@substituted_player.name}, the kind of old hockey player, steps out right now and gets a seat in no time." # => "Stan, the kind of old hockey player, steps out right now and gets a seat in no time."
@substitute_player = Player.new
@substitute_player.name = "Ralph"
print "#{@substitute_player.name}, the hockey newbie, steps in." # => "Ralph, the hockey newbie, steps in."
I hope these two hockey related examples tells you something about what they actually do and how they work. Just in case I'll let you read what would have happened if we didn't "substituted" the @instance variable with its method name like I showed you above. (We're gonna make a mistake on purpose.)
print @substituted_player.name ", the kind of old hockey player, steps out right now and gets a seat in no time."
ArgumentError: wrong number of arguments (given 1, expected 0)
from (irb):3:in `name'
from (irb):3
from /usr/bin/irb:1:in `<main>'
Argument = Parameter = value you pass to Ruby via any specific method, here it's print.
On RMXP you've watched a pop up window furiously appear on sight to tell you something like the error message posted above and your game project would be shutdown immediately afterwards.
great information! but sadly I don't understand any on it... long story short I went from grade 1-7 being a C- average D-F in math... to 5 years of absolutely nothing to 1 final extra year to get a grade 12 equivalency... where the most math I did was grade 10 trades math... that I only passed with a barely B grade thanks to the fact that no-one in the class could draw a cube for chapter 7 perspective drawing...I probly woulda gotten a C- otherwise
I'm SUUPER bad at anything pertaining to math/english/history/science/PE...but I'll still try to learn scripting! I probably won't be making many awesome things but I'll still make something in the end!
new logo for Yesteryear created by Lunarberry!
Posts: 4,634
Threads: 554
Joined: Dec 2009
09-09-2017, 11:20 PM
(This post was last modified: 09-09-2017, 11:22 PM by kyonides.)
So you know nothing about hockey? O.o You being a Canadian makes me think it sounds kind of impossible to believe it XD
Substitute = Replace = Exchange something with anything else, even nil or something "empty"!
String Interpolation its the actual name of "#{@your_variable_is_here}" IIRC, a method to include data previously non available at the time of coding the script.
Siletrea darling, can you tell me what's the current hero's name no matter what part of your game plot I pick to find out who's the actual hero performing in that stage of your game? Unless your game had a single playable character, let's say Pod Pod silly cat cyborg that missed her tail because a dog bit it few minutes ago, that would be impossible. That's a good moment to use a variable to be replaced with the hero's actual name whenever you need the hero to be mentioned on any dialog or sprite or message window except in the default message window script.
"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.
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!
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
Posts: 325
Threads: 9
Joined: Feb 2016
09-09-2017, 11:36 PM
(This post was last modified: 11-10-2018, 05:53 AM by Siletrea.)
(09-09-2017, 11:20 PM)kyonides Wrote: So you know nothing about hockey? O.o You being a Canadian makes me think it sounds kind of impossible to believe it XD
Substitute = Replace = Exchange something with anything else, even nil or something "empty"!
String Interpolation its the actual name of "#{@your_variable_is_here}" IIRC, a method to include data previously non available at the time of coding the script.
Siletrea darling, can you tell me what's the current hero's name no matter what part of your game plot I pick to find out who's the actual hero performing in that stage of your game? Unless your game had a single playable character, let's say Pod Pod silly cat cyborg that missed her tail because a dog bit it few minutes ago, that would be impossible. That's a good moment to use a variable to be replaced with the hero's actual name whenever you need the hero to be mentioned on any dialog or sprite or message window except in the default message window script. hockey? that's the golf/rugby thing on ice! right?
and you can use any of the terms substitute replace and exchange without consequence?
what IIRC?
GOOD QUESTION! that slightly flip flops!
new logo for Yesteryear created by Lunarberry!
|