[ZScript] Polyobject line portal assistant (Ver 1.3.1)

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

[ZScript] Polyobject line portal assistant (Ver 1.3.1)

Post by Fishytza »

If you (like me) ever found yourself wanting to do polyobject line portal related magic but became discouraged by the fact that when a polyobject line portal crosses an actor, the actor doesn't cross the portal. And while I have reported this bug, there's the very real possibility it won't be fixed anytime soon, probably because it's not easy to fix and is also a low priority.

So I've spent days coding together a working, temporary solution. An assistant thinker for polyobject line portals. This thinker doesn't influence/dictate the polyobject's movement but rather monitors the portal line's position. It can detect whether the line has moved and in what direction.

If the portal line moved backwards or sideways, then nothing happens, but
if it moved forward it runs a blockmap search to see if it crossed any actors
and tries to make said actors cross the portal line. This is all done after all
polyobjects and all actors made their move. (It ticks last.)

This was admittedly crudely put together.
Any criticisms and suggestions for how to improve this would be greatly appreciated.

Link: https://www.dropbox.com/s/80wxpam7ti5un ... 1.pk3?dl=1
This PK3 contains the thinker, an event handler that spawns thinkers for each portal line on a polyobject (that isn't the "visual only" type), and a test map with 3 polyobjects. A rectangular platform that moves around picking up items and misc things, a train, and a rotating platform. Basically, stuff you'd expect out of a Duke Nukem 3D map.

Feel free to use this and modify it in whatever fashion you see fit.
All I ask is that you remove the "FC_" prefix and mention me in the credits.
Spoiler: Changelog
Last edited by Fishytza on Tue Apr 06, 2021 10:05 am, edited 6 times in total.
User avatar
mikolah
Posts: 6
Joined: Wed Oct 05, 2016 7:02 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Polyobject line portal assistant

Post by mikolah »

Holy shit! The amount of innovative level design this allows for is a potential game changer, and I hope mappers will use this to come up with crazy ideas. I can see this being used a lot in the future. Absolutely brilliant.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Polyobject line portal assistant (Ver 1.1)

Post by Fishytza »

I've implemented a different collision detection method so it should handle rotating polyobjects much better now.

Uploaded new version in the OP.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Polyobject line portal assistant (Ver 1.2)

Post by Fishytza »

Some minor improvements.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Polyobject line portal assistant (Ver 1.3)

Post by Fishytza »

Bugfix: Projectiles would sometimes fail to cross the portal even when caught by the assistant.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Polyobject line portal assistant (Ver 1.3.1)

Post by Fishytza »

Added the GPL 3.0 license. (It didn't have a proper license before.)
Post Reply

Return to “Script Library”