Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Never scripted before., Windows
Whatsthisdo
post Feb 27 2013, 12:56 AM
Post #1



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




Hi, how's it going?

I've been trying to teach myself RGSS3 by using the Ace help function as well as searching google for helpful tutorials.I found a small snippet I've been playing with;

CODE
class Window_Test < Window_Base
  
  def initialize
    super (0, 320, 640, 160)
    self.contents = bitmap.new(width - 32, height - 32)
    refresh
  end
  
  def refresh
    self.contents.clear
  end
  end


As I understand it, [super] is meant to get the method from it's parent I.E; Window_Base.

I keep getting this error;
"Script 'Window_Test' line 4: SyntaxError occurred.

unexpected',', expecting ')'
super (0, 320, 640, 160)"

I'm having difficulty understanding that line, isn't it along the lines of (x, y, width, height)?
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Feb 27 2013, 01:01 AM
Post #2


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 916
Type: Scripter
RM Skill: Skilled
Rev Points: 120




QUOTE (Whatsthisdo @ Feb 27 2013, 09:56 AM) *
CODE
class Window_Test < Window_Base
  
  def initialize
    super (0, 320, 640, 160)
    self.contents = bitmap.new(width - 32, height - 32)
    refresh
  end
  
  def refresh
    self.contents.clear
  end
  end


From what I can see, there's a spelling mistake, since you should write Bitmap with the capital B, but for the rest I can't see any errors...
I'll give it a look...
Have you pasted it in a blank? In that case, that should not give such error... Syntax is perfect, as well as your idea about the super.

EDIT: Okay, I've tested it. Just remove the blank between super and the "(", and correct that Bitmap issue and it will work wink.gif

CODE
class Window_Test < Window_Base
  
  def initialize
    super(0, 320, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  
  def refresh
    self.contents.clear
  end
end


It's like that "bitmap" created the whole problem...

Jens


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   
Whatsthisdo
post Feb 27 2013, 01:28 AM
Post #3



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




Ah yes, that fixed it, thanks a lot. Now I can move onto playing around with it so I can get the hang of it. Cheers!
Go to the top of the page
 
+Quote Post
   
lilcooldude69
post Apr 23 2013, 11:27 PM
Post #4


The pro-est eventer u know ;D
Group Icon

Group: Revolutionary
Posts: 297
Type: Event Designer
RM Skill: Masterful




another good place to learn ruby would be www.codeacademy.com, while this doesnt teach rgss3, it does teach you all you need to know about ruby programming, and it does help significantly when reading scripts to help yourself figure out how they work smile.gif


__________________________

My Userbars


Rated pg-13 part of signiture
Scientist A: "A single sperm has 37.5MB of DNA information in it. That means a normal ejaculation represents a data transfer of 1,587.5TB."
Scientist B: Too bad ejaculate has terrible packet loss
Scientist C:but the transfer does have a lot of redundancy

Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 10:11 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker