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.

Stack level too deep?

I did a search on this, but it was either deleted by the hack or I didn't understand it, so I'm posting this question here:

How can I fix the "stack level too deep" error when hitting F12?

It's because of this class:

class Font
alias font_fix_initialize initialize
def initialize
font_fix_initialize
self.name = "Arial" # Font
self.size = 24 # Size
end
end

It gives the error for font_fix_initialize.

Thanks! ^_^
 
Um.. why even use that?

Font.default_name = 'Arial'
Font.default_size = 24

(Which shouldn't need any kind of a font fix anyways)

To fix that weird script though, just add a conditional for if the method isn't defined. The hidden classes aren't reloaded when F12 is pressed.
 
Paste this just above main:

Code:
#==============================================================================
# ** Module RPG 
#==============================================================================
module RPG
  class Bitmap < ::Bitmap
    Font.default_name = "Arial"
    Font.default_size = 24
    Font.default_bold = false
    Font.default_italic = false
  end
end

Just using this module will automatically reset your default font to the specs you desired.
 

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