Main Menu
  • Welcome to The RPG Maker Resource Kit.

S'more Window Help....and I'm going NUTS

Started by blazinhandle, March 09, 2007, 05:49:57 AM

0 Members and 1 Guest are viewing this topic.

blazinhandle

Let me just start off by saying that, as of this moment, I have officially ended a very heartfelt relationship with the RMXP "Window"  >:(

*sigh*

Okay, I'm making a window (called ActorTurn) to display whose turn it is by using actor graphics that I've placed inside a window, in battle. I've configured all the needed coding (Window_Base, Window_ActorTurn, and Scene_Battle), but it keeps popping up with a undefined "actor.character_name" when I've used this same way of displaying things before. For the life of me, I cannot figure out wtf is going wrong! :-[

Heres the coding:

Window_Base
  def draw_turngraphic(actor, x, y)
    turngraphic = RPG::Cache.picture("BattleFaces/" + actor.character_name + "Turn")
    tgw = turngraphic.width
    tgh = turngraphic.height
    src_rect = Rect.new(0, 0, tgw, tgh)
    self.contents.blt(x - tgw / 2, y - tgh, turngraphic, src_rect)
  end


Window_ActorTurn
class Window_ActorTurn < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(-15, 300, 147, 62)
    self.opacity = 0
    self.contents = Bitmap.new(width-32, height-32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for actor in $game_party.actors
    actor = $game_party.actors
    draw_turngraphic(actor, 0, 30)
    end
  end
end


Scene_Battle (I've configured everything throughout like dispose, update, etc. that's not the problem; i'm getting the error just as I enter battle)
@actorturn_window = Window_ActorTurn.new



Thanks!

blazinhandle

excuse the double.......

i've managed to get through without the error HOWEVER, something else is up now. By changing all of this:

Window_Base
  def draw_actor_turngraphic(actor, x, y)
    for actor in $game_party.actors
    turngraphic = RPG::Cache.picture("BattleFaces/" + actor.character_name + "Turn")
    tgw = turngraphic.width
    tgh = turngraphic.height
    src_rect = Rect.new(0, 0, tgw, tgh)
    self.contents.blt(x - tgw / 115, y - tgh, turngraphic, src_rect)
    end
  end


Window_ActorTurn
class Window_ActorTurn < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(-15, 310, 147, 62)
    self.opacity = 0
    self.contents = Bitmap.new(width-32, height-32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
    actor = $game_party.actors
    draw_actor_turngraphic(actor, 0, 30)
    #draw_actor_class(actor, 30, 34)
    end
  end
end


Scene_Battle
    for actor in $game_party.actors
    @actorturn_window = Window_ActorTurn.new(@actor_index)
    end



It now shows, but stacks, all of the ActorTurn graphics when I only want it to show one (the actor whose turn is currently up, according to his/her battle commands). Any ideas?

blazinhandle


kathis

I personaly don't my appolagies I am not one to do well in "scripting" but I do know how to analize a script and figure out what it effects and does.
Project
New project. The other dimention DND
RPG makers challenge http://rmrk.net/index.php/topic,13503.0.html

blazinhandle