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
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, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadReferenced Images / Attachments
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.
Replies (0)
No replies yet.
Topic Summary
Loading summary...
