[ZScript/ACS] Actor Standing on 3D Floor

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
Grymmette
Posts: 590
Joined: Wed Jun 24, 2009 12:30 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Nowhere, KS

[ZScript/ACS] Actor Standing on 3D Floor

Post by Grymmette »

I am using this A* pathfinding code in a project I'm working on, and I've edited it so that the monsters don't have to stand still while they're chasing the player if the player moved to an inaccessible sector. The only problem is that now, when I leave a sector where I was standing on a 3D floor or the monster enters a sector where there is a 3D floor, the game crashes.

I know that the original author of that A* pathfinding intended to update it with the ability to check for 3D floors but that was never implemented. Adding that functionality myself is over my head. So, since I can't do that, I've been trying to make the monsters ignore the pathfinding code in those instances, but, I don't quite know how. Is there a way to check if an actor is specifically standing/moving on/from a 3D floor? An ACS solution would work if I can't do anything through ZScript.

I tried some code I found by Major Cooke here, and it seemed to work in one map where there were 3D floors (compendium hub map start area), but when trying it out on Doom 2 MAP01, the monster always ignores the pathfinding because it always thinks it's on a 3D floor. I suppose that is true to some degree because the FloorZ is always equal to the monster's Z, but I don't know why it worked in one map and fails in the other.

Return to “Scripting”