Blizz ABS Triggers for player getting hit by enemy?

Started by Sin86, December 03, 2017, 09:37:33 pm

Previous topic - Next topic

Sin86

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.

KK20

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.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Sin86

December 17, 2017, 02:11:52 pm #2 Last Edit: December 17, 2017, 02:25:02 pm by Sin86
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.

KK20

Not on my computer but can you try it now? I edited my post.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Sin86

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!