Getting a "stack level too deep" error w/ Tons

Started by Takua, October 04, 2009, 12:28:45 pm

Previous topic - Next topic

Takua

Whenever I press F12, I get this error:

Script 'Tons 2' line  1248: SystemStackError occured.

stack level too deep


I'm pretty sure that Zeriab made a fix for this before, but all the links I found linking to it were broken. I just want F12 to do what it normally does, to return me to the title screen at any time whenever I press it.

(Also, at the moment I'm using Dubealex's AMS, then below it are the three Tons scripts, and then below that are the three Blizz-ABS scripts.)

G_G

October 04, 2009, 12:39:37 pm #1 Last Edit: October 04, 2009, 12:42:39 pm by game_guy
EDIT: Woops wrong one hang on sorry

EDIT 2: Found this I think this'll fix that
#=begin
unless $f12_cleaner_F3XXEFA1.nil?
  # Opens the game executable in a new thread
  Thread.new{system ("Game")}  # "Game" = Name of the game executable
  # Exits this thread
  exit
end

# Modifying this global variable might cause this snippet to stop working properly.
# Some garbage have been added to lessen the chance of it already being used
$f12_cleaner_F3XXEFA1 = true
#=end

Ryex


#==============================================================================
# F12 fix
#==============================================================================

if $game_exists
  Thread.new {system('Game')}
  exit
end

$game_exists = true


I think that will work a little better that the one game guy posted
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Takua

October 04, 2009, 01:30:12 pm #3 Last Edit: October 04, 2009, 01:32:27 pm by Takua
Yeah, Ryex, yours worked a little better, just one thing: Now, when I hit F12, it closes the window and then opens up a new one (with the title screen up) (however, the window doesn't pop straight up, it appears in the taskbar first). I think it's supposed to do that, but is there any work-around to this? It's kind of annoying having to go and click on the new window down in my taskbar.

Also, it doesn't work very well in fullscreen mode, either (as it exits and then opens up the new, normal-sized window).

So, what I'm saying is: Is this possible to do without closing any windows in the process?

fugibo

Quote from: Takua on October 04, 2009, 01:30:12 pm
Yeah, Ryex, yours worked a little better, just one thing: Now, when I hit F12, it closes the window and then opens up a new one (with the title screen up) (however, the window doesn't pop straight up, it appears in the taskbar first). I think it's supposed to do that, but is there any work-around to this? It's kind of annoying having to go and click on the new window down in my taskbar.

Also, it doesn't work very well in fullscreen mode, either (as it exits and then opens up the new, normal-sized window).

So, what I'm saying is: Is this possible to do without closing any windows in the process?


Yep. First, put these lines around each piece of Tons:

unless $TONS_IS_ALREADY_LOADED

and

end


And then, immediately after the rest of tons, add this:

$TONS_IS_ALREADY_LOADED = true

Ryex

ya use long fellow's method instead of mine if you don't like the new window thing
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Takua

Thanks Longfellow, you gave me exactly what I needed. :)