So yeah, I want to find a way to where the player can be hit with a regular attack, no magic, just regular attack. We have triggers for hitting enemies and destructible things but no triggers if a monster was to hit the player.
That's because actors are not events, which is what Triggers were designed for. There really isn't a way to do this with the default system.
So here's a script snippet to add below BlizzABS:
class Map_Battler < Game_Character
alias check_for_attack attack_effect
def attack_effect(character, _battler)
value = check_for_attack(character, _battler)
# Successful attack against a Game_Actor
if @battler.is_a?(Game_Actor) && _battler.last_action == ['attack', true]
# Turn on switch that is equal to the actor's ID
$game_switches[@battler.id] = true
end
return value
end
end
Then make a parallel process that checks if the switch is on (as the script is currently written, switch ID 1 will be on if Aluxes is attacked). Do whatever it is that you need to do, then turn that switch off.
Fixes some stuff but causes another problem. Any enemies that have triggers attached to them can no longer activate switches or even self switches. This is bad for boss/miniboss kind of enemies because on the next page, they are empty events indicated that they are defeated. Without this script, I can defeat them, leave the area and come back, they remain dead. With the script, I defeat them, come back in, they respawn.
Also disables triggers if you want to make a lever for example and to activate it, you have to strike it but it won't move to the next page after.
Not on my computer but can you try it now? I edited my post.
IT WORKED!! Thank you so much! I believe I am now getting the results that I intended to get and so far I see nothing going wrong. If I do see anything wrong, I'll let you know.
Again, thank you, this is a great addon!