[ZScript] 3D Platform Actor (v2.2c)

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: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

[ZScript] 3D Platform Actor (v2.2c)

Post by Fishytza »


This is a actor class whose main feature is the ability to carry other actors on top of itself while it moves around.

Possibilies include:
- Old-fashioned platforming
- Enemies that ride moving "cars" while attacking you.
- Floors and ceilings opening up.
- Any scenario at all where you can imagine a horizontally moving piece of "geometry" that you can stand on and be carried by.
- Pushable crates that can carry other crates (since v1.1.0)

Movement is based on GZDoom's PathFollower. That is, it moves by using map placed interpolation points. But it can also be moved/rotated via ACS since it has dedicated ACS utility functions.

A short demo map (MAP01) is included.

All the models in that map were created with UDB, but a platform can be a sprite, too.

Github repo:
https://github.com/FishyClock/3Dplatform

Latest release:
https://github.com/FishyClock/3Dplatfor ... /tag/v2.2c

All releases:
https://github.com/FishyClock/3Dplatform/releases

Feel free to use this for your own projects as long as you mention me in the credits.
This is licensed under GPL.
I highly recommend you change the "Fishy" prefix to avoid conflicts.
Spoiler: More details
Spoiler: Known issues
Last edited by Fishytza on Sat Oct 19, 2024 2:52 pm, edited 34 times in total.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Fishytza »

The v1.0.1 release fixes the interpolation issues, so it shouldn't be as jittery as before.
User avatar
Enjay
 
 
Posts: 26573
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Enjay »

This is very nice. I haven't dived into the file yet to see how modular they are as a drop-in for any project but these really do the job very well.

There have been several attempts to do something similar in the past via a variety of means but I think these may feel the most solid and "part of the engine-like". They certainly seem incredibly flexible in what you can do with them.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Fishytza »

Thank you very much.

As for anyone wondering how exactly to use this:
Well, the idea is you inherit from the base class to create your platforms.
And while you can use sprites, the workflow (I imagined for myself) was, you make your level geometry, you use UDB to export that as a model, you then make a subclass of FCW_Platform, and set it up accordinally.

If I had to make an analogy, it's like mapping in Quake where you turn a set of brushes into a func_mover or whatever.
I know that doesn't sound really convenient.

Most of any platform's behavior can be set up from its thing arguments; there are defined Editor Keys specifically for UDB so in theory it should be pretty straightforward.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Fishytza »

Added "Known issues" in OP.
User avatar
Enjay
 
 
Posts: 26573
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Enjay »

On the actor flag issue, you are just using the +CANPASS or +SPECIAL flags to tell your code "you can carry this actor" right? So would there be any merit in you using zscript to create your own +CANBECARRIED flag that is only used as a marker for that purpose (if such a thing can be done)?
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Fishytza »

No, no. What I meant by that is that actors lacking those flags simply fall through the platforms.
Even if you were to attempt to carry anything they would just fall through.

What's keeping those passengers on top of a platform has nothing to do with the platform's code.
I suspect it's more to do with that a object with CANPASS can stand on another CANPASS object.
And the only way an actor with SPECIAL can stand on anything is if the lower actor has ACTLIKEBRIDGE (which FCW_Platform has set).

I didn't just arbitrarily decide an actor has to have one of those two flags. It's just that, if I know they will fall through the platform, then don't even bother trying to move them when the platform moves.
Last edited by Fishytza on Mon May 16, 2022 7:15 am, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 26573
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Enjay »

Ah right, understood. That makes more sense than how I originally interpreted the issue.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Fishytza »

My apologies, it's poor wording on my part.
I've clarified it in the "Known issues" spoiler.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Nash »

Thank you for this library. I did play to use models for moving platforms, and this is perfect. :D
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects

Post by Fishytza »

You're welcome. :)
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects (v1.0.

Post by Fishytza »

Made platforms usable with non-static line portals. ie "simple-teleport" and "interactive" types. See map TEST01 for examples.

Added some more options and ACS util functions.(See OP under "More details" for screenshots. Flag 256 and onwards are the new options.)
The new functions are SetNodePath(), SetOptions(), SetCrushDamage(), MakeGroup(), LeaveGroup() and DisbandGroup().

All ACS util functions now accept TID 0 to mean "script activator".
User avatar
22alpha22
Posts: 306
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects (v1.0.

Post by 22alpha22 »

This is a truly amazing piece of work but I have a one question. How would I create a subclass which is able to carry objects when it is moved by external forces, (a player pushing it) but is otherwise inert and unable to move. I'm trying to make a crate which won't be able to move on it its own but can be pushed by players and should carry anything on top of it including other crates. Your code is rather complex and beyond my ZScript skills and all my attempts to do this have failed.

Before I found this, I used a Warp to move things with the crate and it worked but was a little janky, your carry code would work a lot better if I could get it to work with my crate.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects (v1.0.

Post by Fishytza »

I've made it so you can push platforms around if they have the +PUSHABLE flag; Still a work in progress. (And potentially buggy.)
Crates on top of crates is on the to-do list.

For your case, fetch the last commit and try something like this:

Code: Select all

class FancyCrate : FCW_Platform
{
    Default
    {
        -NOGRAVITY;
        +PUSHABLE;
    }
    //etc
}
The testmap (TEST01) has a similar example. Give it a try and tell me what's broken?
User avatar
22alpha22
Posts: 306
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: [ZScript] 3D Platform Actor / Faux 3D Polyobjects (v1.0.

Post by 22alpha22 »

I've finally had some time to test out your pushable crates and they seem to work well and as expected with the exception of portal interactions. I've gotten stuck several times trying to push the crate through the portal on your test map and the crate visibly gets cut open in places when it is between the two sectors linked by the portal.

Aside from the portal shenanigans, the new pushable platforms work great as far as I can tell, I eagerly await the next official release, awesome job. :thumb:

Return to “Script Library”