Archived

This topic is now archived and is closed to further replies.

  • 0
guguman

Stack level too deep error-Help!

Question

 Okay, I've been slaving away at my first game for quite some time now, but recently I've encountered a error each time I hit playtest:

The message goes as follows:

 

        "SystemStackError occured.

stack level too deep"

 

 ....And I'm at a loss. I've no ideea what could be causing the stack overflow. It happens right in the starting map which hadn't been altered for some time now, and up till now worked perfectly.

It might help to say that the game starts for a little while, a chat message from a autorun event pops up as it should, but then it crashes with the error.

 

 Help would be much appreciated... Of any kind.

Share this post


Link to post
Share on other sites

9 answers to this question

This usually happens if a script command is running in a multiple type of way, atleast from my experience. Which often means that you have a duplicate of a script or that the same script command is running from 2 seperate scripts. The only time I have experienced this error though is when I accidentaly imported 2 copies of the same script. See if you have imported 2 copies of the same script, or try opening a new project and add the scripts into it 1 by 1 to see which script that's causing the error. From my experience it seems like the game is giving this error when the same script command is being run more than once, and that's why the 'stack level is too deep'.

 

Edit: It can also be a script compatible issue, or the order of your scripts. From time to time, scripts will interfere with eachother if they are not properly organized in the materials section. Some scripts need to be below another script to work, or even above it etc. I know scripts that cause me some trouble because of this, but when I figured out which script that caused it, I just set that script above everything and after that everything worked as it should.

 

I'm not that good at scripts though, but that's everything I know from my experience with this error.

Share this post


Link to post
Share on other sites

Replace your "main" script with this

#==============================================================================# ** Main#------------------------------------------------------------------------------#  This processing is executed after module and class definition is finished.#==============================================================================begin  rgss_main do    begin      SceneManager.run    rescue RGSSReset      Graphics.transition(10)      retry    end  endrescue SystemExit  exitrescue Exception => error  scripts_name = load_data('Data/Scripts.rvdata2')  scripts_name.collect! {|script|  script[1]  }  backtrace = []  error.backtrace.each_with_index {|line,i|    if line =~ /{(.*)}(.*)/      backtrace << (scripts_name[$1.to_i] + $2)    elsif line.start_with?(':1:')      break    else      backtrace << line    end  }  error_line = backtrace.first  backtrace[0] = ''  print error_line, ": ", error.message, " (#{error.class})", backtrace.join("\n\tfrom "), "\n"  raise  error.class, "Error ocurred, check the debug console for more information.", [error.backtrace.first]end

Open the console, and when you run your game it should tell you which script and what line it occurs at.

Share this post


Link to post
Share on other sites

Thx for the tips.

 

 But I'm probably dumb or rlly unlucky. I replaced the  "main" script ( on the bottom) with the one you gave me, and chose to show console from tools,

but the single line that appears is

"Window_Message:78: stack level too deep <SystemStackError>"

nothing more, nothing less...

 Did I do it right?

 

Note: The primary crash message does change to System stack error occured, check debugg console for more information.

Share this post


Link to post
Share on other sites

Yes so there is a recursive call being done in Window_Message at line 78.

I don't know what might be at line 78 for you. This is what I have

  #--------------------------------------------------------------------------  # * Update Fiber  #--------------------------------------------------------------------------  def update_fiber    if @fiber      @fiber.resume # <------- line 78    elsif $game_message.busy? && !$game_message.scroll_mode      @fiber = Fiber.new { fiber_main }      @fiber.resume    else      $game_message.visible = false    end  end

Share this post


Link to post
Share on other sites

Aha, Well I looked over it and apparently there's nothing different at line 78, or the whole (subprogram is it?)

 

 #--------------------------------------------------------------------------
  # * Update Fiber
  #--------------------------------------------------------------------------
  def update_fiber
    if @fiber
      @fiber.resume #
    elsif $game_message.busy? && !$game_message.scroll_mode
      @fiber = Fiber.new { fiber_main }
      @fiber.resume
    else
      $game_message.visible = false
    end
  end

 

 could it be that something else messed it up? all the other scripts I have installed are:

Party Guests by Mr. Bubble;

Jet's Viewed Battle System By Jet10985(Jet)

Victor Engine - Basic Module

Victor Engine - Light Effects

arranged in that order, and I have no scipt calls for Victor's Light Effects at the moment.

(also thx for the quick responses :D)

Share this post


Link to post
Share on other sites

Remove them all, see if there is a problem, and then add them back in one by one while checking if the problem appears or not.

Share this post


Link to post
Share on other sites

Yep, so it was the fault of  Victor's scripts.

Thanx for the assist...

rlly... I owe you...

like I should buy you a beer or something if we ever meet.

Lol, rlly, thx again, been scratching my ehad like a dumass for a few weeks now(also got pwned by a file corruption cuz of a computer crash)

Share this post


Link to post
Share on other sites

Which victor script? Might be useful to tell him he's got major bugs in one of his scripts..

Share this post


Link to post
Share on other sites

Gave him a PM, and sent him a link to this post. It's probably the main engine script. Told him the versions 2

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.