• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Crazyninjaguy's Lesson 3 in RGSS

Status
Not open for further replies.
  • 664
    Posts
    16
    Years
    Ok, so now we've learnt all about variables, its onto lesson 3 :D
    Make sure you've read lesson 1 and 2 first!

    Super and Sub Classes


    Ok, so there are super classes and sub classes in RGSS, they can inherit or give sort of traits to another class. Much like a family having ginger hair. An example of this is this:

    Code:
    Window_Badger < Window_Base

    This means that Window_Badger inherits certain traits from Window_Base, the default window script.
    So we can use these traits to our advantage in scripts, simply by calling the superclass.
    Here's an example.

    Code:
    super(0, 0, 640, 480)

    Ok, so lets explain this for you,
    The super shows that we want to call the method with the same name in the superclass, which in this case is Window_Base, and the 4 numbers will be explained now.

    1st Number: The location right of the upperleft pixel of the game screen.
    2nd Number: The location down of the upperleft pixel of the game screen.
    3rd Number: How wide the window is.
    4th Number: How tall the window is.

    So this shows you how to call the superclass in a method.
    Remember, the superclass must ALWAYS be called in the initialize method. (If you don't know what the initialize method is then i suggest you read lesson 2 again)

    So now i'll explain the different Super and sub classes for Windows.
    It looks sort of like this:

    Code:
    Window -> Window_Base -> Window_Selectable -> Window_Command

    So this means that Window_Base has the properties of Window, Window_Selectable has the properties of Window_Base and Window, and Window_Command has the properties of all three.
    So why not just use Window_Command for everything? Simply because it lags up the game alot, so its better to use Window_Base for displaying text or pictures, and Window_Selectable for option choices and stuff. Window_Command is perfect for menus, and i'll show you how to use that in a later tutorial.

    Ok so that's basically it for sub and super classes, next tutorial will be on creating windows!
    Until then, reaply to this topic if you found it useful!
     
    Last edited:

    CeFurkan0

    Pokemon MMORPG PokemonCraft
  • 75
    Posts
    14
    Years
    • Age 39
    • Seen Feb 13, 2011
    thnx for this topic thnx a lot thnx
     
  • 2,048
    Posts
    16
    Years
    • Seen Sep 7, 2023
    Uh... You seem to misunderstand the 'super' method. It doesn't call the superclass (you can't call a class). It calls the method with the same name in the superclass.
    This script:
    Code:
    super(0, 0, 640, 480)
    calls the 'initialize' method of Window_Base. You don't need to call the 'super' method in the 'initialize' method either; it's just more convenient to do so.
     
  • 401
    Posts
    19
    Years
    • Age 29
    • Seen Dec 4, 2016
    Uh... You seem to misunderstand the 'super' method. It doesn't call the superclass (you can't call a class). It calls the method with the same name in the superclass.
    This script:
    Code:
    super(0, 0, 640, 480)
    calls the 'initialize' method of Window_Base. You don't need to call the 'super' method in the 'initialize' method either; it's just more convenient to do so.
    He meant right, he just miss worded it. And I never understood why they called it super and sub (well I do lol). I prefer calling it parent and child.
     
  • 401
    Posts
    19
    Years
    • Age 29
    • Seen Dec 4, 2016
    super(0, 0, 640, 480) ???
    In Window Base, the initialize method has arguments :
    Code:
    def initialize(x,y,width,height)
    the super method calls the initialize method of the super class (Window_Base) and tells it to use those figures for the arguments of the initialize method. This results in a window that takes up the whole space of a Pokemon Essentials game.
     

    Rassalon

    Epic One
  • 144
    Posts
    15
    Years
    That domain hasn't been used for a long time about 5 months ish bish. Anyway there was only ever three tuts any way all of which can be found in this section. Also you do realise that this thread hasn't been posted in for 8 months and, you arn't really supposed to post in a thread that is more than a month unless you are the thread creator.
     
    Status
    Not open for further replies.
    Back
    Top