Several Questions

Started by Spoofus, July 24, 2017, 06:29:42 pm

Previous topic - Next topic

Spoofus

Bars
Spoiler: ShowHide

Status Icons
Spoiler: ShowHide


Some questions here.

First: how can i change the size of the bars from Blizz's Bar script in TONS

Second: I have tried to change the position of the numbers of the current HP and SP but I fail at it lol.

Third: what line of code can I put to have the actor status to be beside the actor battlers instead of being in side the status window,
and have it displaying vertical starting from the bottom up etc., I am using the status as icons from TONS, and I;m sure that some code will need to be edited as well for it, but where I been out of the rpgmaker game for so long and figured I would try messing around with an old project.


My Blog site I am working on: http://spoofus.weebly.com/

KK20

If all you want to do is make the default bar length longer, go to the script in TONS and locate
def draw_actor_hp(actor, x, y, w = 148)

Change the 148 to whatever default value you want. There are methods for SP and EXP below this method too.
However, a lot of the default scripts will override this default value so you will need to hunt them down and change them yourself. You will have to locate any instance of the methods in the various window classes (like MenuStatus, Status, BattleStatus, and so forth) and modify the fourth value to what you want it to be. For example, in Window_BattleStatus line 40:
draw_actor_hp(actor, actor_x, 32, 120)

change the 120.

In Window_Base, locate the same draw_actor_hp/sp/exp methods. You will see a line that draws the text for these values like so
    # Draw HP
    self.contents.font.color = actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2) #<========== The 2 indicates left-alignment
    # Draw MaxHP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1) #<========== The 1 indicates center
      self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s) #<========== Don't put a number for right-alignment
    end

I don't know what you want but change the values and see what you get.

For status icons, you'll probably need to make a script request as Blizzard's script is more of a generic implementation. It only draws in the window, not outside of it as your screenshot suggests.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Spoofus

def draw_actor_hp(actor, x, y, w = 148)


When I changed the 148 value and the bar length did not change at all, I am wanting to make it shorter if possible.
I did mess with a few other values there but none seemed to effect it in anyway.

Found the line I needed to change to change the position of where the hp value is shown but it will also change it the hp position in the menu as well, which ain't to big of a deal because I am wanting to request a new menu system soon anyways.

As for the Status effects If the bars length can be shorten I figured out something for them so that will be placed on the back burner for now.

currently how I got it going, I think it is starting to look purdy nice.
Spoiler: ShowHide




My Blog site I am working on: http://spoofus.weebly.com/

KK20

Quote from: KK20 on July 25, 2017, 03:55:18 am
However, a lot of the default scripts will override this default value so you will need to hunt them down and change them yourself. You will have to locate any instance of the methods in the various window classes (like MenuStatus, Status, BattleStatus, and so forth) and modify the fourth value to what you want it to be. For example, in Window_BattleStatus line 40:
draw_actor_hp(actor, actor_x, 32, 120)

change the 120.


Yeah, there's only one generic draw_actor_ whatever method for the Window classes. Of course it's going to affect the other menu systems you have in place--they all use the same method to draw it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Spoofus

Ok I found out what needs to be changed to change the width of the bars

Spoiler: ShowHide
def gradient_bar(x, y, w, color1, color2, color3, rate, flag = false)
    # stop if not active or out of range
    return unless $game_system.BARS || flag
    return if $game_system.bar_style < 0 || $game_system.bar_style > 6
    # styles with "vertical" black borders
    styles = [1, 3, 4, 5, 6]
    # setup of coordinates and offsets depending on style
    offs = 5
    x += offs
    y += 25
    if styles.include?($game_system.bar_style)
      offs += 2
      y -= 1
      [5, 6].include?($game_system.bar_style) ? y -= 2 :  x += 1
      # quantizes the width so it looks better (remove it and see what happens)
      w = w / 8 * 8
    end


w = w / 8 * 8

mess with the values of the 8 * 8 to change the width of the bars
Spoiler: ShowHide


My Blog site I am working on: http://spoofus.weebly.com/