RGSS scripting dissections and explinations
#73
The @ symbol is confusing?  Well, it basically means that the variable belongs to THAT particular class.

If I made a class called Shelley and a class called Miriam, each might have a variable called @hair_color.  I could set the @hair_color variable in the Shelley class to 'sandy_blonde', and set the @hair_color variable in the Miriam class to 'auburn_brown '.  Each has its own variable, even though they have the same name.  If I tried using the $hair_color value in either class, one would overwrite the other.

STUDY TIME:  Look at any of the initialize methods in the default classes.  They tend to have @instance variables belonging just to them.... mostly.


Oh, wow.   Um...  Yeah.   Xerox is the manufacturer of a a popular office copy machine.  In fact, it was the essential STANDARD for copiers.  So back in the day, we just called copiers 'Xerox', just like how we call adhesive bandages 'Bandaids' Winking

Laughing Hey, I use phrases like 'oft' for often and other old phrases from before I was borne.  BUT I don't think I have ever used 'nary'. Laughing + Tongue sticking out

So when I said "that your child is a literal XEROX of the parent", I meant it was a near-perfect copy or duplicate.  And well, yeah.  The super() statement is a way of letting you add new content to an existing method.  It's just that the super() statement  "IS" the old content and you're writing the new content around it.  

Code:
def goofy_method
  blah_blah_blah_new_statement1  
  blah_blah_blah_new_statement2
  super()
  blah_blah_blah_new_statement3
  blah_blah_blah_new_statement4
end

We could just say, we're taking the original 'goofy_method' method and adding two more statements to the start, and two more statements when the original method would have been done.

TEST TIME:  So, show me an example of a method using the super() statement. Laughing  Just an interpretation of what you think it means.  This is a no pressure thingie.  Just a gauge for discussion to see how I'm doing as a teacher and stuff.  More like a test on ME.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Messages In This Thread
RE: RGSS scripting dissections and explinations - by DerVVulfman - 11-14-2018, 04:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Help iwth script (RGSS Player crash) Whisper 3 8,530 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,113 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,228 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: 20 Guest(s)