Yanfly battle and different fonts

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
  My game has the option to change the font anytime the player wants. All scenes are working fine, but the yanfly battle system.

  The second font is named Gabrielle. It's a smaller font than VLGothic (Ace's default), but in the battle hud the font appears way bigger:



 

Here's the default font:



 

  My question is - Is it related to the Yanfly battle system diminishing the actual size of the default font, but not recognizing the Gabrielle font (or even a default script that does it)? This is my first guess as, like i said, gabrielle font is way smaller.

  If this is true, is it easy to make the script recognize my new font and thus making it smaller in battle?

 

  Thanks in advance, and here's the link to Yanfly battle engine: http://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,839
Reaction score
14,031
First Language
English
Primarily Uses
RMMV
These two lines look a bit suspicious:

Code:
    BATTLESTATUS_NAME_FONT_SIZE = 20    # Font size used for name.    BATTLESTATUS_TEXT_FONT_SIZE = 16    # Font size used for HP, MP, TP.
You could do a search through the script and just comment out any line that sets a font.size to either of those constants. Then it will take the default size instead. Or if allowing the player to change the font also allows them to change the default font size, you could change it to use whatever that (variable) font size is, instead of the constants.
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Oh hello again Shaz  :) , always helping the community rsrs.

Actually i already did that before the post, it just changes what's said after the #. So there isn't an option to change the font for the rest of the text in the battle hud (commands, skills, items, etc.)

I also tryed to add the Gabrielle font at this line, but nothing happened as it's related only to popups i think:

DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]I really think it's nice to give the player an option to change it's font type, as my game has a lot of dialog. If there's an option to change only the font size of the secondary font, i could do it only for the battles (via script call before the battles) as the commom messages during the map already shows a small font at size 24, and that's why i truly think the battle system isn't reducing its size.

PS: I use "Font.default_size = 24" at main (without the quotes)
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,839
Reaction score
14,031
First Language
English
Primarily Uses
RMMV
I'm not sure I understand. You say it's not recognizing the font, but the screenshot shows the font being used.


Unfortunately, a size 24 in one font is not the same as a size 24 in another font (and I don't really understand why), so if you are going to allow them to change fonts, you have to be prepared that some of the text will not fit, and make your scripts clever enough to handle that. Other than the above, I don't know of any easy way to do that.


Unless I'm just misunderstanding the problem.
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
  Just a tiny bit actually as you thought rsrs. When i said it's not recognizing the font, it's because the size reduction process only, that i am sure the yanfly battle engine (or the default battle script) does.

  When i am outside of battle, the Gothic font at size 24 is way larger than the Gabrielle font at the same size. When i go to battle, the gothic font is small enough to fit the full skill name (it was reduced to fit, you can see the different sizes at the screenshot), but the gabrielle font in battle is much larger than the gothic font.

  You're completely right in the part that i have to be prepared to handle different font types. I already did many small adjustments to other scenes (i am not a scripter but i can regonize some classes and code lines usage), but the battle hud is really something different that what i've faced.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
well, as a workaround you can maybe simply tie up font size with the font itself so when you change fonts, it will change size too... though you'd need to edit Yanfly's battle script to do it...

btw, can you post screenies of what it looks like outside of battle? just so we have an actual comparison of how different they look in and out of battle...
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Sry for the late reply, i was working.

Sure thing, here are the screens outside of the battle. Please notice that the Gabrielle font is way smaller, so it's not being reduced in battle:

Default font:



 

Gabrielle font:

 



 

 

 

EDIT: I just had an idea that might be much easier to implement: is it hard to modify the ace battle engine to it only recognizes the default font? It would solve the problems of this issue.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
Well, I think you simply need to set the font to default right at the start of the battle scene and reset it to whatever font the game uses afterwards
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Well, I think you simply need to set the font to default right at the start of the battle scene and reset it to whatever font the game uses afterwards
Yeah this seems to be the easiest way, as i know some other scripts (mostly custom stats and equip scenes) still mantains the default font even if i change it.

If an admin is willing to move this topic to the classifields, i'd like to pay for this modification on Yanfly Battle Engine:

  *The yanfly battle engine must mantain the default VLGothic font over all popups, HUD sections, items and skill descriptions and battlelog, even if i change the font through Zalerinian font changer script:

Code:
module FontsOriginal_Fonts = [ "VL Gothic", "Verdana", "Arial", "Courier New"]def self.add_font(font_name, bold = false)return if Font.default_name[0] == font_nameif font_name == "ORIGINAL_FONTS" thenFont.default_name = Original_FontsreturnendFont.default_bold = boldputs "Bold set to " + Font.default_bold.to_s + "!"Font.default_name.unshift(font_name)puts "New Font System: " + Font.default_name.to_s + "\n\n"enddef self.set_size(size)Font.default_size = sizeputs "Font size set to: " + Font.default_size.to_senddef self.set_bold(value)if value == true || value == falseFont.default_bold = valueendenddef self.remove_firstif Font.default_name.size == 1 thenputs "You should save at least one font, you know."elseFont.default_name.shiftendendendclass Window_Base < Windowdef line_heightreturn Font.default_sizeendendclass Window_Base < Windowalias convert_e_chars convert_escape_charactersdef convert_escape_characters(text)result = text.to_s.cloneresult.gsub!(/\\F\[(\w+)\]/i) { Fonts.add_font($1) }convert_e_chars(result)endend 
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
I think I have a working one... PM me...
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
The issue was solved, thanks Shaz and adiktuzmiko.
 

Latest Threads

Latest Posts

Latest Profile Posts

Looking back at some sketches, and game design documents on my PC dated summer of 2015. I started development with the release of MZ, but in 2015, I felt a strong desire to make a game out of the blue. I remember feeling sad for no apparent reason, and all these ideas rushed into my head. Now that I think about it, since that day, everything has become easier to do on my PC . . . it’s very creepy.
Everything's going to be alright! We're all in this together. <3
Aaaaannd published my game's tech demo. :D

Feel free to download and play it. And give feedback!
Hey everyone, we know that the edit bar is missing. We're working on it. You can talk about it in the announcement here: https://forums.rpgmakerweb.com/index.php?threads/forum-errors-missing-edit-bar-etc.132715/
So, explain why we can no longer use BBC code or smilies in our posts? This sparks much sadness...

Forum statistics

Threads
107,794
Messages
1,032,255
Members
139,941
Latest member
Finley
Top