Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Wingard on June 05, 2013, 03:01:59 pm

Title: [RESOLVED] Displaying evasion parameter
Post by: Wingard on June 05, 2013, 03:01:59 pm
Hey, quick question from a nooby "scripter" here  :D

Is there a way to display actor's evasion parameter?

I tried to modify "Draw Parameter" section in Window_Base by adding:
  when 7
     parameter_name = $data_system.words.eva
     parameter_value = actor.eva
     self.contents.draw_text(x + 10, y, 120, 32, parameter_name)
     self.contents.draw_text(x + 45, y, 36, 32, parameter_value.to_s, 2)

... but when im trying to make script display it by the draw_actor_parameter command it doesnt work. :/ This only results in the game crash with a message which says that the first line is wrong (the one below "when 7") and this:

undefined method 'eva' for #<RPG::System::Words:0x3335778>

I dont really know how to "define method 'eva'" or where to do it. Could someone help me with this? :plz:
Title: Re: Displaying evasion parameter
Post by: G_G on June 05, 2013, 06:16:58 pm
That's because "eva" doesn't exist as a system word. You'll just have to implement your own word.
parameter_name = "EVA"
Title: Re: Displaying evasion parameter
Post by: Wingard on June 05, 2013, 06:48:17 pm
And now it works!  :D   Thank you so much.  :)
Title: Re: Displaying evasion parameter
Post by: G_G on June 05, 2013, 07:17:01 pm
And if you really wanted to use "$data_system.words.eva" You could define it yourself. Just for future references. :)

class RPG::System::Words
  alias init_system_words_later initialize
  def initialize
    init_system_words_later
    @eva = "EVA"
  end
end