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] Want to learn, and stop being so dependant

Status
Not open for further replies.
Can someone please take this HUD:

Code:
class Window_HUD < Window_Base
  def initialize
    super(640,480,176,128)
    self.contents = Bitmap.new(140,96)
    self.contents.font.size = 20
    self.back_opacity = 160
    refresh
  end
  def refresh
    self.contents.clear
    @actor = $game_party.actors[0]
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(5,1,132,20,@actor.name.to_s,1)
    self.contents.draw_text(5,21,132,20,@actor.class_name.to_s,1)
    self.contents.font.color = system_color
    self.contents.draw_text(4,20,132,20,@actor.class_name.to_s,1)
    self.contents.font.color = normal_color
    self.contents.draw_text(4,0,132,20,@actor.name.to_s,1)
    draw_actor_hp(@actor,4,34)
    draw_actor_sp(@actor,4,52)
    self.contents.draw_text(4,76,132,20,$game_party.gold.to_s,2)
    self.contents.draw_text(4,76,132,20,$data_system.words.gold + ":")
  end
end
class Scene_Map
  alias hud_main main
  alias hud_update update
  def main
    @hud = Window_HUD.new
    hud_main
    @hud.dispose
  end
  def update
    @hud.refresh
    if $game_switches[10] and @hud.x > 468
      @hud.x -= 11
      @hud.y -= 8
    end
    if $game_switches[10] == false and @hud.x < 640
      @hud.x += 11
      @hud.y += 8
    end
    hud_update
  end
end
which looks like this:
http://img134.imageshack.us/img134/4666/hudforrequestoh7.png[/IMG]

And move the Class name to the left, and add current Level and Exp on that same line.
I want it in the format: Class Name Lv: ## Exp: ###

I do want to learn, so if you have the time, could you show me what you did?

I'm pretty sure the first part is modifying the x and y of the class, and then adding the draw command for level and exp.
I just dont know HOW to do it.

Thanks in advance.
Much Obliged, Ninjitsu.

Btw: If you're good at messing with HUDs, and know about ZTBS, would you mind helping me on another HUD; the one in that battle system?
 
Hmm, Seems easy enough, give me a few seconds.

Want the gold aligned?

5,
0,
0,

instead of

5,
0,
...0

Uhhm, Are you sure this is the whole thing? I think you are missing some b/c I tried it, and it is failing to work, even in ZTBS
 
Yeah, I copy and pastied the script. It should work.
Ill try again.
Code:
class Window_HUD < Window_Base
  def initialize
    super(640,480,176,128)
    self.contents = Bitmap.new(140,96)
    self.contents.font.size = 20
    self.back_opacity = 160
    refresh
  end
  def refresh
    self.contents.clear
    @actor = $game_party.actors[0]
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(5,1,132,20,@actor.name.to_s,1)
    self.contents.draw_text(5,21,132,20,@actor.class_name.to_s,1)
    self.contents.font.color = system_color
    self.contents.draw_text(4,20,132,20,@actor.class_name.to_s,1)
    self.contents.font.color = normal_color
    self.contents.draw_text(4,0,132,20,@actor.name.to_s,1)
    draw_actor_hp(@actor,4,34)
    draw_actor_sp(@actor,4,52)
    self.contents.draw_text(4,76,132,20,$game_party.gold.to_s,2)
    self.contents.draw_text(4,76,132,20,$data_system.words.gold + ":")
  end
end
class Scene_Map
  alias hud_main main
  alias hud_update update
  def main
    @hud = Window_HUD.new
    hud_main
    @hud.dispose
  end
  def update
    @hud.refresh
    if $game_switches[10] and @hud.x > 468
      @hud.x -= 11
      @hud.y -= 8
    end
    if $game_switches[10] == false and @hud.x < 640
      @hud.x += 11
      @hud.y += 8
    end
    hud_update
  end
end
It's an overhead, it works outside of battle; on the map.
I turn it off when i enter battle with the switch.
And that gold thing is ok, because HP and Sp will go into the 4 digits.
Thanks
 

arev

Sponsor

This HUD is done by me, not Arbiter ^^
Anyway, find those lines:
Code:
self.contents.draw_text(5,21,132,20,@actor.class_name.to_s,1)
Replace the last "1" with 0, and the class name will align to left border. Now add something like this, but replace 5 with a bigger value (test whatever works good) and also replace "class_name" with "level" or "exp" to get what you want.
 
Yeah! It was you!
Hard name to remember, but i remembered the spinning key thing!
Didnt arbiter help?

Anyways, thanks.
See, this is the way i like learning. Tell me what to do, but leave me hanging. Lol.

I change the 1 to zero, then replace the phrase: "class_name" with the single terms : "level" or "exp"?

I'll try out numbers and tell you what works, but thanks.
________________________________________________________________________________
Edit:
I changed the 1 to zero, and then the class name like split.
Idk:
http://img89.imageshack.us/img89/4171/hudixu8.png[/IMG]
 

arev

Sponsor

It's a transistor, not a key ;)

Notice, that this line i pointed occurs twice. Once it's light blue, once it's black (the shadow). You have to edit both.

Btw. I'm moving this topic to RGSS Support :)
 
Yeah, i know you did SOMETHING for me...
And what exactly are the lines im supposed to paste in?

Code:
self.contents.draw_text(5,21,132,20,@actor.class_level.to_s,1)
self.contents.draw_text(5,21,132,20,@actor.class_exp.to_s,1)

Is that it?
 

khmp

Sponsor

I missed how this started or where you're currently at but:

self.contents.draw_text(5,21,132,20,'Lv ' + @actor.level.to_s,0)
self.contents.draw_text(5,21,132,20,'Exp ' + @actor.exp.to_s,0)
 
Omg, i never read this.
It fell behind all the forum games.

REALLY sorry if this is a necro.
But thanks khmp.
I guess this is resolved. I finished my hud, lol.
In like December. Thanks tho.
 
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