Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 RGSS scripting dissections and explinations
#91
Ooooh. Gotta make a note here. Thankies, Kyo.

Within the "Scene_PetConvention" class, we get to see both @instance and local values, the siletrea value, the @puma value and the dervvulfman value. But they're not just values. kyonides made OBJECTS!!!!

An object is a value that acts as a usable copy of another class, assuming data is within.

Code:
siletrea = Person.new
    siletrea.name = "Siletrea"
    siletrea.age = 22 # Guessing here...

Remember what I said. Local values are even CHEAPER than @instance values.... they only work within the method whereas the @instance values can work throughout the class.

And here, the siletrea local value is really the siletrea local OBJECT... only usable within the method it's created. And again, it's an object... assuming the structure of the 'Person' class (the 2nd class in his example). The Person class has three values: Name, Age and an array of pets. So when he made a siletrea object, he had to fill in the values for the object. He could have put in more methods that could be run... but ... later.

Slowly study this.

OH, and remember how I said in the post ...
Quote:There's a bit more too it than just this. We need to do stuff that lets that whole '$game_siletrea' thingie to work. But once we do, this is how you can make @instance variables from one class work within other classes.

This creation of an object is how we make those $game_system and $game_temp objects. Laughing So in my previous example where I suggested reading data from $game_siletrea.... we do need to make an object first.

Winking Yes, that means you can make $global objects too!!!

But just glance through this, and again.... Talk about the classes, super class, parent, child. I know you want to take things slowly. Not to jump into things too fast. We'll get back to this eventually.
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 - 12-28-2018, 06:36 AM

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



Users browsing this thread: