Display an image when a critical hit happens?

I'll just like to let you all know before I write this post that I know next to nothing about programming - I'm building my first game just to teach myself.

I'm trying to get an image to pop up for half a second when either an enemy or a playable character lands a critical hit. I'm trying to do this by making the image appear and then disappear as a common event using this code:

@>Show Picture: 1, 'image', Center (0,0), (100%,100%), 255, Normal@>Wait: 30 frame(s)@>Erase Picture: 1 ..and then I'm trying to call the common event with this code in Window_BattleLog (specifically, the part bolded)

#-------------------------------------------------------------------------- # * Display Critical Hit #-------------------------------------------------------------------------- def display_critical(target, item) if target.result.critical $game_temp.common_event_id = 1 text = target.actor? ? Vocab::CriticalToActor : Vocab::CriticalToEnemy add_text(text) wait end end'1' is what I named my common event, is that the same thing as the event ID? Is this even the problem? Sorry if this is a noobish question, as I said, I'm not very experienced with this 🙁
I'm terrible at scripting, but wouldn't using a Bitmap work easier ?
I haven't tried tinkering around with bitmaps yet, I'll try that if no other solutions are suggested soon.
Try this:

Code:
$game_temp.reserve_common_event(id)
Try this:

$game_temp.reserve_common_event(id)
It works! Thank you! 😀

However, it doesn't work if I name the event something different - to anything other than '1'. This happens:

Script 'Window_BattleLog' line 282: NameError occurred.undefined local variable or method '(event name)' for #<Window_BattleLog:0x8969314>Am I confusing the event name with the event ID or something? :S

Also, how do I make the image appear before any of the text does? Like, the first thing that will alert you that you got a critical hit will be the image appearing, and then the accompanying text.
If you want it to be displayed before the text, you will need some more scripting.

I can write you a script, that lets you display an image on an critical hit, if you want.

And for: 

$game_temp.reserve_common_event(id)You can use only Numbers for "id" which correspond to the Common Event ID you want to call.
If you want it to be displayed before the text, you will need some more scripting.

I can write you a script, that lets you display an image on an critical hit, if you want.

And for: 

$game_temp.reserve_common_event(id)You can use only Numbers for "id" which correspond to the Common Event ID you want to call.
That would be awesome! 😀 Thank you so much!

Ideally, I would like the image to appear alongside the text, but if it appears before it then that's okay too.

Yeah, I figured out the ID thing. 😛

Original thread: https://forums.rpgmakerweb.com/threads/display-an-image-when-a-critical-hit-happens.25633/