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.

[Resolved] Mysterious error

Status
Not open for further replies.
Hi, il get right to the point ^^

When i win a battle with 2 or less actors i get the following error.

http://img62.imageshack.us/img62/6240/untitled1lr3.jpg[/IMG]

And then the client crashes...

But if i have 3 or more actors in the party when i win i dont get any error and the game continue as normal.

The scripts i have is

CBS made by the guy at http://rye.jp/
Enhanced Equip Window by Trance
Multi-hit by SephirothSpawn
AMS by Dubealex
SDK 2.2 I-IV


I dont really know anything about scripting so i have no clue about what is wrong, i have only tested a little by removing one script at a time and testplay without it but the error wont dissapear. :(


Hope i posted in the right section now :)
And sorry for my bad english.


/Lazarus
 
there is something like "actor.name" whitin a "for" statement. This "for" statement is checking aways three actors (characters), and not the exact number of actors in party.

Paste the code, please. :)
SEE YA!!!!!
 
The error is caused by one of the scripts trying to draw the name of a party member that doesn't exist, search for 'draw_actor_name' in the scripts and post what the stuff around it looks like s:

Edit - If the for loop is checking 'for something in 0...3' change it to 'for something in 0...$game_party.actors.size'..
I couldn't find the CBS on the site, so you'll have to paste the for loop here for us to really help s:
 
Well, it's not the CBS s:
If your scripts are in that order, that might be whats causing the error s:
The SDK is probably overwriting something in one of the other scripts, try sticking all the custom scripts below the SDK <.<
 
Oh, the problem is you're using some messed up Window_BattleResult 0_o
Just replace the whole thing with this:
Code:
#==============================================================================
# ** Window_BattleResult
#------------------------------------------------------------------------------
#  This window displays amount of gold and EXP acquired at the end of a battle.
#==============================================================================

class Window_BattleResult < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     exp       : EXP
  #     gold      : amount of gold
  #     treasures : treasures
  #--------------------------------------------------------------------------
  def initialize(exp, gold, treasures)
    @exp = exp
    @gold = gold
    @treasures = treasures
    super(160, 0, 320, @treasures.size * 32 + 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.y = 160 - height / 2
    self.back_opacity = 160
    self.visible = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    x = 4
    self.contents.font.color = normal_color
    cx = contents.text_size(@exp.to_s).width
    self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
    x += cx + 4
    self.contents.font.color = system_color
    cx = contents.text_size("EXP").width
    self.contents.draw_text(x, 0, 64, 32, "EXP")
    x += cx + 16
    self.contents.font.color = normal_color
    cx = contents.text_size(@gold.to_s).width
    self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
    x += cx + 4
    self.contents.font.color = system_color
    self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
    y = 32
    for item in @treasures
      draw_item_name(item, 4, y)
      y += 32
    end
  end
end
 
This topic has been resolved. If Lazarus or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

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