[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.
User avatar
Fishytza
Posts: 797
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them

[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

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: 797
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them

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: 797
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them

Re: Polyobject line portal assistant (Ver 1.2)

Post by Fishytza »

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

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: 797
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them

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.)
User avatar
Ivory_2505
Posts: 10
Joined: Thu Apr 16, 2026 1:01 pm
Preferred Pronouns: He/Him

Re: [ZScript] Polyobject line portal assistant (Ver 1.3.1)

Post by Ivory_2505 »

Hey, idk if you're still active but thanks, I tried this out for my recreation of 8-1 from ULTRAKILL in Doom and it works, it was a problem I was struggling with before. However it created another issue, it seems the portal also takes all the lanterns in the hallway with it if that makes sense, causing this to happen:

https://jumpshare.com/s/gNCLQ2nkgVrU3FQo0ogl

Here's the code for the lantern actor (got it from Realm667):

Code: Select all

ACTOR TechLanternSmall 503
{
	//$Category Light sources
	Radius 6
	Height 45
	+SPAWNCEILING
	+NOGRAVITY
	States
	{
	Spawn:
		HLMP EFGH 6 Light("SMALLLANTERN")
		Loop
	}
}
User avatar
Fishytza
Posts: 797
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them

Re: [ZScript] Polyobject line portal assistant (Ver 1.3.1)

Post by Fishytza »

The link you posted gives me a 404 so I can't see what you mean.
Any actor the portal line crosses will teleport, that's intentional.
User avatar
Fishytza
Posts: 797
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them

Re: [ZScript] Polyobject line portal assistant (Ver 1.3.1)

Post by Fishytza »

If the lanterns are never meant to teleport and they're not solid, giving them +NOBLOCKMAP should do the trick.

Return to “Script Library”