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.
Problem with a script.

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 69
RMRK Junior
Ok, so it's my second day attempting to learn the ruby languauge.. and I am doing Dubealex's excercises..
http://www.creationasylum.net/forum/index.php?showtopic=4854&st=0

Now, I'm creating Window_2:

class Window_2 < Window_Base
 
  #BLOCK 1
  def initialize
    super(0, 0, 200,380)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial" 
    self.contents.font.size = 24
   
    #BLOCK 2
        for i in 0...$game_party.actors.size
      x = 0
      y = i * 90
      actor = $game_party.actors
      self.contents.font.color = text_color(6)
      self.contents.draw_text(x, y, 200, 32, $game_party.actors.name)
      self.contents.font.color = text_color(4)
      self.contents.draw_text(x, y+32, 200, 32, actor.class_name)
    end
  end

end

______________________________________


I'm using a call script to access:

Window_2.new

________________________________

Now, it doesnt crash when I load the game, however it gives an error when I trigger the script:

Script 'w2' line 11: NoMethodError occurred.
undefined method 'actors' for#<Game_Party:0x45a2930>

_______________________________________

I'm guessing its choosing "actors" instead of "size" as the method, I don't know why.  It's identical to what's written on the page.
 Does anyone have any idea?


*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Your main problem, I suspect, is that you're writing an XP script in VX.
In VX, Game_Actors on its own is a class. Because I don't have it in front of me, I can't tell you the exact method you should use, but look through that to see if you can find it.
it's like a metaphor or something i don't know

***
Rep:
Level 69
RMRK Junior
Yes, yes!  I figured that was it, but I also thought it's probably the same language, but the classes could be different.. Do you know any good scripting tutorials for VX? Because the next lesson didn't work for me either.. Im gonna go searching through the script to see if I can find the class.