SRPG Studio

SRPG Studio

Jolteon Jan 18, 2021 @ 8:40am
Events activated based on enemy sight?
So I recently got a unit to patrol a certain area, but I'm now stuck on how to make him alert others if the player is within the enemies line of sight. Anyone know how to do this? Any feedback would be appreciated.
< >
Showing 1-6 of 6 comments
nyvrem Jan 18, 2021 @ 10:48am 
I have made this too for my project.

You need to create another local switch, for example "player spotted"

Create auto event with condition distance select your patrolling unit, set range you need to alert enemy and in target section set filter player.

Use event command "change switch" and select "player spotted on"

In your patrolling unit settings add pattern page with local switch "player spotted on"

I don't know why but in my project I need to place this page first for it works.
Jolteon Jan 18, 2021 @ 12:19pm 
Thanks for the reply. I actually knew of that way but what I actually meant was their actual range. Ex. the enemy patrol unit is on a up and down wall (no left or right movement available) and is an archer unit with a bow of 2-3 range therefore his line of sight wouldn't always be (ex. 5) because he can see further down and up then left and right. (I hope that makes sense) so I was hoping that is was based on his actually range of attack. As always I appreciate any feedback.
nyvrem Jan 18, 2021 @ 3:49pm 
I'm not sure I understand what you mean.

You can't just put the range at 3 tiles like the bow's range?
Jolteon Jan 19, 2021 @ 12:31am 
https://steamcommunity.com/profiles/76561198136782646/images/
Hopefully this helps a bit more then how I explained it.
nyvrem Jan 19, 2021 @ 7:33am 
I think I understand.
But it's seem difficult, maybe a script exist for this.
The only way I know to make this, it's create auto event with range condition and draw the range like real unit range, postion by position.

Example : My patrolling unit have 3 stand by positions

First position
https://ibb.co/q09YWPJ https://ibb.co/DfQvXDk
Second
https://ibb.co/jzD8Zvt https://ibb.co/WvzW6Lx
Third
https://ibb.co/Yjmq9k6 https://ibb.co/d6f7Cv2

If I clearly understood you mean you want a similar thing like this.
Video example : https://streamable.com/zq0e5p
Last edited by nyvrem; Jan 19, 2021 @ 7:36am
Jolteon Jan 19, 2021 @ 9:44am 
Yeah that works. It's a little more work then I expected but you do what you gotta. Thanks for the help much appreciated.
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Jan 18, 2021 @ 8:40am
Posts: 6