Adding super to a subclass creates stack error

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
So I was trying to retain two methods from Game_Battler to Game_Actor, which it says that it has an error called Stack Error too deep. As far as I understand, what I was doing was conventionally correct.


Example:

Code:
class Game_Actor < Game_Battler
  def add_state(state_id)
    super(state_id)
  end
  def remove_state(state_id)
    super(state_id)
  end  
end


Does anyone know the explanation why this gives an error?
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Stack refers to function call stack.


It usually occurs if you're legitimately just making a lot of function calls, or you run into a recursive loop.


For example perhaps calling `add_state` for the actor leads to some strange recursion.


You might be able to verify that by adding a print statement before (or after) the super call.


Then you'll have to figure out why...I use this script to help print out a stack trace so I can just look at what's being called.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top