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.

Posting a variable in the Scene_Status screen

Okay, so here's what I want to find out. I want to put another section in the Status window for a special set of points I set up via variable. However, I don't know how to do it. I need it to show up as 3 different things (each dependent on which switch is on). Honor Points shows up if Switch 50 is on. Glory Points shows up if Switch 54 is on. Chaos Points shows up if Switch 55 is on. That's what I need. Then, for each, I need points to be set up with them, like Honor Points need to be dependent on what variable 50 is, glory points dependant on variable 54, and Chaos Points dependant on variable 55.

Is it possible to do this? if so, then how? Also, i only want them to appear on the screen for character number 3. Does anyone know how I could do this?
 
In the refresh method of Window_Status you can make something like:
Code:
if $game_switches[50]
self.contents.draw_text(x, y, width, height, $game_variables[50].to_s)
end
if $game_switches[54]
self.contents.draw_text(x, y, width, height, $game_variables[54].to_s)
end
if $game_switches[55]
self.contents.draw_text(x, y, width, height, $game_variables[55].to_s)
end

Just change the x, y, width an height to the value you want to use for it.
 
Well, it works, except I realized I was asking for the wrong screen. I was wanting the status screen that comes up for each individual actor, after you've clicked on the actor in the first status screen. Also, how would I set it up so it only appears on Actor 3's screen? And how do I make it say "Honor Points" "Chaos Points" or "Glory Points" (depending on which switch is up).
 
I actualy have no idea how to set it so it only shows at the actor's 3 status, but the words you could make it like:
Code:
if $game_switches[50]
self.contents.draw_text(x, y, width, height, "Honor Points " + $game_variables[50].to_s)
end
if $game_switches[54]
self.contents.draw_text(x, y, width, height, "Glory Points " + $game_variables[54].to_s)
end
if $game_switches[55]
self.contents.draw_text(x, y, width, height, "Chaos Points " + $game_variables[55].to_s)
end
 
If i use @actor = 3, 180, 180, "Honor Points " + $game_variables[50].to_s, or if I use @actor, 180, 180, "Honor Points " + $game_variables[50].to_s I get an argument error, 5 for 4. If I use what you have, I see nothing.
 
Yes, I am sure. It says I have version 1.02. I am using Diego's CMS, but that shouldn't make any difference. Here's my status screen, though.

Code:
#==============================================================================
# â–  Window_NewStatus
#==============================================================================

class Window_NewStatus < Window_Base

  def initialize(actor)
    super(0, 0, 576, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Times New Roman"
    self.contents.font.size = 20
    @actor = actor
    refresh
  end

  def refresh
    self.contents.clear
    draw_actor_name(@actor, 54, 0)
    draw_actor_battler(@actor, 80, 200)
    draw_actor_class(@actor, 254, 0)
    draw_actor_level(@actor, 184, 0)
    draw_actor_state(@actor, 184, 40)
    draw_actor_hp(@actor, 184, 80, 172)
    draw_actor_sp(@actor, 184, 120, 172)
    draw_actor_exp(@actor, 184, 160, 172)
    if $game_switches[50]
    self.contents.draw_text(x, y, width, height, "Honor Points " + $game_variables[50].to_s)
    end
    if $game_switches[54]
    self.contents.draw_text(x, y, width, height, "Glory Points " + $game_variables[54].to_s)
    end
    if $game_switches[55]
    self.contents.draw_text(x, y, width, height, "Chaos Points " + $game_variables[55].to_s)
    end
    
    draw_actor_parameter(@actor, 386, 0, 0)
    draw_actor_parameter(@actor, 386, 24, 1)
    draw_actor_parameter(@actor, 386, 48, 2)
    draw_actor_parameter(@actor, 386, 72, 3)
    draw_actor_parameter(@actor, 386, 96, 4)
    draw_actor_parameter(@actor, 386, 120, 5)
    draw_actor_parameter(@actor, 386, 144, 6)
    draw_actor_parameter(@actor, 386, 168, 7)
    self.contents.font.color = system_color
    self.contents.draw_text(45, 196, 180, 32, "Elemental Vulnerability" )
    self.contents.font.size = 16
    draw_actor_element_radar_graph(@actor, 14, 204)
    self.contents.font.size = 20
    self.contents.font.color = system_color
    self.contents.draw_text(360, 200, 96, 32, "Equipment")
    self.contents.draw_text(280, 228, 96, 32, "Weapon")
    self.contents.draw_text(280, 256, 96, 32, "Shield")
    self.contents.draw_text(280, 284, 96, 32, "Helmet")
    self.contents.draw_text(280, 312, 96, 32, "Armor")
    self.contents.draw_text(280, 340, 96, 32, "Accessory")
    equip = $data_weapons[@actor.weapon_id]
    if  @actor.equippable?(equip)
      draw_item_name($data_weapons[@actor.weapon_id], 386, 228)
    else 
      self.contents.font.color = knockout_color
      self.contents.draw_text(386, 228, 192, 32, "Nothing equipped")
    end
    equip1 = $data_armors[@actor.armor1_id]
      if  @actor.equippable?(equip1)
      draw_item_name($data_armors[@actor.armor1_id], 386, 256)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 256, 192, 32, "Nothing equipped")
    end
    equip2 = $data_armors[@actor.armor2_id]
      if  @actor.equippable?(equip2)
      draw_item_name($data_armors[@actor.armor2_id], 386, 284)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 284, 192, 32, "Nothing equipped")
    end
    equip3 = $data_armors[@actor.armor3_id]
      if  @actor.equippable?(equip3)
      draw_item_name($data_armors[@actor.armor3_id], 386, 312)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 312, 192, 32, "Nothing equipped")
    end
    equip4 = $data_armors[@actor.armor4_id]
      if  @actor.equippable?(equip4)
      draw_item_name($data_armors[@actor.armor4_id], 386, 340)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 340, 192, 32, "Nothing equipped")
    end    
  end
  
  def update_actor(actor)
    @actor = actor
    refresh
  end
  
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
  
end
 
hmm...maybe that's my problem...how do "width" and "height" work?

EDIT: Even if I change all 4 of the numbers up there (x, y, width, and height) I still get nothing. Maybe someone can put it together, then just send me the remake of the script? Also, I'm still looking for this to work for only actor number 3, so can anyone figure that out, too?
 
Just set width to a large number (probably 320 shouild be large enough) and height to 32 should be good.

Do you want it to be the actor with the index of 3, or the third actor in your party? For the first, surround the text printing definitions with an if test:

Code:
if @actor.id == 3

This will return true if it's the 4th actor, the third actor would be @actor.id == 2. I don't know if you meant actor index 3 or third actor.

You said you get an argument error. What line is it on and what is on that line?
 
Can't say, I don't know what line it was on. It didn't give me a line. Also, I mean the third actor in the database. not the third actor in the party, though. Is it possible you could just post a redo of the script above with all that, though? Cause I'm still confused on it.
 
Code:
#==============================================================================
# â–  Window_NewStatus
#==============================================================================

class Window_NewStatus < Window_Base

  def initialize(actor)
    super(0, 0, 576, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Times New Roman"
    self.contents.font.size = 20
    @actor = actor
    refresh
  end

  def refresh
    self.contents.clear
    draw_actor_name(@actor, 54, 0)
    draw_actor_battler(@actor, 80, 200)
    draw_actor_class(@actor, 254, 0)
    draw_actor_level(@actor, 184, 0)
    draw_actor_state(@actor, 184, 40)
    draw_actor_hp(@actor, 184, 80, 172)
    draw_actor_sp(@actor, 184, 120, 172)
    draw_actor_exp(@actor, 184, 160, 172)
    draw_actor_parameter(@actor, 386, 0, 0)
    draw_actor_parameter(@actor, 386, 24, 1)
    draw_actor_parameter(@actor, 386, 48, 2)
    draw_actor_parameter(@actor, 386, 72, 3)
    draw_actor_parameter(@actor, 386, 96, 4)
    draw_actor_parameter(@actor, 386, 120, 5)
    draw_actor_parameter(@actor, 386, 144, 6)
    draw_actor_parameter(@actor, 386, 168, 7)
    if @actor.id == 2
      if $game_switches[50]
        self.contents.font.color = system_color
        self.contents.draw_text(0, 224, 192, 32, "Honor Points:")
        self.contents.font.color = normal_color
        self.contents.draw_text(192, 224, 64, 32, $game_variables[50].to_s)
      end
      if $game_switches[54]
        self.contents.font.color = system_color
        self.contents.draw_text(0, 256, 192, 32, "Glory Points:")
        self.contents.font.color = normal_color
        self.contents.draw_text(192, 256, 64, 32, $game_variables[54].to_s)
      end
      if $game_switches[55]
        self.contents.font.color = system_color
        self.contents.draw_text(0, 288, 192, 32, "Chaos Points:")
        self.contents.font.color = normal_color
        self.contents.draw_text(192, 288, 64, 32, $game_variables[55].to_s)
      end
    end
    self.contents.font.color = system_color
    self.contents.draw_text(45, 196, 180, 32, "Elemental Vulnerability" )
    self.contents.font.size = 16
    draw_actor_element_radar_graph(@actor, 14, 204)
    self.contents.font.size = 20
    self.contents.font.color = system_color
    self.contents.draw_text(360, 200, 96, 32, "Equipment")
    self.contents.draw_text(280, 228, 96, 32, "Weapon")
    self.contents.draw_text(280, 256, 96, 32, "Shield")
    self.contents.draw_text(280, 284, 96, 32, "Helmet")
    self.contents.draw_text(280, 312, 96, 32, "Armor")
    self.contents.draw_text(280, 340, 96, 32, "Accessory")
    equip = $data_weapons[@actor.weapon_id]
    if  @actor.equippable?(equip)
      draw_item_name($data_weapons[@actor.weapon_id], 386, 228)
    else 
      self.contents.font.color = knockout_color
      self.contents.draw_text(386, 228, 192, 32, "Nothing equipped")
    end
    equip1 = $data_armors[@actor.armor1_id]
      if  @actor.equippable?(equip1)
      draw_item_name($data_armors[@actor.armor1_id], 386, 256)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 256, 192, 32, "Nothing equipped")
    end
    equip2 = $data_armors[@actor.armor2_id]
      if  @actor.equippable?(equip2)
      draw_item_name($data_armors[@actor.armor2_id], 386, 284)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 284, 192, 32, "Nothing equipped")
    end
    equip3 = $data_armors[@actor.armor3_id]
      if  @actor.equippable?(equip3)
      draw_item_name($data_armors[@actor.armor3_id], 386, 312)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 312, 192, 32, "Nothing equipped")
    end
    equip4 = $data_armors[@actor.armor4_id]
      if  @actor.equippable?(equip4)
      draw_item_name($data_armors[@actor.armor4_id], 386, 340)
    else 
      self.contents.font.color = crisis_color
      self.contents.draw_text(386, 340, 192, 32, "Nothing equipped")
    end    
  end
  
  def update_actor(actor)
    @actor = actor
    refresh
  end
  
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end

That's my best guess, I don't feel like trying it out in RMXP so I'd like to see a screenshot of it in action.

EDIT: Oh...now I know what went in that space. Just noticed the radar graph. You'll have to fiddle with the values for X and Y, because I think the way it is right now it'll appear under the element vulnerability graph.
 
It works...sort of...Now I just have to find a spot on the screen for it. Also, it needed to be actor.id == 3 not 2. Just figured I'd let you know. I'll post a screenshot of it once I get it in a good spot. Does anyone know how to turn this int' a gradient bar, like the Experience bar that goes up, then resets when you have hit the number? Cause I want it to reach a certain number, then go back down until it reaches the highest it can be at 615. Anyone know how to do that? If not, then it's fine the way it is.
 
I could do that. Tell me what you want the maximum to be, and if you already have the script for EXP bars, give me a look and I'll do it for you.

I'd still like to see a screenshot, since I'm too lazy to run this through RMXP myself, especially given that I'd have to install the elemental vulnerability wheel script as well.
 
That would be cool. Well, each time it goes up, so...first it's at 12, then 30, and then...I can't remember after that, but it goes upto 615 at the end. So...I don't have the exp bar script (sorry) but I do have screenshots. My computer is running too slow at the moment to see which is which, so I'll just give you the whole directory http://smg.photobucket.com/albums/v59/tamo_konichi/JOH_Screenshots/ maybe you can find it yourself. Sorry...
 

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