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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Graaicko
Posts: 532
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Make monsters not have "Infinite Vision"?

Post by Graaicko »

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.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Make monsters not have "Infinite Vision"?

Post by Jarewill »

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.
User avatar
Graaicko
Posts: 532
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: Make monsters not have "Infinite Vision"?

Post by Graaicko »

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?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Make monsters not have "Infinite Vision"?

Post by Jarewill »

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.
User avatar
Graaicko
Posts: 532
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: Make monsters not have "Infinite Vision"?

Post by Graaicko »

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
Caligari87
Admin
Posts: 6229
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Make monsters not have "Infinite Vision"?

Post by Caligari87 »

It's right there on the wiki page: [wiki]A_LookEx[/wiki]
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-)
Post Reply

Return to “Scripting”