public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

Direction Based Line of Sights

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: Direction Based Line of Sights
  • Original author: Candacis
  • Original date: September 18, 2014
  • Source thread: https://forums.rpgmakerweb.com/threads/direction-based-line-of-sights.32144/
  • Source forum path: Game Development Engines > Legacy Engine Support > RPG Maker VXAce Support

Summary

Okay, so I've tried to do this tutorial: http://ccrgeek.wordpress.com/ways-to-use-scripts-2/direction-based-line-of-sight/ from the Candy Coded Blog. I chose a triangular line of sight and it works, but I want to create an event where something happens, if the player is discovered AND something different if the player is not discovered. It is an action button event. Basically the player interacts with the event and if he is spotted something different happens. But I just can't figure out how to go about it. Every conditional branch I tried delivered not the result I...

Archived First Post

Okay, so I've tried to do this tutorial:

http://ccrgeek.wordpress.com/ways-to-use-scripts-2/direction-based-line-of-sight/ from the Candy Coded Blog. I chose a triangular line of sight and it works, but I want to create an event where something happens, if the player is discovered AND something different if the player is not discovered. It is an action button event. Basically the player interacts with the event and if he is spotted something different happens.

But I just can't figure out how to go about it. Every conditional branch I tried delivered not the result I wanted.

Here is the conditional branch for, if the player is spotted. First condition:

($game_map.events[5].y - $game_player.y).abs <= 4 && ($game_map.events[5].x - $game_player.x).abs <= 1 || ($game_map.events[5].x - $game_player.x).abs <= 4 && ($game_map.events[5].y - $game_player.y).abs <= 1Nested in that is the second condition:

$game_map.events[5].direction == 2 && $game_map.events[5].y < $game_player.y || $game_map.events[5].direction == 8 && $game_map.events[5].y > $game_player.y || $game_map.events[5].direction == 4 && $game_map.events[5].x > $game_player.x || $game_map.events[5].direction == 6 && $game_map.events[5].x < $game_player.xThe 5 is the NSC Event that is moving around. This works as intended, player gets spotted. But where and how would I put conditional branches to trigger something if the player does not get spotted? I also attached a file from my event.

Would be happy, if someone could help me out on how to do this right.

Protected download

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

spotted.png
spotted.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#vxace-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar