Complicated line of sight problem

I've had some issue with this for a while. Posting in script requests because I'm confident it's not possible through eventing after hours of trying.

Here's the situation:

The player is in a large, maze-like room full of large objects (crates, barrels etc). There is a monster roaming around the room. I want it to work in the following manner:

-The monster chases the player if it gets line of sight, but can't see the player through walls or any of said large objects (though it can pathfind around them if it still has line of sight) The room will have some convenient alcoves for the player to hide in and avoid the monster. If it breaks line of sight, the monster goes back to roaming.

-If the monster catches the player, they die.

I've tried several stealth/Line-of-sight scripts to try and solve this. Event Chase Player doesn't follow true line of sight (meaning the monster can see through walls), and while Jet's Stealth System seems almost like what I need, I still don't know how to run the "player touch" trigger for the monster catching the player and the "parallel process" trigger that's required to keep it checking for line of sight and chasing the player.
your first option is to show us the event pages you'll need for the stealth variant (screenshots of all event pages) and we can check if we can help there.

that said, because the engine itself has no concept of line of sight, you'll have to use terrain tags to define which tiles block sight and which not, and base your effects on that - theoretically possible by eventing, but would require a very complex event for a limited range of sight (have to check all tiles in range).

another tip: if you want help with a script or plugin, you should ALWAYS post a link to the website where you got said script or plugin, so that we can check for manuals and code.
I've had some issue with this for a while. Posting in script requests because I'm confident it's not possible through eventing after hours of trying.

Here's the situation:

The player is in a large, maze-like room full of large objects (crates, barrels etc). There is a monster roaming around the room. I want it to work in the following manner:

-The monster chases the player if it gets line of sight, but can't see the player through walls or any of said large objects (though it can pathfind around them if it still has line of sight) The room will have some convenient alcoves for the player to hide in and avoid the monster. If it breaks line of sight, the monster goes back to roaming.

-If the monster catches the player, they die.

I've tried several stealth/Line-of-sight scripts to try and solve this. Event Chase Player doesn't follow true line of sight (meaning the monster can see through walls), and while Jet's Stealth System seems almost like what I need, I still don't know how to run the "player touch" trigger for the monster catching the player and the "parallel process" trigger that's required to keep it checking for line of sight and chasing the player.

I feel like a used car salesman every time I find one of these topics, lmao.

SO the script you're looking for is in fact Vlue's Proximity Detection! Not only does it do true line of sight (i.e enemies see in a cone in front of them), but you can tag certain regions on the map to prevent the enemy from seeing through walls.

I would know because I use this as part of the stealth system in my own games, and it's worked out very well for me.
I feel like a used car salesman every time I find one of these topics, lmao.

SO the script you're looking for is in fact Vlue's Proximity Detection! Not only does it do true line of sight (i.e enemies see in a cone in front of them), but you can tag certain regions on the map to prevent the enemy from seeing through walls.

I would know because I use this as part of the stealth system in my own games, and it's worked out very well for me.
I've just been trying this script. It seems like it has the one thing I really needed (ie, not seeing through walls), the only issue is it crashes my game with this error every time I try to playtest because the true/false value for the code's actual Line-of-sight apparently confuses Ace.

So for example I type Proxy.inprox_d?(@event_id,5,true) into the conditional branch, and when I run the game to see if it works I get this:
1645037197217.png


and then it crashes.


Edit: So literally ten seconds after posting I figured out that you don't need to specify "true" for line of sight as it's the default, hence the crash. At least I think that's what it is. Seems to work just fine now, even figured out the whole "player touch/parallel process" conundrum.

Here's the event pages anyway, in case someone else is having this problem:

1645038516403.png

1645038553685.png
I've just been trying this script. It seems like it has the one thing I really needed (ie, not seeing through walls), the only issue is it crashes my game with this error every time I try to playtest because the true/false value for the code's actual Line-of-sight apparently confuses Ace.

So for example I type Proxy.inprox_d?(@event_id,5,true) into the conditional branch, and when I run the game to see if it works I get this:
View attachment 216508

and then it crashes.


Edit: So literally ten seconds after posting I figured out that you don't need to specify "true" for line of sight as it's the default, hence the crash. At least I think that's what it is. Seems to work just fine now, even figured out the whole "player touch/parallel process" conundrum.

Here's the event pages anyway, in case someone else is having this problem:

View attachment 216516
View attachment 216517

Glad to see it worked out for you!

Original thread: https://forums.rpgmakerweb.com/threads/complicated-line-of-sight-problem.144996/