RPG Maker Forums

For formulas and conditions, say having it so that if a damage formula with modifiers included exceeds a certain damage, there's a chance of stunning the target, among other things, there are two modifiers from 2 scripts that I don't know how to find for formulas.

I'm looking for something like

b.effectiveness("SKILL", 200, "EFFECT")

meaning the effectiveness rate of Skill 200 against the target, from this script:

 #==============================================================================# ** Victor Engine - Action Effectiveness#------------------------------------------------------------------------------# Author : Victor Sant## Version History:# v 1.00 - 2012.01.16 > First release# v 1.01 - 2012.07.12 > Action restrictions moved to another script# > Compatibility with Element States# v 1.02 - 2012.07.13 > Compatibility with Action Restriction# v 1.03 - 2013.01.24 > Fixed issue with skill use and item use rate# v 1.04 - 2013.02.13 > Compatibility with Toggle Target#------------------------------------------------------------------------------# This script allows to set the rate of effectivess of actions based on# the user or target.#------------------------------------------------------------------------------# Compatibility# Requires the script 'Victor Engine - Basic Module' v 1.35 or higher## * Overwrite methods# class Game_Battler < Game_BattlerBase# def item_effect_add_state_attack(user, item, effect)# def item_effect_add_state_normal(user, item, effect)# def item_effect_remove_state(user, item, effect)# def item_effect_add_debuff(user, item, effect)## class Scene_ItemBase < Scene_MenuBase# def user## * Alias methods# class Game_Battler < Game_BattlerBase# def item_value_recover_hp(user, item, effect)# def item_value_recover_mp(user, item, effect)# def item_value_gain_tp(user, item, effect)# def item_hit(user, item)# def make_damage_value(user, item)##------------------------------------------------------------------------------# Instructions:# To install the script, open you script editor and paste this script on# a new section bellow the Materials section. This script must also# be bellow the script 'Victor Engine - Basic'##------------------------------------------------------------------------------# Actors, Classes, Enemies, States, Weapons and Armors note tags:# Tags to be used on the Actors, Classes, Enemies, States, Weapons and Armors # note box in the database## <skill use effectiveness x: y%> <item use effectiveness x: y%> # The actions will have it's effectiveness (damage or success chance) changed# by y% when used by a battler with this attribute# x = item or skill ID# y = effectiveness rate## <skill effect effectiveness x: y%> <item effect effectiveness x: y%> # The actions will have it's effectiveness (damage or success chance) changed# by y% when targeting a battler with this attribute# x = item or skill ID# y = effectiveness rate##==============================================================================#==============================================================================# ** Victor Engine#------------------------------------------------------------------------------# Setting module for the Victor Engine#==============================================================================module Victor_Engine #-------------------------------------------------------------------------- # * required # This method checks for the existance of the basic module and other # VE scripts required for this script to work, don't edit this #-------------------------------------------------------------------------- def self.required(name, req, version, type = nil) if !$imported[:ve_basic_module] msg = "The script '%s' requires the script\n" msg += "'VE - Basic Module' v%s or higher above it to work properly\n" msg += "Go to http://victorscripts.wordpress.com/ to download this script." msgbox(sprintf(msg, self.script_name(name), version)) exit else self.required_script(name, req, version, type) end end #-------------------------------------------------------------------------- # * script_name # Get the script name base on the imported value, don't edit this #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") endend$imported ||= {}$imported[:ve_action_effectiveness] = 1.04Victor_Engine.required:)ve_action_effectiveness, :ve_basic_module, 1.35, :above)Victor_Engine.required:)ve_action_effectiveness, :ve_element_states, 1.00, :bellow)Victor_Engine.required:)ve_action_effectiveness, :ve_action_restriction, 1.00, :bellow)#==============================================================================# ** Game_Battler#------------------------------------------------------------------------------# This class deals with battlers. It's used as a superclass of the Game_Actor# and Game_Enemy classes.#==============================================================================class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Overwrite method: item_effect_recover_hp #-------------------------------------------------------------------------- alias :item_value_recover_hp_ve_action_effectiveness :item_value_recover_hp def item_value_recover_hp(user, item, effect) value = item_value_recover_hp_ve_action_effectiveness(user, item, effect) value * effectiveness(user, item) end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_recover_mp #-------------------------------------------------------------------------- alias :item_value_recover_mp_ve_action_effectiveness :item_value_recover_mp def item_value_recover_mp(user, item, effect) value = item_value_recover_mp_ve_action_effectiveness(user, item, effect) value * effectiveness(user, item) end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_recover_yp #-------------------------------------------------------------------------- alias :item_value_recover_tp_ve_action_effectiveness :item_value_recover_tp def item_value_recover_tp(user, item, effect) value = item_value_recover_tp_ve_action_effectiveness(user, item, effect) value * effectiveness(user, item) end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_add_state_normal #-------------------------------------------------------------------------- def item_effect_add_state_normal(user, item, effect) chance = effect.value1 chance *= effectiveness(user, item) chance *= state_rate(effect.data_id) if opposite?(user) chance *= luk_effect_rate(user) if opposite?(user) if rand < chance add_state(effect.data_id) @result.success = true end end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_remove_state #-------------------------------------------------------------------------- def item_effect_remove_state(user, item, effect) chance = effect.value1 chance *= effectiveness(user, item) if rand < chance remove_state(effect.data_id) @result.success = true end end #-------------------------------------------------------------------------- # * Overwrite method: item_effect_add_debuff #-------------------------------------------------------------------------- def item_effect_add_debuff(user, item, effect) chance = debuff_rate(effect.data_id) * luk_effect_rate(user) chance *= effectiveness(user, item) if rand < chance add_debuff(effect.data_id, effect.value1) @result.success = true end end #-------------------------------------------------------------------------- # * Alias method: item_hit #-------------------------------------------------------------------------- alias :item_hit_ve_action_effectiveness :item_hit def item_hit(user, item) rate = item_hit_ve_action_effectiveness(user, item) rate *= effectiveness(user, item) rate end #-------------------------------------------------------------------------- # * Alias method: make_damage_value #-------------------------------------------------------------------------- alias :make_damage_value_ve_action_effectiveness :make_damage_value def make_damage_value(user, item) @effectiveness_rate = effectiveness(user, item) make_damage_value_ve_action_effectiveness(user, item) end #-------------------------------------------------------------------------- # * Alias method: apply_guard #-------------------------------------------------------------------------- alias :apply_guard_all_ve_action_effectiveness :apply_guard def apply_guard(damage) damage = apply_guard_all_ve_action_effectiveness(damage) damage *= @effectiveness_rate damage end #-------------------------------------------------------------------------- # * New method: effectiveness #-------------------------------------------------------------------------- def effectiveness(user, item) value = 1.0 value *= user.get_effectiveness(item, "USE") value *= self.get_effectiveness(item, "EFFECT") value end #-------------------------------------------------------------------------- # * New method: get_effectiveness #-------------------------------------------------------------------------- def get_effectiveness(item, type) action = item.skill? ? "SKILL" : "ITEM" regexp = /<#{action} #{type} EFFECTIVENESS #{item.id}: *(\d+)%?>/i get_all_notes.scan(regexp).inject(1.0) {|r, i| r *= i.first.to_f / 100.0 } endend#==============================================================================# ** Scene_ItemBase#------------------------------------------------------------------------------# This is the superclass for the classes that performs the item and skill# screens.#==============================================================================class Scene_ItemBase < Scene_MenuBase #-------------------------------------------------------------------------- # * Overwrite method: user #-------------------------------------------------------------------------- def user users = $game_party.movable_members.select {|member| member.usable?(item)} users.max_by {|member| item_modifier(member, item) } end #-------------------------------------------------------------------------- # * New method: item_modifier #-------------------------------------------------------------------------- def item_modifier(member, item) value = member.pha value *= member.effectiveness(member, item) value endend 
and something like

a.action_strengthen("ITEM", 1)

meaning the strength of the user's usage of item 1 on a target, from the script:

#==============================================================================# ** Victor Engine - Action Strengthen#------------------------------------------------------------------------------# Author : Victor Sant## Version History:# v 1.00 - 2012.07.16 > First release# v 1.01 - 2013.02.13 > Fixed issue with item effects#------------------------------------------------------------------------------# This script allows to setup a trait that change the power of actions based# on the actions or their type. You can make equipment that strengthen specific# skills or an whole skill type.#------------------------------------------------------------------------------# Compatibility# Requires the script 'Victor Engine - Basic Module' v 1.35 or higher# If used with 'Victor Engine - Animated Battle' place this bellow it.# If used with 'Victor Engine - Element Set' place this bellow it.## * Alias methods (Default)# class Game_Battler < Game_BattlerBase# def item_value_recover_hp(user, item, effect)# def item_value_recover_mp(user, item, effect)# def item_value_gain_tp(user, item, effect)# def item_element_rate(user, item)##------------------------------------------------------------------------------# Instructions:# To instal the script, open you script editor and paste this script on# a new section bellow the Materials section. This script must also# be bellow the script 'Victor Engine - Basic'##------------------------------------------------------------------------------# Actors, Classes, Enemies, Weapons, Armors and States note tags:# Tags to be used on Actors, Classes, Enemies, Weapons, Armors and States# note boxes.## <skill strengthen x: +y%> <item strengthen x: +y%># <skill strengthen x: -y%> <item strengthen x: -y%># Setup the skill or item and a rate of strengthen for that action# x : ID of the skill or item# y : strengthen rate## <skill type strengthen x: +y%> <item type strengthen x: +y%># <skill type strengthen x: -y%> <item type strengthen x: -y%># Setup the skill or item type and a rate of strengthen for that actions# x : ID of the skill type or item type# y : strengthen rate# #==============================================================================#==============================================================================# ** Victor Engine#------------------------------------------------------------------------------# Setting module for the Victor Engine#==============================================================================module Victor_Engine #-------------------------------------------------------------------------- # * required # This method checks for the existance of the basic module and other # VE scripts required for this script to work, don't edit this #-------------------------------------------------------------------------- def self.required(name, req, version, type = nil) if !$imported[:ve_basic_module] msg = "The script '%s' requires the script\n" msg += "'VE - Basic Module' v%s or higher above it to work properly\n" msg += "Go to http://victorscripts.wordpress.com/ to download this script." msgbox(sprintf(msg, self.script_name(name), version)) exit else self.required_script(name, req, version, type) end end #-------------------------------------------------------------------------- # * script_name # Get the script name base on the imported value #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") endend$imported ||= {}$imported[:ve_action_strengthen] = 1.01Victor_Engine.required:)ve_action_strengthen, :ve_basic_module, 1.35, :above)#==============================================================================# ** Game_Battler#------------------------------------------------------------------------------# This class deals with battlers. It's used as a superclass of the Game_Actor# and Game_Enemy classes.#==============================================================================class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Alias method: item_effect_recover_hp #-------------------------------------------------------------------------- alias :item_value_recover_hp_ve_action_strengthen :item_value_recover_hp def item_value_recover_hp(user, item, effect) value = item_value_recover_hp_ve_action_strengthen(user, item, effect) value *= user.action_strengthen(item) end #-------------------------------------------------------------------------- # * Alias method: item_effect_recover_mp #-------------------------------------------------------------------------- alias :item_value_recover_mp_ve_action_strengthen :item_value_recover_mp def item_value_recover_mp(user, item, effect) value = item_value_recover_mp_ve_action_strengthen(user, item, effect) value *= user.action_strengthen(item) end #-------------------------------------------------------------------------- # * Alias method: item_effect_recover_tp #-------------------------------------------------------------------------- alias :item_value_recover_tp_ve_action_strengthen :item_value_recover_tp def item_value_recover_tp(user, item, effect) value = item_value_recover_tp_ve_action_strengthen(user, item, effect) value *= user.action_strengthen(item) end #-------------------------------------------------------------------------- # * Alias method: item_element_rate #-------------------------------------------------------------------------- alias :item_element_rate_ve_action_strengthen :item_element_rate def item_element_rate(user, item) result = item_element_rate_ve_action_strengthen(user, item) result * user.action_strengthen(item) end #-------------------------------------------------------------------------- # * New method: action_strengthen #-------------------------------------------------------------------------- def action_strengthen(item) [1.0 + item_strengthen(item) + item_type_strengthen(item), 0].max end #-------------------------------------------------------------------------- # * New method: item_strengthen #-------------------------------------------------------------------------- def item_strengthen(item) get_action_strengthen(item.skill? ? "SKILL" : "ITEM", item.id) end #-------------------------------------------------------------------------- # * New method: item_type_strengthen #-------------------------------------------------------------------------- def item_type_strengthen(item) type = item.skill? ? "SKILL TYPE" : "ITEM TYPE" item.type_set.inject(0.0) {|r, i| r += get_action_strengthen(type, i) } end #-------------------------------------------------------------------------- # * New method: get_action_strengthen #-------------------------------------------------------------------------- def get_action_strengthen(type, id) regexp = /<#{type} STRENGTHEN #{id}: ([+-]?\d+)%?>/i get_all_notes.scan(regexp).inject(0.0) {|r| r += ($1.to_i / 100.0) } endend 
For reference, I know that for this following script, a.element_strengthen([3]) is the vocab meaning the user's Fire strength, and the scripts are done pretty similar--

#==============================================================================# ** Victor Engine - Element Strengthen#------------------------------------------------------------------------------# Author : Victor Sant## Version History:# v 1.00 - 2012.07.03 > First relase# v 1.01 - 2013.02.13 > Fixed issue with item effects#------------------------------------------------------------------------------# This script allows to setup a trait that change the power of actions based# on their elements. You can make the fire rod increase the power of fire based # spells.#------------------------------------------------------------------------------# Compatibility# Requires the script 'Victor Engine - Basic Module' v 1.35 or higher# If used with 'Victor Engine - Animated Battle' place this bellow it.# If used with 'Victor Engine - Element Set' place this bellow it.## * Alias methods (Default)# class Game_Battler < Game_BattlerBase# def item_value_recover_hp(user, item, effect)# def item_value_recover_mp(user, item, effect)# def item_value_gain_tp(user, item, effect)# def item_element_rate(user, item)##------------------------------------------------------------------------------# Instructions:# To install the script, open you script editor and paste this script on# a new section bellow the Materials section. This script must also# be bellow the script 'Victor Engine - Basic'##------------------------------------------------------------------------------# Actors, Classes, Enemies, Weapons, Armors and States note tags:# Tags to be used on Actors, Classes, Enemies, Weapons, Armors and States# note boxes.## <element strengthen x: +y%># <element strengthen x: -y%># Setup the element and a percent value of change in power# x : ID of the element# y : amount of change in element power# #==============================================================================#==============================================================================# ** Victor Engine#------------------------------------------------------------------------------# Setting module for the Victor Engine#==============================================================================module Victor_Engine #-------------------------------------------------------------------------- # * Set how multiple element strengthen will be calculated # Choose here how the elemental strengthen will be calculated when handling # multiples values # :highest : use the highest value (default behavior) # :addition : sum of all values # :average : average of all values # :multiply : multiply all values #-------------------------------------------------------------------------- VE_RESIST_ADDITION_TYPE = :highest #-------------------------------------------------------------------------- # * required # This method checks for the existance of the basic module and other # VE scripts required for this script to work, don't edit this #-------------------------------------------------------------------------- def self.required(name, req, version, type = nil) if !$imported[:ve_basic_module] msg = "The script '%s' requires the script\n" msg += "'VE - Basic Module' v%s or higher above it to work properly\n" msg += "Go to http://victorscripts.wordpress.com/ to download this script." msgbox(sprintf(msg, self.script_name(name), version)) exit else self.required_script(name, req, version, type) end end #-------------------------------------------------------------------------- # * script_name # Get the script name base on the imported value #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") endend$imported ||= {}$imported[:ve_element_strengthen] = 1.01Victor_Engine.required:)ve_element_strengthen, :ve_basic_module, 1.35, :above)#==============================================================================# ** Game_Battler#------------------------------------------------------------------------------# This class deals with battlers. It's used as a superclass of the Game_Actor# and Game_Enemy classes.#==============================================================================class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Alias method: item_effect_recover_hp #-------------------------------------------------------------------------- alias :item_value_recover_hp_ve_action_strengthen :item_value_recover_hp def item_value_recover_hp(user, item, effect) value = item_value_recover_hp_ve_action_strengthen(user, item, effect) value * user.element_strengthen(user.element_set(item)) end #-------------------------------------------------------------------------- # * Alias method: item_effect_recover_mp #-------------------------------------------------------------------------- alias :item_value_recover_mp_ve_action_strengthen :item_value_recover_mp def item_value_recover_mp(user, item, effect) value = item_value_recover_mp_ve_action_strengthen(user, item, effect) value * user.element_strengthen(user.element_set(item)) end #-------------------------------------------------------------------------- # * Alias method: item_effect_recover_tp #-------------------------------------------------------------------------- alias :item_value_recover_tp_ve_action_strengthen :item_value_recover_tp def item_value_recover_tp(user, item, effect) value = item_value_recover_tp_ve_action_strengthen(user, item, effect) value * user.element_strengthen(user.element_set(item)) end #-------------------------------------------------------------------------- # * Alias method: item_element_rate #-------------------------------------------------------------------------- alias :item_element_rate_ve_element_strengthen :item_element_rate def item_element_rate(user, item) result = item_element_rate_ve_element_strengthen(user, item) result * user.element_strengthen(user.element_set(item)) end #-------------------------------------------------------------------------- # * New method: element_strengthen #-------------------------------------------------------------------------- def element_strengthen(elements) case VE_RESIST_ADDITION_TYPE when :addition then addition_element_strengthen(elements) when :average then average_element_strengthen(elements) when :multiply then multiply_element_strengthen(elements) else highest_element_strengthen(elements) end end #-------------------------------------------------------------------------- # * New method: highest_element_strengthen #-------------------------------------------------------------------------- def highest_element_strengthen(elements) result = elements.inject([]) {|r, i| r += get_element_strengthen(i) } result.inject([1.0]) {|r, i| r.push(i + 1.0) }.max end #-------------------------------------------------------------------------- # * New method: addition_element_strengthen #-------------------------------------------------------------------------- def addition_element_strengthen(elements) result = elements.inject([]) {|r, i| r += get_element_strengthen(i) } result.inject([1.0]) {|r, i| r.push(i) }.sum end #-------------------------------------------------------------------------- # * New method: average_element_strengthen #-------------------------------------------------------------------------- def average_element_strengthen(elements) result = elements.inject([]) {|r, i| r += get_element_strengthen(i) } result.inject([]) {|r, i| r.push(i) }.average + 1.0 end #-------------------------------------------------------------------------- # * New method: multiply_element_strengthen #-------------------------------------------------------------------------- def multiply_element_strengthen(elements) result = elements.inject([]) {|r, i| r += get_element_strengthen(i) } result.inject(1.0) {|r, i| r *= i + 1.0 } end #-------------------------------------------------------------------------- # * New method: get_element_strengthen #-------------------------------------------------------------------------- def get_element_strengthen(id) regexp = /<ELEMENT STRENGTHEN #{id}: ([+-]?\d+)%?>/i list = get_all_notes.scan(regexp).collect {|i| i.first.to_i / 100.0 } endend 
The scripter is pretty inactive nowadays.

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top