RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Unknown Stack Error [VX]

0 Members and 1 Guest are viewing this topic.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Urr... the PAC version, at least, of my Equipment Set's script causes a stack error when either a new game or continue scene is called after pressing F12, but not after the To Title command in the Game End section of the menu is used. The error is:
Quote
Script 'PAC Equipment Sets' line 264: SystemStackError occurred.

stack level too deep.
So, of course, we open up the editor to see why this is happening. The code around there is:
Code: [Select]
class Game_Actor < Game_Battler
 #A whole bunch of other stuff...
  alias pacman_eq_bonus_maxhp maxhp
 #Some more stuff...
  def maxhp
    default_val = pacman_eq_bonus_maxhp #LINE 264
    final_val = default_val
    n = 100
    if @bonus_set
    if !@bonus_set.empty?
      for j in 0...@bonus_set.size
      for i in 0...@bonus_set_pieces[j]
        if Set_Bonus[@bonus_set[j]][i] != nil
          if Set_Bonus[@bonus_set[j]][i][0] == 5
            n += Set_Bonus[@bonus_set[j]][i][1]
          end
        end
      end
    end
      final_val *= n
      final_val /= 100
    else
      final_val = default_val
    end
    end
    return final_val
  end
#More stuff...
end
Now, the stuff around that method is very, VERY similar to that method, e.g. the agi method is:
Code: [Select]
  def agi
    default_val = pacman_eq_bonus_agi
    final_val = default_val
    n = 100
    if !@bonus_set.empty?
      for j in 0...@bonus_set.size
      for i in 0...@bonus_set_pieces[j]
        if Set_Bonus[@bonus_set[j]][i] != nil
          if Set_Bonus[@bonus_set[j]][i][0] == 4
            n +=Set_Bonus[@bonus_set[j]][i][1]
          end
        end
      end
    end
    final_val *= n
      final_val /= 100
    else
      final_val = default_val
    end
    return final_val
  end
So I really have no idea what's causing the stack error in the maxhp method if the agi method is perfectly fine and error free. If nobody knows what's going on, is there a way to escape a stack error?
it's like a metaphor or something i don't know

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Maybe it's not error free. Maybe the maxhp method just crashes it first, but if it weren't there, the agi method would.

Anyway, for now you can just replace this:

Code: [Select]
  alias pacman_eq_bonus_atk atk
  alias pacman_eq_bonus_def def
  alias pacman_eq_bonus_spi spi
  alias pacman_eq_bonus_agi agi
  alias pacman_eq_bonus_maxhp maxhp
  alias pacman_eq_bonus_maxmp maxmp
  alias pacman_eq_bonus_cri cri
  alias pacman_eq_bonus_eva eva

with this:

Code: [Select]

  unless self.method_defined? (:pacman_eq_bonus_maxhp)
    alias pacman_eq_bonus_atk atk
    alias pacman_eq_bonus_def def
    alias pacman_eq_bonus_spi spi
    alias pacman_eq_bonus_agi agi
    alias pacman_eq_bonus_maxhp maxhp
    alias pacman_eq_bonus_maxmp maxmp
  end
  alias pacman_eq_bonus_cri cri
  alias pacman_eq_bonus_eva eva


Oh, and also, you might want to look into your PAC Skills. At line 435, you have
Code: [Select]
return_scene
but there is no such method in Scene_Battle. That will cause a NoMethodError. You probably meant for it to be
Code: [Select]
end_skill_selection
« Last Edit: May 10, 2011, 01:42:51 PM by modern algebra »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Thanks once again MA. It works fine now.
As for the skills script, it's quite heavily based off of Cozziekun's script, and admittedly I didn't look through the code that thoroughly. Thanks for picking up on that.
I still have no idea what caused the stack though.
it's like a metaphor or something i don't know