Page 1 of 1

[ZScript] Polyobject line portal assistant (Ver 1.3.1)

PostPosted: Fri Mar 12, 2021 3:27 pm
by FishyClockwork
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/80wxpam7ti5unk5/polyportalassistant-v1.3.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

Re: Polyobject line portal assistant

PostPosted: Fri Mar 12, 2021 8:50 pm
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.

Re: Polyobject line portal assistant (Ver 1.1)

PostPosted: Tue Mar 16, 2021 2:46 am
by FishyClockwork
I've implemented a different collision detection method so it should handle rotating polyobjects much better now.

Uploaded new version in the OP.

Re: Polyobject line portal assistant (Ver 1.2)

PostPosted: Wed Mar 17, 2021 11:29 am
by FishyClockwork
Some minor improvements.

Re: Polyobject line portal assistant (Ver 1.3)

PostPosted: Fri Mar 19, 2021 2:58 pm
by FishyClockwork
Bugfix: Projectiles would sometimes fail to cross the portal even when caught by the assistant.

Re: Polyobject line portal assistant (Ver 1.3.1)

PostPosted: Thu Apr 01, 2021 12:15 pm
by FishyClockwork
Added the GPL 3.0 license. (It didn't have a proper license before.)