[ZScript] Polyobject line portal assistant (Ver 1.3.1)

Post your example zscripts/ACS scripts/etc here.

[ZScript] Polyobject line portal assistant (Ver 1.3.1)

Postby FishyClockwork » Fri Mar 12, 2021 3:27 pm

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
Last edited by FishyClockwork on Tue Apr 06, 2021 10:05 am, edited 6 times in total.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: Polyobject line portal assistant

Postby mikolah » Fri Mar 12, 2021 8:50 pm

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
mikolah
 
Joined: 05 Oct 2016
Discord: Mikolah#5576
Github ID: mykola-ambar
Graphics Processor: ATI/AMD with Vulkan Support

Re: Polyobject line portal assistant (Ver 1.1)

Postby FishyClockwork » Tue Mar 16, 2021 2:46 am

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
FishyClockwork
 
Joined: 23 Feb 2011

Re: Polyobject line portal assistant (Ver 1.2)

Postby FishyClockwork » Wed Mar 17, 2021 11:29 am

Some minor improvements.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: Polyobject line portal assistant (Ver 1.3)

Postby FishyClockwork » Fri Mar 19, 2021 2:58 pm

Bugfix: Projectiles would sometimes fail to cross the portal even when caught by the assistant.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: Polyobject line portal assistant (Ver 1.3.1)

Postby FishyClockwork » Thu Apr 01, 2021 12:15 pm

Added the GPL 3.0 license. (It didn't have a proper license before.)
User avatar
FishyClockwork
 
Joined: 23 Feb 2011


Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests