Jump to content


Photo

Stack level too deep error-Help!

stack level stack help error

This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1 guguman

guguman

    Member

  • Members
  • 19 posts

Posted 19 February 2013 - 01:36 PM

 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.


11.jpg


#2 Dark_Metamorphosis

Dark_Metamorphosis

    What a horrible night to have a curse.

  • Members
  • 663 posts

Posted 19 February 2013 - 01:44 PM

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.


Edited by Dark_Metamorphosis, 19 February 2013 - 01:51 PM.

'You have been doomed ever since you lost the ability to love.'

 

Infected with the sickness..

My current project:
qfa6.png
 
 

Some of the games I support:

Spoiler

#3 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 4,824 posts

User's Awards

        

Posted 19 February 2013 - 01:49 PM

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
  end
rescue SystemExit
  exit
rescue 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.
My Scripts. Go here for Bugs and Requests.

himeworks011.png

Like on Facebook: HimeWorks
Follow on Twitter: @HimeWorks

#4 guguman

guguman

    Member

  • Members
  • 19 posts

Posted 19 February 2013 - 02:54 PM

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.


Edited by guguman, 19 February 2013 - 02:56 PM.

11.jpg


#5 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 4,824 posts

User's Awards

        

Posted 19 February 2013 - 02:56 PM

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

My Scripts. Go here for Bugs and Requests.

himeworks011.png

Like on Facebook: HimeWorks
Follow on Twitter: @HimeWorks

#6 guguman

guguman

    Member

  • Members
  • 19 posts

Posted 19 February 2013 - 03:09 PM

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)


11.jpg


#7 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 4,824 posts

User's Awards

        

Posted 19 February 2013 - 03:14 PM

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.
My Scripts. Go here for Bugs and Requests.

himeworks011.png

Like on Facebook: HimeWorks
Follow on Twitter: @HimeWorks

#8 guguman

guguman

    Member

  • Members
  • 19 posts

Posted 19 February 2013 - 03:22 PM

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)


11.jpg


#9 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 4,824 posts

User's Awards

        

Posted 19 February 2013 - 04:22 PM

Which victor script? Might be useful to tell him he's got major bugs in one of his scripts..
My Scripts. Go here for Bugs and Requests.

himeworks011.png

Like on Facebook: HimeWorks
Follow on Twitter: @HimeWorks

#10 guguman

guguman

    Member

  • Members
  • 19 posts

Posted 19 February 2013 - 04:24 PM

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


11.jpg