Retrieve an actor's current 3d sector

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Retrieve an actor's current 3d sector

Postby gwHero » Fri Jun 08, 2018 9:42 am

As I understand from this post it would be difficult to use the F3DFloor struct for this, so I think it would be very nice to extend ZScript with a property or function to be able to retrieve the properties of a 3d sector an actor is in.

A use case for me personally: if the player is standing or swimming in a swimmable area, I need to know some of the properties of the model sector that defines the swimmable area. So it would be nice if one of the following options could be added to retrieve that model sector:

Option 1 (as a new property for the Actor class): i.e. sector property 'Cur3dSector' (next to the Actor's Sector property CurSector).

Option 2 (as a new function for the Actor class): since it will be more often that an actor is NOT in a 3d area, I can imagine that it's not wanted to keep a property constantly updated, since it will be mostly null, so of course it would be also okay to present it as a function, i.e. GetCurrent3dSector() which returns null if not applicable.

Option 3 (as a new property or function for the Actor class that returns an array): since a sector can have multiple 3d floors defined, maybe it would be better or easier not to return the actor's current sector (the floor the actor is actually standing on), but an array of sectors that are applicable for the actor's current sector (the array would be empty if no 3d floor is applicable). In that case the mod itself should/could check from this array which floor would be the one the actor is standing on.

Option 4 (as a new property or function for the Sector struct that returns an array): for an even more generic approach, maybe it would be a good idea to request all 3d sectors that are applicable for a sector.
User avatar
Be your own Siddhartha
Joined: 08 May 2017
Location: The Netherlands

Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest