Page 1 of 13

[ZScript] 3D Platform Actor (v2.1)

Posted: Sat May 14, 2022 2:49 pm
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 ... s/tag/v2.1

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

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

Posted: Sun May 15, 2022 2:48 pm
by Fishytza
The v1.0.1 release fixes the interpolation issues, so it shouldn't be as jittery as before.

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

Posted: Sun May 15, 2022 2:53 pm
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.

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

Posted: Sun May 15, 2022 3:21 pm
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.

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

Posted: Mon May 16, 2022 1:56 am
by Fishytza
Added "Known issues" in OP.

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

Posted: Mon May 16, 2022 6:07 am
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)?

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

Posted: Mon May 16, 2022 6:33 am
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.

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

Posted: Mon May 16, 2022 7:04 am
by Enjay
Ah right, understood. That makes more sense than how I originally interpreted the issue.

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

Posted: Mon May 16, 2022 7:34 am
by Fishytza
My apologies, it's poor wording on my part.
I've clarified it in the "Known issues" spoiler.

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

Posted: Fri May 20, 2022 5:42 am
by Nash
Thank you for this library. I did play to use models for moving platforms, and this is perfect. :D

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

Posted: Fri May 20, 2022 6:31 am
by Fishytza
You're welcome. :)

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

Posted: Thu Jun 23, 2022 4:57 pm
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".

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

Posted: Sun Jul 03, 2022 7:59 am
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.

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

Posted: Mon Jul 04, 2022 3:49 pm
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?

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

Posted: Fri Jul 08, 2022 11:59 am
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: