ArguementError occured

● ARCHIVED · READ-ONLY
Started by omega1227 8 posts View original ↗
  1. Has anyone ever seen this error? I have no idea why I'm getting it, but it causes the game to crash.

    Script 'Game_Event' line 209: ArguementError occured.

    comparison of String with 2 failed

    Any idea? Need more info? Thanks!
  2. Well, I guess you accidentally change the value of Game Variable into string, not a number.
  3. And how does one go about fixing that?
  4. Try to put this patch. And let see what is the popup you will get

    Code:
    class Game_Event  def conditions_met?(page)    c = page.condition    if c.switch1_valid      return false unless $game_switches[c.switch1_id]    end    if c.switch2_valid      return false unless $game_switches[c.switch2_id]    end    if c.variable_valid      if $game_variables[c.variable_id].is_a?(String)        msgbox "Game Variables ID #{c.variable_id} is a String"        return false      end      return false if $game_variables[c.variable_id] < c.variable_value    end    if c.self_switch_valid      key = [@map_id, @event.id, c.self_switch_ch]      return false if $game_self_switches[key] != true    end    if c.item_valid      item = $data_items[c.item_id]      return false unless $game_party.has_item?(item)    end    if c.actor_valid      actor = $game_actors[c.actor_id]      return false unless $game_party.members.include?(actor)    end    return true  endend
  5. Okay, I added the code and loaded the game. When I enter the area that was making the game crash, it now says:

    Game Variables ID 7 is a String.

    Then I click okay and it comes again 4 times. But then after clicking it away, the came continues on. Now I can go on, but when I go into the menu and then out again, that same message pops up again, I have to click okay 4 times and then I can keep playing.

    Do you know why this is occurring? I know a Game Variable shouldn't be a String, but I wondering how I might have changed it into one... Did a script do it perhaps? I have no idea how it would have happened.
  6. That is the part I don't know. Do you remember where you change the value of variable 7?

    Some script might also messed up with Game Variables as well.
  7. You definitely pointed me in the right direction. That patch showed me that it was variable 7, so I followed each variable I used and then remembered there was a puzzle where the player has to input a text answer (via a script). This script changes the variable into a string. Then later in the game (where I was getting the error), I reused the variable for something else. This was crashing the game. So I just changed the script call to alter a different variable. It seems to have cleared it up.

    Thanks for your help though. I really appreciate it.
  8. never re-use variables, unles you declare them to be your temporary variables - and when you do that, make sure to always use it for the same kind of data.


    And ALWAYS name your variables to indicate that they have been used, to prevent you from accidentally reusing them - as well as always checking all added scripts for the variables they use.


    bugs caused by a double use of variables can be anything and extremely strange, causing a lot of problems in bughunting - your case above was simple compared to some other cases.


    So don't re-use switches and variables unless you know exactly what you're doing...