Cosmetic titles for N.A.S.T.Y. Extra Stats [VXA] (Solved!)

Status
Not open for further replies.

Tevi

Fierce Demon Woof
Veteran
Joined
Mar 10, 2019
Messages
33
Reaction score
5
First Language
English
Primarily Uses
RMVXA
This is a really minor thing but I'm using NASTY's Extra Stats script for RPG Maker VX Ace and want to customise the stat's name. In the script, I've put it as ":WeaponATK", but it comes out as Weaponatk on playtests. Is there something I missed or is it generally not possible to have it like this? Sorry if it's obvious, I'm kinda dumb when it comes to actually scripting stuff.
NASTY cosmetic stats.PNG NASTY cosmetic stats1.PNG
Game, and Script respectively to make sure people can actually understand my idiotic explanations-
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
Code:
class Window_Base < Window
def draw_actor_xstat_param(actor, x, y, param_id)
id = Z26::STATS[param_id]
change_color(system_color)
draw_text(x, y, 120, line_height, id)
change_color(normal_color)
draw_text(x + 120, y, 36, line_height, actor.xstat[id], 2)
end
end
basically just remove
draw_text(x, y, 120, line_height, id.capitalize) with
draw_text(x, y, 120, line_height, id) and make sure the module text is capitalized the way you want it to.
 

Tevi

Fierce Demon Woof
Veteran
Joined
Mar 10, 2019
Messages
33
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Code:
class Window_Base < Window
def draw_actor_xstat_param(actor, x, y, param_id)
id = Z26::STATS[param_id]
change_color(system_color)
draw_text(x, y, 120, line_height, id)
change_color(normal_color)
draw_text(x + 120, y, 36, line_height, actor.xstat[id], 2)
end
end
basically just remove
draw_text(x, y, 120, line_height, id.capitalize) with
draw_text(x, y, 120, line_height, id) and make sure the module text is capitalized the way you want it to.
Thanks, that's quite helpful actually. Is there a way to make it into multiple words, or is that wishful thinking?
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
Thanks, that's quite helpful actually. Is there a way to make it into multiple words, or is that wishful thinking?
Bit of a butchered solution, but you can do a case conditional and check. EX:

if the module = WeaponATK, then draw_text(x, y, 120, line_height, "Weapon ATK")
If not, then default to draw_text(x, y, 120, line_height, id)

Might be sleeker solutions out there, idk.
 

Tevi

Fierce Demon Woof
Veteran
Joined
Mar 10, 2019
Messages
33
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Bit of a butchered solution, but you can do a case conditional and check. EX:

if the module = WeaponATK, then draw_text(x, y, 120, line_height, "Weapon ATK")
If not, then default to draw_text(x, y, 120, line_height, id)

Might be sleeker solutions out there, idk.
Yeah, that does work. Using my little knowledge of RGSS3, I figured out that id is equal to :WeaponATK, so- I did this:
Code:
if id = :WeaponATK
  draw_text(x, y, 120, line_height, "Weapon ATK")
else
    if id = :PhysicalAffinity
      draw_text(x, y, 120, line_height, "Physical Affinity")
    end
end
So yeah, a little butchered as you said, but it works, so thanks!
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
681
Reaction score
446
First Language
English
Primarily Uses
RMVXA
Make sure you use double equals signs for 'is equal to', e.g.:
Code:
if id == :WeaponATK
You might find a case statement more readable and easier to build on; something like this:
Code:
class Window_Base < Window
   def draw_actor_xstat_param(actor, x, y, param_id)
      id = Z26::STATS[param_id]
      text = id
      change_color(system_color)
      case id
      when :WeaponATK
         text = "Weapon ATK"
      when :PhysicalAffinity
         text = "Physical Affinity"
      end
      draw_text(x, y, 120, line_height, text)
      change_color(normal_color)
      draw_text(x + 120, y, 36, line_height, actor.xstat[id], 2)
   end
end
 

Tevi

Fierce Demon Woof
Veteran
Joined
Mar 10, 2019
Messages
33
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Yeah, that does look a lot better. Strangely enough though, the double equal sign gave me an error. Don't know what that was about, since I do know you're right. Thanks for the more elegant solution though.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,839
Reaction score
5,222
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top