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

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.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

Are you sure you need 4 XYZ locations to determine the spline? Looks like the calculation is only done between 2 points (in the case of a manually defined interpolation path)? I don't know, just asking. Cause the curvature change is never perfect around the interpolation point, as I mentioned before (creating perfect circle / curve 90°).

I don't know, I thought it would be two points only, so if it's really 4, that's a lot I understand. I don't mind a lot of parameters if it gets the job done, but if you can do it in a way that is more manageable for editors, sure ... I just can't say without knowing how the spline logic works internally (like with IPs). To determine the perfect movement before and after point X, you should need three points if I understand math.

Take your time to think it through.

Alternatively would it be more convenient to code the spline interpolation path for the platform you want to move? Spawn IPs, SetOptions (LINEAR flag off), SetNodePath (platid), .. Thing_Activate (platid)..

I've been thinking about an additional complexity here to go full ACS. What about spawning an entire grouped platform at map spot xyz? Can you? With IPs, the grouped platform will "magically appear" at the first IP, right? I don't know how to do that with map spots. Sure you can spawn an actor, but what if it's a grouped platform of 20 grouped members. If I hide the grouped platform, it will then "move" to the first spot (which you don't want the player to see). I can spawn everything, but then need to calculate XYZ for each grouped member. Not sure if I'm right on this, .. would be good to hear your input on this.
User avatar
Fishytza
Posts: 783
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by Fishytza »

The spline logic works in such a way that it absolutely needs 4 points. Let's call these p1, p2, p3, and p4.
p1 and p4 determine how curvy the path between p2 and p3 is. Now, as you can imagine, that's quite a bit of data.
If you're curious, it's this type of spline: https://en.wikipedia.org/wiki/Cubic_Her ... Rom_spline

I'm sorry, but I simply can't find a way to code this using the ACS library in a remotely clean and sensible way.
doomzie wrote: Wed Mar 01, 2023 12:41 pm Alternatively would it be more convenient to code the spline interpolation path for the platform you want to move? Spawn IPs, SetOptions (LINEAR flag off), SetNodePath (platid), .. Thing_Activate (platid)..
But hey, it looks like you already figured out a way to do it anyway.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

FishyClockwork wrote: Wed Mar 01, 2023 1:16 pm The spline logic works in such a way that it absolutely needs 4 points. Let's call these p1, p2, p3, and p4.
p1 and p4 determine how curvy the path between p2 and p3 is. Now, as you can imagine, that's quite a bit of data.
If you're curious, it's this type of spline: https://en.wikipedia.org/wiki/Cubic_Her ... Rom_spline

I'm sorry, but I simply can't find a way to code this using the ACS library in a remotely clean and sensible way.
doomzie wrote: Wed Mar 01, 2023 12:41 pm Alternatively would it be more convenient to code the spline interpolation path for the platform you want to move? Spawn IPs, SetOptions (LINEAR flag off), SetNodePath (platid), .. Thing_Activate (platid)..
But hey, it looks like you already figured out a way to do it anyway.
Ok, if this works and it should I think, then we should be fine I guess ! =)

Ok, so the math does use 4 points, very interesting. You can still do a spline between two IPs however, so in that case I imagine p1=p2 and p3=p4 in the calculation, but it will be less/more curvy than when you had 4 points to calculate with? I've seen Catmull Rom used in the stair case builder tool as well. Good to know!
User avatar
Fishytza
Posts: 783
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by Fishytza »

Just a quick notice for anyone that has been using the latest commits from the repo.

In the extremely unlikely event anyone was using the "looktics" properties and/or user variables, those have just been removed. (And no, these weren't present in v1.1.1)
https://github.com/FishyClock/3Dplatfor ... 4ec51af8ee
commit message wrote: Remove "portallooktics" and "passengerlooktics"

Both the user var and property versions.
For the passenger part, this was a temporary solution to a lack of a CollidedWith() function so I wouldn't have to do BTI searches every tic.
And besides, this wasn't really doing much for performance improvement anyway.
Sorry for any inconvenience.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

Been playing around more with CRUSHABLE. Seems the platforms only deal crush damage when they're not rotating in any way. Correct?
User avatar
Fishytza
Posts: 783
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by Fishytza »

Wrong. Whether they rotate or not shouldn't matter. If they're pushing an actor against a wall that actor should receive damage. (Assuming the platform has a greater than 0 crush damage, of course.)

And by CRUSHABLE I'm gonna assume you mean the "always do crush damage" option? Yeah, that should hurt anything it tries to push away.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

FishyClockwork wrote: Thu Mar 02, 2023 3:40 pm Wrong. Whether they rotate or not shouldn't matter. If they're pushing an actor against a wall that actor should receive damage. (Assuming the platform has a greater than 0 crush damage, of course.)

And by CRUSHABLE I'm gonna assume you mean the "always do crush damage" option? Yeah, that should hurt anything it tries to push away.
Man, I've been having a real blast with this library you cooked. :-)) You work is very much appreciated by me.

I should do a demo vid, but I'm too deep into it atm.

I'm confronted with some additional complexities/questions, if you don't mind.

1/ Regarding crushing rotating cubes: It doesn't have to be against a wall does it? I've got other moving platforms that do instant crush damage if you walk against them. So I assume not. However, is it possible that a 3DP actor that rotates (point angle) in place does not cause crush damage? That would be unexpected though. I've also got a 3DP actor that swings back and forth (roll 150° to -150°) that does no damage to the player. Not sure what to do, other than maybe also moving the actor a tiny bit back and forth over the XY plane. Anyhow, I've let this rest for now.

2/ Is it possible to do nested groups? I've tried some setups. I'm basically wondering, if you can define another "subgroup" of 3DP actors that you group with one of the unique member tag IDs of the group? I tried what I think should work, but it doesn't. So I need some confirmation on this.

3/ When you select multiple 3DP actors, it seems the labels are blank in the UDMB actor setting pop up window. It's not really a big problem, but was just wondering if you know what causes this?

4/ Attaching custom actors that have customizable features (with parameters). I see now what problem this causes. You can't access the parameters anymore of the custom actor in UDMB and you only see 3DP options. Looking at the limited space in the option window, I'm going to assume there's not even a work-around for this? Or is this then why you need the "custom parameters" window?

Greetz,
doomzie
Last edited by doomzie on Tue Mar 14, 2023 1:26 pm, edited 1 time in total.
User avatar
Fishytza
Posts: 783
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by Fishytza »

doomzie wrote: Thu Mar 09, 2023 11:48 am 1/ Regarding crushing rotating cubes: It doesn't have to be against a wall does it? I've got other moving platforms that do instant crush damage if you walk against them. So I assume not. However, is it possible that a 3DP actor that rotates (point angle) in place does not cause crush damage? That would be unexpected though. I've also got a 3DP actor that swings back and forth (roll 150° to -150°) that does no damage to the player. Not sure what to do, other than maybe also moving the actor a tiny bit back and forth over the XY plane. Anyhow, I've let this rest for now.
Unless they actually change their XYZ position, they won't crush anything, yes. Keep in mind that for GZDoom as an engine every single actor's AABB box is rigid. It does not rotate as the actor changes its angle, pitch, or roll.
So, for example if you take an imp who is facing east with an angle of 0 and another imp with an angle of 45 their collision/bounding box is the same; it just doesn't rotate.

So, I intend to keep the platform actor similar enough to GZDoom's other actors and, I am sorry to say this, but I have no further desire to fight the engine and try to work around it more than I already have. It's just not fun anymore. :)

TL;DR? Yes, give them some XYZ movement.
doomzie wrote: Thu Mar 09, 2023 11:48 am 2/ Is it possible to do nested groups? I've tried some setups. It's not possible through UDMB since you can't set different tag IDs for the origin to group with, but through ACS you can set members with different tag IDs to a platform tag ID, right or am I wrong again :-/ ? I'm basically wondering, if you can define another "subgroup" of 3DP actors that you group with one of the unique member tag IDs of the group? I tried what I think should work, but it doesn't. So I need some confirmation on this.
No, it's not possible to have groups of groups. If you attempt to join any member from group A with any member of group B those two groups end up merging together as one group. It's done this way because it's easier to manage code-wise.
And sorry, no, I don't intend to change that.
You're going to have to get clever and be careful about that in order to get what you want.
doomzie wrote: Thu Mar 09, 2023 11:48 am 3/ When you select multiple 3DP actors, it seems the labels are blank in the UDMB actor setting pop up window. It's not really a big problem, but was just wondering if you know what causes this?
If I understand you correctly, you're talking about the 5 actor arguments under the "Action / Tag/ Misc." tab, yes? If so, yeah that happens if you select multiple different subclasses of "FishyPlatform". That's a UDB problem. I don't have a workaround for that.
doomzie wrote: Thu Mar 09, 2023 11:48 am 4/ Attaching custom actors that have customizable features (with parameters). I see now what problem this causes. You can't access the parameters anymore of the custom actor in UDMB and you only see 3DP options. Looking at the limited space in the option window, I'm going to assume there's not even a work-around for this? Or is this then why you need the "custom parameters" window?
I mean, yeah, I've used up all 5 arguments and if I want more I either have to make it another bitfield option, or I have to use user variables (those have the "user_" prefix). You can see this with the Generic Platform class.

If you want, you can redefine some or all of the 5 arguments for your own use cases? More info here:
https://zdoom.org/wiki/Editor_keys


EDIT: One more thing I forgot to mention, I've added three new ACS functions that, when used together, would allow you to control interpolation point based movement purely through ACS, you can dynamically change "speed" or even have them go backwards, or whatever whacky stuff you can think of.
They're called FishyPlat_Interpolate(), _NextNode() and _PrevNode().


Feel free to try to break them lol

There are test samples in TEST03
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

FishyClockwork wrote: Thu Mar 09, 2023 2:28 pm
doomzie wrote: Thu Mar 09, 2023 11:48 am 1/ Regarding crushing rotating cubes: It doesn't have to be against a wall does it? I've got other moving platforms that do instant crush damage if you walk against them. So I assume not. However, is it possible that a 3DP actor that rotates (point angle) in place does not cause crush damage? That would be unexpected though. I've also got a 3DP actor that swings back and forth (roll 150° to -150°) that does no damage to the player. Not sure what to do, other than maybe also moving the actor a tiny bit back and forth over the XY plane. Anyhow, I've let this rest for now.
Unless they actually change their XYZ position, they won't crush anything, yes. Keep in mind that for GZDoom as an engine every single actor's AABB box is rigid. It does not rotate as the actor changes its angle, pitch, or roll.
So, for example if you take an imp who is facing east with an angle of 0 and another imp with an angle of 45 their collision/bounding box is the same; it just doesn't rotate.

So, I intend to keep the platform actor similar enough to GZDoom's other actors and, I am sorry to say this, but I have no further desire to fight the engine and try to work around it more than I already have. It's just not fun anymore. :)

TL;DR? Yes, give them some XYZ movement.
Yeah, doesn't surprise me, I tested extensively. So I'll just do a mini move over XY. No that big of an issue anywayz. I'm just so low knowledge on gzdoom I never know what to think of it. Again, I never imply that you must do something about it =) It's not complaints either, I'm trying everything and wondering, can you do this or that. Is it supposed to work? Guess not. Thanks for clarifying.

Not sure what "every single actor's AABB box is rigid" means, I'll have to do some more reading =)
FishyClockwork wrote: Thu Mar 09, 2023 2:28 pm
doomzie wrote: Thu Mar 09, 2023 11:48 am 2/ Is it possible to do nested groups? I've tried some setups. It's not possible through UDMB since you can't set different tag IDs for the origin to group with, but through ACS you can set members with different tag IDs to a platform tag ID, right or am I wrong again :-/ ? I'm basically wondering, if you can define another "subgroup" of 3DP actors that you group with one of the unique member tag IDs of the group? I tried what I think should work, but it doesn't. So I need some confirmation on this.
No, it's not possible to have groups of groups. If you attempt to join any member from group A with any member of group B those two groups end up merging together as one group. It's done this way because it's easier to manage code-wise. And sorry, no, I don't intend to change that. You're going to have to get clever and be careful about that in order to get what you want.
I see, internally it becomes one group.. even if you work through ACS. Hence my confusion. Ok, then my latest attempts are simply not possible as is. No probs, and no I have no intention of messing with f_plat.acs.

Please, somebody clever code it in yo :P
FishyClockwork wrote: Thu Mar 09, 2023 2:28 pm
doomzie wrote: Thu Mar 09, 2023 11:48 am 3/ When you select multiple 3DP actors, it seems the labels are blank in the UDMB actor setting pop up window. It's not really a big problem, but was just wondering if you know what causes this?
If I understand you correctly, you're talking about the 5 actor arguments under the "Action / Tag/ Misc." tab, yes? If so, yeah that happens if you select multiple different subclasses of "FishyPlatform". That's a UDB problem. I don't have a workaround for that.
Yeah the tab with the arguments. I see. Might ask Boris about it on his Discord when I hop by.
FishyClockwork wrote: Thu Mar 09, 2023 2:28 pm
doomzie wrote: Thu Mar 09, 2023 11:48 am 4/ Attaching custom actors that have customizable features (with parameters). I see now what problem this causes. You can't access the parameters anymore of the custom actor in UDMB and you only see 3DP options. Looking at the limited space in the option window, I'm going to assume there's not even a work-around for this? Or is this then why you need the "custom parameters" window?
I mean, yeah, I've used up all 5 arguments and if I want more I either have to make it another bitfield option, or I have to use user variables (those have the "user_" prefix). You can see this with the Generic Platform class. If you want, you can redefine some or all of the 5 arguments for your own use cases? More info here:
https://zdoom.org/wiki/Editor_keys
I can't say anything about this, I've only recently understood there's possibly a maximum of 5 arguments, I noticed it in the scripting too.
The custom class I wanted to place on a platform is a fire actor with 5 arguments (enable smoke,enable embers, ...).
From your feedback I can't currently say if it's possible to do what I want to do.

Ok, I'll read that page and check Generic Platform. I haven't used it yet as it's not really clear to me what's it for.
FishyClockwork wrote: Thu Mar 09, 2023 2:28 pm EDIT: One more thing I forgot to mention, I've added three new ACS functions that, when used together, would allow you to control interpolation point based movement purely through ACS, you can dynamically change "speed" or even have them go backwards, or whatever whacky stuff you can think of.
They're called FishyPlat_Interpolate(), _NextNode() and _PrevNode().

Feel free to try to break them lol

There are test samples in TEST03
Ok, great! I'll check it out asap.

On another note, platforms can be pushable with the right 3DP flag and using the 'use key' as player. I still need to play with this, but this made me wonder if you can execute your custom scripting when the player uses 'use' or is pushing the platform the only thing you can do? Similarly, can platforms (actors) be 'bumpable' or whatever you call it? So it activates (or triggers a script) when you bump into the platform?
User avatar
Fishytza
Posts: 783
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by Fishytza »

https://zdoom.org/wiki/Actor_flags

There is a USESPECIAL actor flag that executes an actor's special when you press 'use' on it.
While BUMPSPECIAL will execute it when you bump into the actor.

Right now, by default the platform class does have BUMPSPECIAL set - that's how they're able to have specials executed when you step/land on them.

Not sure what "every single actor's AABB box is rigid" means, I'll have to do some more reading =)
I just meant that it doesn't ever rotate.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

Quick question in between everything I'm trying..

How exactly can I link the Seq property of "FishyPlatform" (with the ismoving play sound sequence code) to my own custom sound ?

Where are the sounds "Platform" and "Floor" defined (in demo platform classes).

DemoPlatWithSnd.Seq 'Platform';

I tried to define my own sound by adding a definition to SNDINFO:
3DPThingy "sounds/sound.wav"

Sound doesn't play, but no errors of any kind. Your sounds in the demo, where are they located? I checked doom2.wad as well.

Some input is needed. Thanks.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

FishyClockwork wrote: Fri Mar 10, 2023 12:57 am I just meant that it doesn't ever rotate.
Took the time to look at everything with RadiusDebug. Okay. Understood. Unfortunately I hadn't used it much as I can barely use it on my test map, even when I disable all options (very low frame rate). I'd keep it enabled all the time for map editing/testing, it's great, but it's simply not possible. Pitty.

Ok, so I've updated (internally 1.1.1e). No errors showed up on my test map and I've checked the new (8?) examples, in-game, map-wise and the new scripts. Will need some time to fully understand how exactly you have to use the new functions, but I'm really liking what I see so far. Dynamically reversing the editor predefined interpolation path and manipulating its speed as well is very much an upgrade of using 3DP with an interpolation path.

Played with the Pushable 3DP actor for the first time (was still todo). Interesting feature.

Also still need to look into AirFriction property, .. I suppose this affects the speed of moving platforms or makes enemies falls off maybe? I also saw some code for moving platforms in water? What is to be expected here?

I did get into some weird issue this weekend where I can't figure out why the while IsActive(platid) is not working somehow.
A while loop with 6 IsActive conditions should work no? It's like it's skipped and the rest of the code is executed (tids are ok of course).
Not sure what's going on here, I'll get back on this next time I give it another go.
User avatar
Fishytza
Posts: 783
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by Fishytza »

doomzie wrote: Mon Mar 13, 2023 10:13 am How exactly can I link the Seq property of "FishyPlatform" (with the ismoving play sound sequence code) to my own custom sound ?
That's using a SNDSEQ definition, not SNDINFO.
doomzie wrote: Mon Mar 13, 2023 10:13 am Where are the sounds "Platform" and "Floor" defined (in demo platform classes).
Those come in gzdoom.pk3's sndseq.txt file.
doomzie wrote: Mon Mar 13, 2023 10:34 am Also still need to look into AirFriction property, .. I suppose this affects the speed of moving platforms or makes enemies falls off maybe?
That's for no-gravity platforms that move via velocity. The lower that is the sooner it comes to a stop.
So a value of 1 means it will never stop until it hits something solid, like a wall.

"Velocity movement" means when you push the platform or when using SetActorVelocity on it or ThrustThing.
doomzie wrote: Mon Mar 13, 2023 10:34 am I also saw some code for moving platforms in water? What is to be expected here?
Nothing special. Just making sure it slowly sinks as it goes down (if it's subject to gravity.)
And triggers the splash actors if it hits the water hard enough. (Like any actor.)
You don't need to worry about that.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

FishyClockwork wrote: Mon Mar 13, 2023 12:51 pm
doomzie wrote: Mon Mar 13, 2023 10:13 am How exactly can I link the Seq property of "FishyPlatform" (with the ismoving play sound sequence code) to my own custom sound ?
That's using a SNDSEQ definition, not SNDINFO.
doomzie wrote: Mon Mar 13, 2023 10:13 am Where are the sounds "Platform" and "Floor" defined (in demo platform classes).
Those come in gzdoom.pk3's sndseq.txt file.
Sound Code:
Spoiler:
Actor moves, all seems fine, but no sound.
Sound plays ok with PlaySound() script in game.
SoundSequence() doesn't play the sound though, so something is wrong on my end, but after days of digging and trial and error I just don't know what to try anymore :)

Dynamic spline path ACS:
Also, I'm trying to build dynamic (spline) interpolation paths to basically avoid having to set a hundred IPs in the map as editor. However, I can't tell how you can set the Next Interpolation Point property of an Interpolation Point through ACS? Seems you can't do that through SetActorProperty(). If it can't be done currently, could the ACS functions be expanded to include SetNextPoint() for the "Platform Interpolation Point" class? edit: realized I also need the spawned PathFollower to be connected to a spawned IP. Mmm..
Last edited by doomzie on Tue Mar 14, 2023 1:12 pm, edited 3 times in total.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

Re: [ZScript] 3D Platform Actor (v1.1.1)

Post by doomzie »

FishyClockwork wrote: Fri Mar 10, 2023 12:57 am https://zdoom.org/wiki/Actor_flags

There is a USESPECIAL actor flag that executes an actor's special when you press 'use' on it.
While BUMPSPECIAL will execute it when you bump into the actor.

Right now, by default the platform class does have BUMPSPECIAL set - that's how they're able to have specials executed when you step/land on them.
Player Platform Interaction:
Okay, it's cause I was wondering if I can make the difference between:
1. "Player lands on platform" (handled through a "Special Holder" which points to a dummy actor with an action script), // uses BUMPSPECIAL flag
2. "Player bumps into the platform" (collides with the side of the platform)
3. "Player 'uses' (presses use) on/against platform"

So, 1 is already possible, 2 isn't possible cause BUMPSPECIAL is already used (I need to check if this triggers the special holder action script), 3 should work, but need to add USESPECIAL flag in my actor class..

Greetz
Last edited by doomzie on Tue Mar 14, 2023 2:30 pm, edited 1 time in total.

Return to “Script Library”