public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

How can I draw a line from point A to point B and check if it overlaps a player?

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 can I draw a line from point A to point B and check if it overlaps a player?
  • Original author: IsFutureBright
  • Original date: August 23, 2013
  • Source thread: https://forums.rpgmakerweb.com/threads/how-can-i-draw-a-line-from-point-a-to-point-b-and-check-if-it-overlaps-a-player.17287/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS3 Scripts (RMVX Ace) > RGSS3 Script Requests

Summary

So I'm trying to make a detection system on my own and I want my guards to draw lines in front of them and if any line collides with the player then the player is seen. The thing is I want the lines to hit unpassable objects (so it doesn't go through walls) but go through stuff like chairs and tables, so I'll probably use region IDs for that. Can anyone give me a hand/direction on how to do such a function? I'm thinking of something like: { "lightbox_close": "Close",

Archived First Post

So I'm trying to make a detection system on my own and I want my guards to draw lines in front of them and if any line collides with the player then the player is seen. The thing is I want the lines to hit unpassable objects (so it doesn't go through walls) but go through stuff like chairs and tables, so I'll probably use region IDs for that. Can anyone give me a hand/direction on how to do such a function?

I'm thinking of something like:

Protected download

Protected download

 

//On GameEventcan_see_player?(disX, disY)    for i to n        line = drawLine()        if(line.overlaps($game_player))            return true;        end    end    return false;endJust tossing ideas really. If anyone can give me a hand/direction I'd be very happy

Thanks in advance

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

Referenced Images / Attachments

stealthSystem_s2.png
stealthSystem_s2.png
stealthSystem_s1.png
stealthSystem_s1.png
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#rgss3-requests

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar