Display formula in description?

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
231
Reaction score
85
First Language
english
Primarily Uses
N/A
I googled for it and nothing came up, but...
Say I wanted to display how much damage a spell would do by using a formula in the description.
So it would look like "Does 120 damage."
But to get 120, say its the formula "100 + A.mat" and all I would have to do is type something like "Does <Formula>100 + A.mat<\Formula>.
Is there any way to do this?
 

sawworm

Sir Waste Time A Lot
Veteran
Joined
Jul 28, 2013
Messages
107
Reaction score
26
First Language
Turkish
Primarily Uses
RMVXA
From what I see on RPG games it usually goes "Fixed 120 damage." You might want to add "Fixed 120 damage + Ignores DEF" something like that.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
I have seen games where it showed the potential damage during battles. So there is a way to do it, I just don't know what script that is.
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
I wrote a practice snippet that allowed this a couple years ago. I haven't used it at all (I think it was incorporated into a larger script), but you're welcome to try it out.

Code:
module RINOBI module WinEval # DO NOT MODIFY
#==============================================================================
#                               Window Eval
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# By: Rinobi
# -----------------------------------------------------------------------------
# Allows formulas to be used within text events and help windows.
#==============================================================================
# # VERSION HISTORY
# -----------------------------------------------------------------------------
# 1.0 [07/26/2015] Completed
#-
# Details listed under 'Updates' section at the bottom of this page.
#==============================================================================
# # INSTRUCTIONS
# -----------------------------------------------------------------------------
# Use - \e< Code > - to display your formula within text and help windows.
# Where 'Code' is your custom forumla.
#-
#  a = actor  |  p = party  |  t = troop  |  v = variables  |  s = switches
#-
# \e<a.level * a.atk> - returns actor's attack value multiplied by level
#==============================================================================
# # COMPATIBILITY
# -----------------------------------------------------------------------------
# Created for use within RPG Maker VX Ace
#-
# Requirements
# 1. None
#-
# Overwrite Methods
# 1. None
#-
# Alias Methods
# 1. convert_escape_characters in Window_Base
#==============================================================================
# # TERMS OF USE
#------------------------------------------------------------------------------
# 1. Preserve this header.
# 2. Do not re-upload this script.
# 3. Do not claim this script as your own work.
# 4. Do not release modified versions of this script.
# 5. Free for use within non-commercial projects.
# 6. Free for use within commercial projects.
# 7. Credit Rinobi and/or his aliases if used.
#==============================================================================
# # END OF SETUP
# -----------------------------------------------------------------------------
# Editing beyond this line may result in undesirable side-effects.
#==============================================================================

  Note = /\eE<(.*?)>/i # Notetag Setting
 
end end # DO NOT MODIFY
#==============================================================================
# ** IMPORT SCRIPT
#------------------------------------------------------------------------------
$imported = {} if $imported.nil?    # Set imported to hash if empty.
$imported[:RIN_WinEval] = true  # Add script key to imported hash.
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a super class of all windows within the game.
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # # Alias Method: Preconvert Control Characters
  #    As a rule, replace only what will be changed into text strings before
  #    starting actual drawing. The character "\" is replaced with the escape
  #    character (\e).
  #--------------------------------------------------------------------------
  alias :evaluate_formula :convert_escape_characters
  def convert_escape_characters(text)
    result = evaluate_formula(text)
    case SceneManager.scene
    when Scene_Battle
      result.gsub!(RINOBI::WinEval::Note) {window_eval_code1($1)}
    when Scene_Skill
      result.gsub!(RINOBI::WinEval::Note) {window_eval_code2($1)}
    else
      result.gsub!(RINOBI::WinEval::Note) {window_eval_code3($1)}
    end #-
    return result
  end # convert_escape_characters
  #-----------------------------------------------------------------------------
  # # New Method: window_eval_code1
  #-----------------------------------------------------------------------------
  def window_eval_code1(formula, a = BattleManager.actor,
    p = $game_party.members, t = $game_troop.members,
    v = $game_variables, s = $game_switches)
    eval(formula)
  end # window_eval_code1
  #-----------------------------------------------------------------------------
  # # New Method: window_eval_code2
  #-----------------------------------------------------------------------------
  def window_eval_code2(formula, a = $game_party.menu_actor,
    p = $game_party.members, t = $game_troop.members,
    v = $game_variables, s = $game_switches)
    eval(formula)
  end # window_eval_code2
  #-----------------------------------------------------------------------------
  # # New Method: window_eval_code3
  #-----------------------------------------------------------------------------
  def window_eval_code3(formula, a = $game_party.leader,
    p = $game_party.members, t = $game_troop.members,
    v = $game_variables, s = $game_switches)
    eval(formula)
  end # window_eval_code2
end # Window_Base < Window
#==============================================================================
# # UPDATES
# -----------------------------------------------------------------------------
# None yet.
#==============================================================================
# # AUTHOR'S NOTES
# -----------------------------------------------------------------------------
# Nothing yet.
#==============================================================================
# @@@@@  @   @  @@@@    @@@@@  @@@@@   @@@@@  @@@@@  @@@@   @@@@@  @@@@@  @@@@@
# @      @@  @  @   @   @   @  @       @      @      @   @    @    @   @    @ 
# @@@@@  @ @ @  @   @   @   @  @@@@    @@@@@  @      @@@@     @    @@@@@    @ 
# @      @  @@  @   @   @   @  @           @  @      @  @     @    @        @ 
# @@@@@  @   @  @@@@    @@@@@  @       @@@@@  @@@@@  @   @  @@@@@  @        @ 
#==============================================================================

I didn't release it because I recall it being quite similar to an existing script... though I don't remember the name or author of said script.
 
Last edited:

Morpheus

Jack-of-Trades
Veteran
Joined
Mar 14, 2012
Messages
231
Reaction score
85
First Language
english
Primarily Uses
N/A
A wrote a practice snippet that allowed this a couple years ago. I haven't used it at all (I think it was incorporated into a larger script), but you're welcome to try it out.

Code:
module RINOBI module WinEval # DO NOT MODIFY
#==============================================================================
#                               Window Eval
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# By: Rinobi
# -----------------------------------------------------------------------------
# Allows formulas to be used within text events and help windows.
#==============================================================================
# # VERSION HISTORY
# -----------------------------------------------------------------------------
# 1.0 [07/26/2015] Completed
#-
# Details listed under 'Updates' section at the bottom of this page.
#==============================================================================
# # INSTRUCTIONS
# -----------------------------------------------------------------------------
# Use - \e< Code > - to display your formula within text and help windows.
# Where 'Code' is your custom forumla.
#-
#  a = actor  |  p = party  |  t = troop  |  v = variables  |  s = switches
#-
# \e<a.level * a.atk> - returns actor's attack value multiplied by level
#==============================================================================
# # COMPATIBILITY
# -----------------------------------------------------------------------------
# Created for use within RPG Maker VX Ace
#-
# Requirements
# 1. None
#-
# Overwrite Methods
# 1. None
#-
# Alias Methods
# 1. convert_escape_characters in Window_Base
#==============================================================================
# # TERMS OF USE
#------------------------------------------------------------------------------
# 1. Preserve this header.
# 2. Do not re-upload this script.
# 3. Do not claim this script as your own work.
# 4. Do not release modified versions of this script.
# 5. Free for use within non-commercial projects.
# 6. Free for use within commercial projects.
# 7. Credit Rinobi and/or his aliases if used.
#==============================================================================
# # END OF SETUP
# -----------------------------------------------------------------------------
# Editing beyond this line may result in undesirable side-effects.
#==============================================================================

  Note = /\eE<(.*?)>/i # Notetag Setting
 
end end # DO NOT MODIFY
#==============================================================================
# ** IMPORT SCRIPT
#------------------------------------------------------------------------------
$imported = {} if $imported.nil?    # Set imported to hash if empty.
$imported[:RIN_WinEval] = true  # Add script key to imported hash.
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a super class of all windows within the game.
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # # Alias Method: Preconvert Control Characters
  #    As a rule, replace only what will be changed into text strings before
  #    starting actual drawing. The character "\" is replaced with the escape
  #    character (\e).
  #--------------------------------------------------------------------------
  alias :evaluate_formula :convert_escape_characters
  def convert_escape_characters(text)
    result = evaluate_formula(text)
    case SceneManager.scene
    when Scene_Battle
      result.gsub!(RINOBI::WinEval::Note) {window_eval_code1($1)}
    when Scene_Skill
      result.gsub!(RINOBI::WinEval::Note) {window_eval_code2($1)}
    else
      result.gsub!(RINOBI::WinEval::Note) {window_eval_code3($1)}
    end #-
    return result
  end # convert_escape_characters
  #-----------------------------------------------------------------------------
  # # New Method: window_eval_code1
  #-----------------------------------------------------------------------------
  def window_eval_code1(formula, a = BattleManager.actor,
    p = $game_party.members, t = $game_troop.members,
    v = $game_variables, s = $game_switches)
    eval(formula)
  end # window_eval_code1
  #-----------------------------------------------------------------------------
  # # New Method: window_eval_code2
  #-----------------------------------------------------------------------------
  def window_eval_code2(formula, a = $game_party.menu_actor,
    p = $game_party.members, t = $game_troop.members,
    v = $game_variables, s = $game_switches)
    eval(formula)
  end # window_eval_code2
  #-----------------------------------------------------------------------------
  # # New Method: window_eval_code3
  #-----------------------------------------------------------------------------
  def window_eval_code3(formula, a = $game_party.leader,
    p = $game_party.members, t = $game_troop.members,
    v = $game_variables, s = $game_switches)
    eval(formula)
  end # window_eval_code2
end # Window_Base < Window
#==============================================================================
# # UPDATES
# -----------------------------------------------------------------------------
# None yet.
#==============================================================================
# # AUTHOR'S NOTES
# -----------------------------------------------------------------------------
# Nothing yet.
#==============================================================================
# @@@@@  @   @  @@@@    @@@@@  @@@@@   @@@@@  @@@@@  @@@@   @@@@@  @@@@@  @@@@@
# @      @@  @  @   @   @   @  @       @      @      @   @    @    @   @    @ 
# @@@@@  @ @ @  @   @   @   @  @@@@    @@@@@  @      @@@@     @    @@@@@    @ 
# @      @  @@  @   @   @   @  @           @  @      @  @     @    @        @ 
# @@@@@  @   @  @@@@    @@@@@  @       @@@@@  @@@@@  @   @  @@@@@  @        @ 
#==============================================================================

I didn't release it because I recall it being quite similar to an existing script... though I don't remember the name or author of said script.
Dude, you are so amazing. Thank you SO much!!! It works perfectly!!!
 

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

Latest Threads

Latest Posts

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,986
Members
137,561
Latest member
visploo100
Top