Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 RGSS scripting dissections and explinations
#76
(11-14-2018, 04:05 AM)DerVVulfman Wrote: 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.

ok so the @ symbol helps to organize things! even if they have the same name! as long as its in a different line of code it can help differentiate things?

hmm the "super" statements... its like small bakesale!
the original list of items for sale would be muffins and cupcakes and brownies! BUT somewhere down the line a new seller in the bakesale comes in with cookies and tarts! instead of going to the computer and building up a whole new list from scratch and then having to print everything out and replace the old sign they just take a pen and add the new items on at the bottom of the list!
right? Happy with a sweat
[Image: SP1-Writer.png]
[Image: 55e3faa432d9efb86b8f19a6f25c0126-dawz35x.png]

new logo for Yesteryear created by Lunarberry!
Reply }


Messages In This Thread
RE: RGSS scripting dissections and explinations - by Siletrea - 11-14-2018, 09:15 PM

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



Users browsing this thread: