Drawing a ray from the player to an event.

Hey guys.

I have a pretty big question to ask.

I'm trying to make a combat system on a normal map where the characters can move, shoot, reload, or heal themselves.

When the when you chose shoot I want the game to determine if there is anything in the way of the enemy you are shooting at and if so limit the hit chance.

I want it to draw a ray to the opponent and follow the line of fire but i have no clue how to do that.

Does anyone have any ideas?

If it can be done without much scripting that would be nice cause I have almost zero ruby knowledge. But if not I'd be happy to learn.
I got the shooting part to work but now I need ideas for how to work the ai. Anyone?

Original thread: https://forums.rpgmakerweb.com/threads/drawing-a-ray-from-the-player-to-an-event.42448/