Make an Actor block monster line of sight?

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!)
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Make an Actor block monster line of sight?

Post by Nash »

Is it possible to make an Actor break monster sight checks? Say I'm trying to make an Actor that looks like a huge box, and you can push the box around to "hide" from other monsters.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Make an Actor block monster line of sight?

Post by Graf Zahl »

No. The sight checking code only checks linedefs. If it had to traverse actors as well it'd slow down considerably.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Make an Actor block monster line of sight?

Post by ramon.dexter »

Polyobject? I know, its crude and halfway solution, but it could be used as pushable object/hideout.

Graf, are polyobjects counted when doing the sight check? I think yes, because they're linedefs after all (I suppose).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Make an Actor block monster line of sight?

Post by Graf Zahl »

Yes, polyobjects are counted. This is needed so that closed swinging doors block sight
User avatar
Apeirogon
Posts: 1606
Joined: Mon Jun 12, 2017 12:57 am

Re: Make an Actor block monster line of sight?

Post by Apeirogon »

But polyobjects have inf. height, no!?

And I see there are

Code: Select all

native bool IsVisible(Actor other, bool allaround, LookExParams params = null);
function. Maybe this is what you want!?
User avatar
Caligari87
Admin
Posts: 6191
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Make an Actor block monster line of sight?

Post by Caligari87 »

You could do a two-sided polyobject. Those can be visually shorter, if you can prevent (or don't mind) the player seeing the "paper thin" walls from the top or bottom. Can't remember if they can be walked on or not (I think not).

8-)

Return to “Scripting”