RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Help with my script (fixed)

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 88
Something something events
Project of the Month winner for December 2008
Well I've been trying to learn ruby so I've been taking it step by step. So I decided to test my self in making a window but it says something is wrong but I can figure out what. So I was woundering what I did wrong in this script.


Code: [Select]
class My_First_Test
 
   def initialize
     super(0, 0, 200, 200)
     self.contents=Bitmap.new(width-32, heigth-32)
     self.contents.font.name = "Aerial"
     self.contents.font.size = 24
     refresh
   end
   
   def refresh
     self.contents.clear
     self.contents.text.color = text.color(7)
     self.contents.draw_text(20, 0, 200, 200, "Woot!")
   end
   
end

So yeah, it said something was wrong with line 4 but I can't figure out what ;__;
« Last Edit: February 13, 2007, 03:54:24 PM by HowlingWinds »

***
Rep:
Level 88
I am not a scripter so I'm not sure, but do you have to use semicolons in scripting on RPGMaker?  If you do, then thats the problem :x

***
Rep:
Level 88
Ok so I actually looked and I guess you don't use semicolon so I guess I didn't help much did I? X_x'  Sorry.

*
Rep:
Level 88
Something something events
Project of the Month winner for December 2008
It said something about the numbers in line 4 or something. I'm not sure what I did wrong :x cuz how is the number incorrect when I'm placing the window! @_@

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I'm not really a scripter either, but you might want to put < Window_Base after your class name. That'll probably fix it.
Also, you spelt Arial wrong, so unless "Aerial" is actually a font, I don't think anything will show up.

***
Rep:
Level 88
Also, the font is misspelled.  Should be Arial.  Maybe that makes a difference if you don't have a font called Aerial installed.

*
Rep:
Level 88
Something something events
Project of the Month winner for December 2008
Okay I fixed it, looks like I was making things too complicated all I had to do was:

Code: [Select]
class My_First_Test < Window_Base

  def initialize
    super(0, 0, 200, 200)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial" 
    self.contents.font.size = 24
    self.contents.draw_text(0, 0, 200, 32, "If I am, then I'm coded.")
  end
 
end

Thanks for reminding me of my spelling and the window base  :P