ZScript - checking if a sector has portals

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
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

ZScript - checking if a sector has portals

Post by Gutawer »

How can I check if a Sector has a portal on either its bottom or top? I see a lot of portal-related stuff in the Sector struct, but I'm not entirely sure how to use any of it to test for portals.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49203
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript - checking if a sector has portals

Post by Graf Zahl »

It depends on what precisely you want to test. Physical presence of a portal by itself does not mean much.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: ZScript - checking if a sector has portals

Post by Gutawer »

I essentially wanna test if the mapper has put a portal on the top or bottom of their sector for a stacked sector effect - I'm working on an FX system, but I need to disregard portal sectors' flats for testing which effect to spawn since the player would never see those flats anyway.

Return to “Scripting”