Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Um...Error

It says, "Script 'Window_Selectable' line 21: ArgumentError occurred. wrong # of arguments (1 for 4)"

...What does that mean? O.o

~Liv
 
Have you added a script to your game that changes or improves the Window_Selectable?

The error means that a method of Window_Selectable has been invoked but only with one argument (instead of 4). There are methods that need arguments. Arguments are those words between parenthesis in the method definition, i.e.

Code:
def method_name ([B]arguments[/B])
          .......
end

Can you post here the line where the error was thrown? It would help a lot, believe me...


regards from paranoyas
 
I put in a script to take away the brackets (where it says [normal], [confuse], etc.).

I removed the script afterward so I could testplay it, but I still wanna take away the brackets, but when I put it in, it sets the message. O.o

And it was put in a different category. (Window_Base...I think...)
 
Oh yeah. Sorry. ^^"

Code:
#--------------------------------------------------------------------------
  # * Make State Text String for Drawing
  #     actor       : actor
  #     width       : draw spot width
  #     need_normal : Whether or not [normal] is needed (true / false)
  #--------------------------------------------------------------------------
  def make_battler_state_text(battler, width, need_normal)
    # Make text string for state names
    text = ""
    for i in battler.states
      if $data_states[i].rating >= 1
        if text == ""
          text = $data_states[i].name
        else
          new_text = text + "/" + $data_states[i].name
          text_width = self.contents.text_size(new_text).width
          if text_width > width - brackets_width
            break
          end
          text = new_text
        end
      end
    end
    # If text string for state names is empty, make it [normal]
    if text == ""
      if need_normal
        text = ""
      end
    end
    # Return completed text string
    return text
  end
  
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top