Make monsters not have "Infinite Vision"?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Make monsters not have "Infinite Vision"?

Postby Graaicko » Thu Feb 18, 2021 9:41 pm

Hey, I was wondering if there is a way to make enemy actors have limited vision instead of see you from infinity for example, you are in a large area and enemies can't see you from a far without using Doom builder Lindef blockers. I have not seen this ever before in a Doom mod, But I was wondering if its possible? I am specifically wanting to make it effect enemies via slade if possible. Thanks.
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Make monsters not have "Infinite Vision"?

Postby Jarewill » Fri Feb 19, 2021 1:58 am

A_LookEx can take maximum see distance as a parameter.
Setting it to a value like 512 will make monsters not see the player from over 512 units away.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Make monsters not have "Infinite Vision"?

Postby Graaicko » Fri Feb 19, 2021 7:20 am

Jarewill wrote:A_LookEx can take maximum see distance as a parameter.
Setting it to a value like 512 will make monsters not see the player from over 512 units away.


Hmm, Didn't think It would be this easy. Now can this be adjusted, for example maybe if 512 was too far or too close?
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Make monsters not have "Infinite Vision"?

Postby Jarewill » Fri Feb 19, 2021 8:10 am

Yes, A_LookEx is customizable.
minseedist sets the minimum distance required to see the player, so if this value is 256 and the player is closer than that, the monster won't see them.
maxseedist sets the maximum distance required to see the player, so if this value is 256 and the player is further than that, the monster won't see them.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Make monsters not have "Infinite Vision"?

Postby Graaicko » Sun Feb 21, 2021 5:04 am

I played around with A_LookEx, I can't seem to figure out what number values do what. Would you be able to dumb it down for me?
A_LookEx(0, 0, 0, 0, "See")
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Make monsters not have "Infinite Vision"?

Postby Caligari87 » Sun Feb 21, 2021 8:29 am

It's right there on the wiki page: A_LookEx
A_LookEx (int flags, float minseedist, floatmaxseedist, float maxheardist, double fov, state label)

Jarewill wrote:minseedist sets the minimum distance required to see the player, so if this value is 256 and the player is closer than that, the monster won't see them.
maxseedist sets the maximum distance required to see the player, so if this value is 256 and the player is further than that, the monster won't see them.

The distances are in map units (a door is 128 units wide).

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089


Return to Scripting

Who is online

Users browsing this forum: Mikk- and 2 guests