Últimos temas
» ir a un punto de la pagina de evento.por KRiZaLiD Ayer a las 11:56 pm
» menú selección de personaje con variables mv
por KRiZaLiD Dom Ene 24, 2021 9:43 pm
» Laminación: Al otro lado de la brecha (NUEVO PROYECTO)
por Pocari Dom Ene 24, 2021 7:51 pm
» [VX/ACE/MV] 243 Battlers VX y ACE en modo lateral
por cuch0 Miér Ene 20, 2021 6:37 am
» Imagen de fondo sobre el mapeado (MV/MZ)
por KRiZaLiD Miér Ene 20, 2021 12:31 am
» pasar dialogos automaticamente
por KRiZaLiD Miér Ene 20, 2021 12:26 am
» [Demo/MV/Inglés] Vala
por The Ferydra Dom Ene 17, 2021 10:32 pm
» El viaje de Seymour [Juego completo]
por DiegoRivo10 Vie Ene 15, 2021 8:59 pm
» Huida hacia adelante (Html5, windows y android) JUEGO COMPLETO
por DiegoRivo10 Vie Ene 15, 2021 8:56 pm
» Un par de dudas sobre RPG Maker MV
por fran0090 Miér Ene 13, 2021 12:04 am
» TALES FROM GALIAN
por DiegoRivo10 Mar Ene 12, 2021 1:06 am
» Isekai Proyect
por JACK223 Lun Ene 11, 2021 2:27 am
Problema con Contra-Ataque
Página 1 de 1.
Problema con Contra-Ataque
Soy yo o esta habilidad viene mal programada de por sí en el RPG Maker? Vaaaaarias veces me han dado problemas esta habilidad, junto con la de Espejo (Reflejar magia), en donde a veces uno usa un ataque que golpea al enemigo varias veces, por ejemplo, cinco veces, y el enemigo puede contraatacar. Pero por ejemplo, si el atacante (con poca vida) ataca la primera vez, acierta, la segunda vez, acierta, la tercera vez, recibe un contraataque y lo mata, a mi me pasan dos cosas.
1) O salta un error que crashea todo en :Nil
2) El personaje muere pero aun asi golpea las otras 2 veces restantes (a pesar de que el personaje ya está muerto)
esto me pasa con la habilidad que viene por defecto en el Maker, que es la de poner un estado de contraataque con un parametro especial de % de ataques contraatacados. Es bastante molesto porque es bastante impredecible o por lo menos en mi caso, tan así que hasta he pensado eliminar esa habilidad de mi juego...
Alguien más experimenta algo similar con esta habilidad? Alguna solucion?
1) O salta un error que crashea todo en :Nil
2) El personaje muere pero aun asi golpea las otras 2 veces restantes (a pesar de que el personaje ya está muerto)
esto me pasa con la habilidad que viene por defecto en el Maker, que es la de poner un estado de contraataque con un parametro especial de % de ataques contraatacados. Es bastante molesto porque es bastante impredecible o por lo menos en mi caso, tan así que hasta he pensado eliminar esa habilidad de mi juego...
Alguien más experimenta algo similar con esta habilidad? Alguna solucion?
Er1ck_92- PJ Recurrente
-
RPG Maker :
Mensajes : 76
Monedas : 132
Reputación : 6
Re: Problema con Contra-Ataque
Holas loco, mira busque por ahi y encontre este fix via script. En teoria arregla lo del crash y ademas te da la opcion para que edites si quieres que el contraataque sea X veces dependiendo del ataque que utilizaron contra ti o lo que sea o si quieres que sea 1 solo golpe, dentro de la seccion editable del script esta la parte esa para editar, donde pone Keep_Time = false o true.
Por lo demas te digo que no lo eh probado por lo que no se su funcion exacta, pero espero te sea de ayuda ^^.
Ahi te va la cosa:
Todos los creditos a DoubleX remember xD.
Saluuuuuudos
Por lo demas te digo que no lo eh probado por lo que no se su funcion exacta, pero espero te sea de ayuda ^^.
Ahi te va la cosa:
- Código:
#==============================================================================|
# ** DoubleX RMVXA Counterattack Edit v1.05a |
#------------------------------------------------------------------------------|
# * Changelog |
# v1.05a(GMT 0200 5-7-2014): |
# - Allows users to keep counterattack skill's animations, scopes and times |
# - Compatible with DoubleX RMVXA Substitute Edit |
# v1.04a(GMT 2300 1-4-2014): |
# - Allows users to set actor's counterattack skill needs to be learnt |
# v1.03a(GMT 0900 18-3-2014): |
# - Allows users to set whether counterattack negates hits |
# v1.02a(GMT 0000 14-2-2014): |
# - Allows users to set whether counterattack messages will be shown |
# v1.01b(GMT 0900 16-1-2014): |
# - Fixed a & b bug in damage formula of counterattack skills |
# v1.01a(GMT 1000 15-1-2014): |
# - Allows users to set whether magic evasion invokes counterattack |
# v1.00a(GMT 0400 5-1-2014): |
# - 1st version of this script finished |
#------------------------------------------------------------------------------|
# * Author |
# DoubleX |
#------------------------------------------------------------------------------|
# * Terms of use |
# None other than not claiming this script as created by anyone except |
# DoubleX or his alias |
#------------------------------------------------------------------------------|
# * Prerequisites |
# Scripts: |
# - none |
# Knowledge: |
# - Use of notetags |
#------------------------------------------------------------------------------|
# * Functions |
# - Allows users to alter the skills used in counterattack |
#------------------------------------------------------------------------------|
# * Manual |
# To use this script, open the script editor and put this script into an |
# open slot between ▼ Materials and ▼ Main. Save to take effect. |
#------------------------------------------------------------------------------|
# * Compatibility |
# Scripts rewriting Vocab CounterAttack or aliasing or rewriting method: |
# - item_cnt or item_apply under class Game_Battler |
# - display_counter under class Window_BattleLog |
# - apply_item_effects and invoke_counter_attack under class Scene_Battle |
# may have compatibility issues with this script |
# Place this script above those aliasing any of these method if possible |
#==============================================================================|
$imported = {} if $imported.nil?
$imported["DoubleX RMVXA Counterattack Edit"] = true
#------------------------------------------------------------------------------|
# * (v1.01a+)Notetag <mev invoke cnt> for actors, classes, equips, enemies and|
# states: |
# To set a battler having chance based on his/her/its CNT to invoke |
# counterattack upon successful magic evasion, put the above notetag into |
# the related actor's, class's, equip's, enemy's or state's notebox in the |
# database. |
#------------------------------------------------------------------------------|
# * Notetag <counterattack skill: x> for actors(1), classes(2), equips(3), |
# enemies(1) and states(4):(the larger the number, the higher the priority) |
# To alter a battler's counterattack skill's id to x, put the above notetag |
# into the related actor's, class's, equip's, enemy's or state's notebox in |
# the database. |
#------------------------------------------------------------------------------|
#==============================================================================|
# ** You only need to edit this part as it's about what this script does |
#------------------------------------------------------------------------------|
module DoubleX_RMVXA
module Counterattack_Edit
#------------------------------------------------------------------------------|
# * (v1.05a+)Keep_Ani, default = false |
# If Keep_Ani is true, the counterattack skill's animations will be played |
# when the counterattack's invoked |
#------------------------------------------------------------------------------|
Keep_Ani = false
#------------------------------------------------------------------------------|
# * (v1.05a+)Keep_Scope, default = false |
# If Keep_Scope is true, the counterattack skill's scope will stay intact, |
# otherwise it'll only target the one attacked that battler |
#------------------------------------------------------------------------------|
Keep_Scope = false
#------------------------------------------------------------------------------|
# * (v1.05a+)Keep_Times, default = false |
# If Keep_Scope is true, the counterattack skill's repeats will stay intact,|
# otherwise it'll be 1 |
#------------------------------------------------------------------------------|
Keep_Times = false
#------------------------------------------------------------------------------|
# * (v1.04a+)Actor_Learn_Counterattack_Skill, default = false |
# If Actor_Learn_Counterattack_Skill is true and an actor hasn't learnt the |
# counterattack skill, Default_Counterattack will be that actor's skill |
#------------------------------------------------------------------------------|
Actor_Learn_Counterattack_Skill = false
#------------------------------------------------------------------------------|
# * (v1.03a+)CNT_Negate_Hit, default = true |
# Normal physical hit and damage determinations will take place before that |
# of CNT if CNT_Negate_Hit is false |
#------------------------------------------------------------------------------|
CNT_Negate_Hit = true
#------------------------------------------------------------------------------|
# * (v1.02a+)COUNTERATTACK_MESSAGE, default = true |
# Counterattack messages won't be shown if COUNTERATTACK_MESSAGE is false |
#------------------------------------------------------------------------------|
COUNTERATTACK_MESSAGE = true
#------------------------------------------------------------------------------|
# * (v1.01a+)MEV_Invoke_CNT, default = false |
# Successful magic evasion invokes counterattack with chance based on CNT if|
# MEV_Invoke_CNT is true, even when <mev invoke cnt> notetags are absent |
#------------------------------------------------------------------------------|
MEV_Invoke_CNT = false
#------------------------------------------------------------------------------|
# * Default_Counterattack, default = 1 |
# The counterattack skill of a battler will be the one's id equal to |
# Default_Counterattack if he/she/it doesn't have any notetag |
#------------------------------------------------------------------------------|
Default_Counterattack = 1
end # Counterattack_Edit
end # DoubleX_RMVXA
#==============================================================================|
#==============================================================================|
# ** You need not edit this part as it's about how this script works |
#------------------------------------------------------------------------------|
module DoubleX_RMVXA
module REGEXP
module BASEITEM
COUNTERATTACK_SKILL = /<(?:COUNTERATTACK_SKILL|counterattack skill):[ ]*(\d+)>/i
MEV_INVOKE_CNT = /<(?:MEV_INVOKE_CNT|mev invoke cnt)>/i
end # BASEITEM
end # REGEXP
end # DoubleX_RMVXA
module Vocab
CounterAttack = "%s countered with %s!"
end # Vocab
module DataManager
#----------------------------------------------------------------------------|
# Alias method: self.load_database |
#----------------------------------------------------------------------------|
class <<self; alias load_database_counterattack_edit load_database; end
def self.load_database
load_database_counterattack_edit
# This part is added by this script to load notetags
load_notetags_counterattack_edit
#
end # self.load_database
#----------------------------------------------------------------------------|
# New method: self.load_notetags_counterattack_edit |
#----------------------------------------------------------------------------|
def self.load_notetags_counterattack_edit
groups = [$data_actors, $data_classes, $data_enemies, $data_weapons, $data_armors, $data_states]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_counterattack_edit
end
end
end # self.load_notetags_counterattack_edit
end # DataManager
class RPG::BaseItem
#----------------------------------------------------------------------------|
# New public instance variables |
#----------------------------------------------------------------------------|
attr_accessor :counterattack_skill
attr_accessor :mev_invoke_cnt
#----------------------------------------------------------------------------|
# New common cache: load_notetags_counterattack_edit |
#----------------------------------------------------------------------------|
def load_notetags_counterattack_edit
@counterattack_skill = DoubleX_RMVXA::Counterattack_Edit::Default_Counterattack
@mev_invoke_cnt = DoubleX_RMVXA::Counterattack_Edit::MEV_Invoke_CNT
self.note.split(/[\r\n]+/).each { |line|
case line
when DoubleX_RMVXA::REGEXP::BASEITEM::COUNTERATTACK_SKILL
@counterattack_skill = $1.to_i
when DoubleX_RMVXA::REGEXP::BASEITEM::MEV_INVOKE_CNT
@mev_invoke_cnt = true
end
}
end # load_notetags_counterattack_edit
end # RPG::BaseItem
class Game_Battler < Game_BattlerBase
#----------------------------------------------------------------------------|
# (v1.03a+)Alias method: item_cnt |
#----------------------------------------------------------------------------|
alias item_cnt_counterattack_edit item_cnt
def item_cnt(user, item)
# This part is rewritten by this script to negate hit upon CNT if CNT_Negate_Hit is true
DoubleX_RMVXA::Counterattack_Edit::CNT_Negate_Hit ? item_cnt_counterattack_edit(user, item) : 0
#
end
#----------------------------------------------------------------------------|
# (v1.01a+)Alias method: item_apply |
#----------------------------------------------------------------------------|
alias item_apply_counterattack_edit item_apply
def item_apply(user, item)
item_apply_counterattack_edit(user, item)
# This part is added by this script to invoke cnt upon mev if MEV_Invoke_CNT is true
@result.evaded && item.magical? && rand < cnt ? @invoke_counter_attack = true : @invoke_counter_attack = false
#
end # item_apply
#----------------------------------------------------------------------------|
# (v1.01a+)New method: invoke_counter_attack? |
#----------------------------------------------------------------------------|
def invoke_counter_attack?
@invoke_counter_attack
end # invoke_counter_attack?
#----------------------------------------------------------------------------|
# (v1.01a+)New method: mev_invoke_cnt? |
#----------------------------------------------------------------------------|
def mev_invoke_cnt?
self.states.each { |state|
return true if state.mev_invoke_cnt
}
if self.actor?
if self.equips
self.equips.each { |equip|
return true if equip && equip.mev_invoke_cnt
}
end
return true if self.class.mev_invoke_cnt
return self.actor.mev_invoke_cnt
end
return self.enemy.mev_invoke_cnt if self.enemy?
end # mev_invoke_cnt?
#----------------------------------------------------------------------------|
# New method: counterattack_skill_id |
#----------------------------------------------------------------------------|
def counterattack_skill_id
skill_counterattack = DoubleX_RMVXA::Counterattack_Edit::Default_Counterattack
self.states.each { |state|
skill_counterattack = state.counterattack_skill if self.actor? && (!DoubleX_RMVXA::Counterattack_Edit::Actor_Learn_Counterattack_Skill || self.skill_learn?($data_skills[state.counterattack_skill])) || self.enemy?
}
return skill_counterattack if skill_counterattack != DoubleX_RMVXA::Counterattack_Edit::Default_Counterattack
if self.actor?
if self.equips
self.equips.each { |equip|
skill_counterattack = equip.counterattack_skill if equip && (!DoubleX_RMVXA::Counterattack_Edit::Actor_Learn_Counterattack_Skill || self.skill_learn?($data_skills[equip.counterattack_skill]))
}
end
return skill_counterattack if skill_counterattack != DoubleX_RMVXA::Counterattack_Edit::Default_Counterattack
return self.class.counterattack_skill if skill_counterattack != DoubleX_RMVXA::Counterattack_Edit::Default_Counterattack && (!DoubleX_RMVXA::Counterattack_Edit::Actor_Learn_Counterattack_Skill || self.skill_learn?($data_skills[self.class.counterattack_skill]))
return self.actor.counterattack_skill if !DoubleX_RMVXA::Counterattack_Edit::Actor_Learn_Counterattack_Skill || self.skill_learn?($data_skills[self.actor.counterattack_skill])
end
return self.enemy.counterattack_skill if self.enemy?
return DoubleX_RMVXA::Counterattack_Edit::Default_Counterattack
end # counterattack_skill_id
end # Game_Battler
class Window_BattleLog < Window_Selectable
#----------------------------------------------------------------------------|
# Rewrite method: display_counter |
#----------------------------------------------------------------------------|
def display_counter(target, item)
Sound.play_evasion
# This part is awritten by this script to alter the vocab of counterattack
add_text(sprintf(Vocab::CounterAttack, target.name, $data_skills[target.counterattack_skill_id].name)) if DoubleX_RMVXA::Counterattack_Edit::COUNTERATTACK_MESSAGE
#
wait
back_one
end # display_counter
end # Window_BattleLog
class Scene_Battle < Scene_Base
#----------------------------------------------------------------------------|
# (v1.05a+)Alias method: show_attack_animation |
#----------------------------------------------------------------------------|
alias show_attack_animation_counterattack_edit show_attack_animation
def show_attack_animation(targets)
# This part is rewritten by this script to handle the Keep_Ani case
if @counterattack_subject && @counterattack_subject.actor?
show_normal_animation(targets, @counterattack_subject.atk_animation_id1, false)
show_normal_animation(targets, @counterattack_subject.atk_animation_id2, true)
else
show_attack_animation_counterattack_edit(targets)
end
#
end # show_attack_animation
#----------------------------------------------------------------------------|
# (v1.01a+)Alias method: apply_item_effects |
#----------------------------------------------------------------------------|
alias apply_item_effects_counterattack_edit apply_item_effects
def apply_item_effects(target, item)
apply_item_effects_counterattack_edit(target, item)
# This part is added by this script to invoke cnt upon mev or !CNT_Negate_Hit with chance cnt
invoke_counter_attack(target, item) if target.mev_invoke_cnt? && target.invoke_counter_attack? || !DoubleX_RMVXA::Counterattack_Edit::CNT_Negate_Hit && rand < target.item_cnt_counterattack_edit(@subject, item)
#
end # apply_item_effects
#----------------------------------------------------------------------------|
# Rewrite method: invoke_counter_attack |
#----------------------------------------------------------------------------|
def invoke_counter_attack(target, item)
@log_window.display_counter(target, item)
# This part is rewritten by this script to alter the counterattack skill
@counterattack_subject = target if DoubleX_RMVXA::Counterattack_Edit::Keep_Ani
attack_skill = $data_skills[target.counterattack_skill_id]
repeats = DoubleX_RMVXA::Counterattack_Edit::Keep_Times ? attack_skill.repeats : 1
if attack_skill.for_opponent?
scope = DoubleX_RMVXA::Counterattack_Edit::Keep_Scope ? targets_for_opponents_counterattack_edit(target, attack_skill) : [@subject]
show_animation(scope, attack_skill.animation_id) if DoubleX_RMVXA::Counterattack_Edit::Keep_Ani
scope.each { |s|
repeats.times {
if $imported["DoubleX RMVXA Substitute Edit"]
apply_substitute(s, attack_skill).item_apply(target, attack_skill)
@log_window.display_action_results(s, attack_skill) if apply_substitute(s, attack_skill) == s
else
s.item_apply(target, attack_skill)
@log_window.display_action_results(s, attack_skill)
end
}
}
elsif attack_skill.for_friend?
scope = DoubleX_RMVXA::Counterattack_Edit::Keep_Scope ? targets_for_friends_counterattack_edit(target, attack_skill) : [target]
show_animation(scope, attack_skill.animation_id) if DoubleX_RMVXA::Counterattack_Edit::Keep_Ani
scope.each { |s|
repeats.times {
s.item_apply(target, attack_skill)
@log_window.display_action_results(s, attack_skill)
}
}
end
@counterattack_subject = nil if DoubleX_RMVXA::Counterattack_Edit::Keep_Ani
#
refresh_status
end # invoke_counter_attack
#----------------------------------------------------------------------------|
# New method: targets_for_opponents_counterattack_edit |
#----------------------------------------------------------------------------|
def targets_for_opponents_counterattack_edit(target, item)
if item.for_random?
Array.new(item.number_of_targets) { target.opponents_unit.random_target }
elsif item.for_one?
num = 1 + (item == $data_skills[target.attack_skill_id] ? target.atk_times_add.to_i : 0)
[@subject] * num
else
target.opponents_unit.alive_members
end
end # targets_for_opponents_counterattack_edit
#----------------------------------------------------------------------------|
# New method: targets_for_friends_counterattack_edit |
#----------------------------------------------------------------------------|
def targets_for_friends_counterattack_edit(target, item)
if item.for_user?
[target]
elsif item.for_dead_friend?
if item.for_one?
[target.friends_unit.random_dead_target]
else
target.friends_unit.dead_members
end
elsif item.for_friend?
if item.for_one?
[target.friends_unit.random_target]
else
target.friends_unit.alive_members
end
end
end # targets_for_friends_counterattack_edit
end # Scene_Battle
#==============================================================================|
Todos los creditos a DoubleX remember xD.
Saluuuuuudos
fatyguero- PJ Principal
-
RPG Maker :
Mensajes : 344
Monedas : 369
Reputación : 105
Edad : 36
Localización : en el culo del mundo... digo el centro xD
Re: Problema con Contra-Ataque
nope, me sigue dando el mismo error, creo que es por incompatibilidad con el script de las voces, porque si un contraataque mata a un personaje que ataca varias veces, cuando el script busca al personaje que hablo para seguir haciendo las voces y sale que está muerto da un error... O al menos es llo que me parece, de momento reemplacé la habilidad de Contraataque por otra que aumenta los golpes criticos y espero poder encontrar alguna forma de hacer que sean compatibles... De todos modos, gracias faty por tu ayuda! Después analizaré mejor el script que me pasaste a ver si encuentro alguna forma...
Er1ck_92- PJ Recurrente
-
RPG Maker :
Mensajes : 76
Monedas : 132
Reputación : 6
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.