Heyla, again!
For reference, the original-language version of the XAS ABS scripts I'm working with can be found here: https://xasabs.wordpress.com/vx-ace/
The English translation of the XAS ABS scripts--which is the version I'm using--can be found here: https://www.gdunlimited.net/scripts/rpg-maker-vx-ace/custom-battle-scripts/xas-abs-0-5-english
So, thanks to this thread https://forums.rpgmakerweb.com/inde...-on-or-modification-for-xas-abs-script.89895/, I was able to figure out how to get the enemy event to trigger a self-switch on death. However, there still remains a problem: instead of immediately triggering the self-switch, the enemy event will fade away. So, for example, if I set up an enemy event to leave behind a body when it dies, instead of triggering the self-switch so it goes immediately to the graphic showing the event's death pose, the event just disappears. I have to leave the map and return, in order to see the body. So it's like there's something in the code that's temporarily erasing the event, even as it's executing the self-switch. The trouble is that I haven't figured out where, in the core script, this code happens to be. I'm thinking it might be somewhere in the following:
But I'm not entirely sure. I'm hoping that someone who actually understands Ruby (I don't; I just kind of guess at what does what and hope that I get the results I'm looking for) can point me in the proper direction of which code to comment out to prevent the event from being erased--assuming that's what's happening, here.
Thanks, in advance, for any light you can shed on this puzzle,
TheKeeper
For reference, the original-language version of the XAS ABS scripts I'm working with can be found here: https://xasabs.wordpress.com/vx-ace/
The English translation of the XAS ABS scripts--which is the version I'm using--can be found here: https://www.gdunlimited.net/scripts/rpg-maker-vx-ace/custom-battle-scripts/xas-abs-0-5-english
So, thanks to this thread https://forums.rpgmakerweb.com/inde...-on-or-modification-for-xas-abs-script.89895/, I was able to figure out how to get the enemy event to trigger a self-switch on death. However, there still remains a problem: instead of immediately triggering the self-switch, the enemy event will fade away. So, for example, if I set up an enemy event to leave behind a body when it dies, instead of triggering the self-switch so it goes immediately to the graphic showing the event's death pose, the event just disappears. I have to leave the map and return, in order to see the body. So it's like there's something in the code that's temporarily erasing the event, even as it's executing the self-switch. The trouble is that I haven't figured out where, in the core script, this code happens to be. I'm thinking it might be somewhere in the following:
Code:
#--------------------------------------------------------------------------
# ● Execute Enemy Defeaed Process
#--------------------------------------------------------------------------
def execute_enemy_defeated_process
self.battler.defeated = true
self.through = true
@knock_back_duration = 121
enemy = $data_enemies[self.battler.enemy_id]
@collapse_duration = 120
execute_gain_exp_gold(enemy)
execute_active_switch(enemy)
execute_active_selfsw(enemy) #ghostino
execute_defeated_animation(enemy)
execute_defeated_sound_effect(enemy)
execute_final_shoot(enemy)
end
#--------------------------------------------------------------------------
# ● Execute Defeated Sound Effect
#--------------------------------------------------------------------------
def execute_defeated_sound_effect(enemy)
return if self.battler.no_damage_pop
Sound.play_enemy_collapse
end
#--------------------------------------------------------------------------
# ● Execute Final Shoot
#--------------------------------------------------------------------------
def execute_final_shoot(enemy)
enemy.note =~ /<Final Action ID = (\d+)>/
action_id = $1.to_i
return if action_id == nil
self.shoot(action_id)
end
#--------------------------------------------------------------------------
# ● Execute Gain Exp Gold
#--------------------------------------------------------------------------
def execute_gain_exp_gold(enemy)
exp = self.battler.exp
case XAS_BA::EXP_TYPE
when 0
actor = $game_party.members[0]
actor.gain_exp(exp)
when 1
for i in 0...$game_party.members.size
actor = $game_party.members[i]
actor.gain_exp(exp)
end
when 2
exp = exp / $game_party.members.size
for i in 0...$game_party.members.size
actor = $game_party.members[i]
actor.gain_exp(exp)
end
end
$game_party.gain_gold(self.battler.gold)
end
#--------------------------------------------------------------------------
# ● Execute_Active Switch
#--------------------------------------------------------------------------
def execute_active_switch(enemy)
enemy.note =~ /<Active Switch = (\d+)>/
switch_id = $1.to_i
if switch_id != nil
$game_switches[switch_id] = true
$game_map.need_refresh = true
end
end
#---------------------------------------------------------------------------
# ● Execute Active Self Switch (Addon by ghostino)
#---------------------------------------------------------------------------
def execute_active_selfsw(enemy)
if enemy.note =~ /<Active Self-Switch>/
$game_self_switches[[@map_id, @id, 'C']] = true
end
end
#--------------------------------------------------------------------------
# ● Execute Defeated Animation
#--------------------------------------------------------------------------
def execute_defeated_animation(enemy)
enemy.note =~ /<Defeated Animation = (\d+)>/
anime_id = $1.to_i
if anime_id != nil
self.animation_id = anime_id
end
end
end
But I'm not entirely sure. I'm hoping that someone who actually understands Ruby (I don't; I just kind of guess at what does what and hope that I get the results I'm looking for) can point me in the proper direction of which code to comment out to prevent the event from being erased--assuming that's what's happening, here.
Thanks, in advance, for any light you can shed on this puzzle,
TheKeeper