Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 RGSS scripting dissections and explinations
#64
Did we talk about Inheritance before? (checking....) Oh, wow! I did, at the beginning of Page 2! Lemme recap:

The Recap

Did you read that again? Yes? Goodie! Cause I'm going to start using SOME terms here. You do have to learn them too, right?

When I said.....
Quote:Go and look at the 'Window_Selectable' class in your editor, and you may see this:
class Window_Selectable < Window_Base

Looks odd, no? The '< Window_Base' thingie says 'WE CHEATED!!!' We just made a whole class called Window_Selectable, and we're re-using material from Window_Base without needing to retype it!!!

Now I will talk about some terms: The Parent Class and the Child class. They probably came up with those names when they also decided to call this thingie 'Inheritance' Tongue sticking out

When I said that the Window_Selectable class is reusing material from Window_Base, it is 'inheriting' the material.... Just as a baby inherits its eyes from its mother. The Windows_Selectable class is what we call a Child class, and the Window_Base class is its parent. But just the same, the hidden Windows class is a parent class to the Windows_Base class... with Window Base being the child class.

Yeah, so whenever you have one class based on another, that new class is a child of the older parent.

So what the heck is a SUPERCLASS?????

Wait? Where did that come from? Krypton?

Nope. It's sorta just another way to refer to a Parent class. If you look at some of the default scripts like Game_Battler, they refer to themselves as being Superior to the other... a superclass:

Code:
#==============================================================================
# ** Game_Battler (part 1)
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler

Of course, you'll see that the Child classes have that goofy < Game_Battler after the class's name is defined:
Code:
class Game_Actor < Game_Battler

So saying that the Game_Battler class is a Parent class to the Game_Actor class, you could also say that the Game_Battler class is a superclass to the Game_Actor class.

Got it so far?????? Happy
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-10-2018, 05:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Help iwth script (RGSS Player crash) Whisper 3 7,673 06-17-2017, 05:03 PM
Last Post: Whisper
  How can I use the cmd of "require" in rgss superegp 2 5,380 11-03-2015, 06:16 AM
Last Post: kyonides
   Scripting in VX vs VX Ace Miharu 5 8,205 02-21-2015, 10:10 AM
Last Post: Taylor
   Combat animations via scripting; How? ZeroSum 2 4,571 09-20-2013, 06:58 PM
Last Post: ZeroSum
Question  RGSS stoped to work Chaos17 5 6,929 02-14-2013, 05:13 PM
Last Post: DerVVulfman
   Ruby, RGSS & General Code Discussion Kain Nobel 6 9,912 12-22-2012, 05:11 AM
Last Post: MechanicalPen
   [Request] Tut. for RGSS Eldur 9 10,610 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,960 04-12-2010, 03:21 AM
Last Post: DerVVulfman
   Beginner Scripting Tuts? KDawg08 1 3,684 03-31-2010, 11:03 PM
Last Post: Hsia_Nu



Users browsing this thread: