public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

How to check for criticals in Yanfly Battle Engine?

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: How to check for criticals in Yanfly Battle Engine?
  • Original author: ZServ
  • Original date: January 15, 2017
  • Source thread: https://forums.rpgmakerweb.com/threads/how-to-check-for-criticals-in-yanfly-battle-engine.73633/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support

Summary

Hey there! I'm using a version of Yanfly's Battle Engine, with small modifications for my project. Nothing that would change how this in particular would work, anyhow. So, what I'm curious about, is how can I check if a hit is critical? I've used his screen shake snippet for some minor stuff, like this snippet below: def perform_damage_effect $game_troop.screen.start_shake(3, 13, 10) if YEA::BATTLE::SCREEN_SHAKE @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS

Archived First Post

Hey there! I'm using a version of Yanfly's Battle Engine, with small modifications for my project. Nothing that would change how this in particular would work, anyhow. So, what I'm curious about, is how can I check if a hit is critical? I've used his screen shake snippet for some minor stuff, like this snippet below:


def perform_damage_effect
$game_troop.screen.start_shake(3, 13, 10) if YEA::BATTLE::SCREEN_SHAKE
@sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
Sound.play_enemy_damage
end


But I'd like to potentially spruce up critical hits a bit by making it a more vigorous shake if a critical hit is done. I know that he pushes a critical flag, and I can only assume that's because whether or not a hit is critical is only kept in memory for so long. So, I tried this, to no avail:


def perform_damage_effect
if @flags.include?("critical")
$game_troop.screen.start_shake(3, 5, 200) if YEA::BATTLE::SCREEN_SHAKE
else
$game_troop.screen.start_shake(3, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
@sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
Sound.play_enemy_damage
end


Here is a link To the YBE. Any help would be appreciated, but I'm aware that it's a lengthy script to comb through.

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#rgss-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar