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

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

Post by doomzie »

FishyClockwork wrote: Tue Aug 16, 2022 12:26 am
doomzie wrote: Mon Aug 15, 2022 5:01 pm I've now added a section with several skull cubes (platforms) moving horizontally with flags "add velocity when jumping" and/or "add velocity when stopping". ...
Ok, "add velocity when jumping away" was added because a friend of mine wanted somewhat realistic velocity physics. In this case, with that flag enabled, if you attempt to jump away in the opposite direction of where a platform is moving, what would happen is your velocity becomes 0 as soon as you lose contact with the platform. Technically what's going on is for every actor a platform loses, add some velocity based on the platform's movement to the lost actor. This is what it's supposed to mimic.


"Add velocity when stopping" was meant for things that move rather fast then "stop abruptly".
Please not that "stopping" means either A) reaching the last interpolation point or B) reaching a point with a defined "hold time" (to wait). When it "stops" it will add velocity to all its passengers based on its prior motion.
The effect this is supposed to achieve is throw off everything it was carrying if a very fast platform comes to a sudden stop.


As for the "crush obstacles" flag. It does nothing unless you give your platforms a defined crush damage (argument 4 under "Action / Tag / Misc." tab)
Normally when pushing away obstacles and they can't be pushed because the obstacle is against a wall it will receive crush damage.
If "always crush obstacles" is enabled crush damage is applied every time the obstacle is pushed away. That's the difference.
Think of a speeding truck (platform) hitting something. You'd want the truck to not only push away but also hurt whatever it's pushing away, right?
Add velocity when jumping : I see, so I completely misinterpreted that. I understand what you're saying, true physics ok, but in actuality it reduces velocity, when you jump in the opposite direction the platform is moving. That won't be obvious to the editor I think. If you jump in the direction of the moving platform, there is also no added velocity then? It will also cause the player to loose speed. This is idd what I saw, I jump off and when I reach some height, there is clearly a slow down of my speed happening, while I assumed I would get a speed boost. In the opposite direction I should basically fall straight down more or less, which is more realistic. I'll do some tests. So for jump/launch platforms, I have to not use "add velocity when jumping", but actually just "add velocity when stopping", which did work in my early tests I think, but haven't tested it enough.

Crush obstacles: oh okay, didn't see it had a parameter for crush damage. Great! Ok, makes sense to me.

update:
Ok, I've done more testing of jumping off my moving platform with flag "add velocity when stopping" and it does achieve the effect I was after, but you need to wait until the platform is effectively stopped (interpolation point needs to have a stop time > 0), you get the extra velocity and you fly off, and then you can still do a jump and have the velocity and height you need to bridge a large gap. I've noticed however that the platform needs to move really fast. I now have a model platform moving 712 pixels with otic 1 travel time and this allows the player to bridge a gap of 900 pixels. As an editor you have no indication of what you're going to achieve (how far the player may fall off), so trial and error is needed here, but I'm very pleased with what I'm seeing. No issues to report. I have not yet tested extreme values to see if anything pops up.

I tried to make more sense of it by polling the player's velocity in a OPEN script, so I have some indication of the numbers that are passed to your functions, but all I'm getting is zero zero zero.

Code: Select all

	int intVelocityX;
	int intVelocityY;
	int intVelocityZ;
	while (true) {
		intVelocityX=GetActorVelX(0);
		intVelocityY=GetActorVelY(0);
		intVelocityZ=GetActorVelZ(0);
		Print (s:"Player velocity: ",d:intVelocityX,s:" ",d:intVelocityY,s:" ",d:intVelocityZ);
		Delay(35);
	}
Is there some kind of debug/info mod that displays some primary information regarding the Player (like velocity, coordinates, ..) that editors use?
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

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

Post by Fishytza »

doomzie wrote: Tue Aug 16, 2022 5:15 am but you need to wait until the platform is effectively stopped (interpolation point needs to have a stop time > 0)
The "stopping" velocity is applied when it comes to a complete stop, yes. And not before. That's intentional.

doomzie wrote: Tue Aug 16, 2022 5:15 am I've noticed however that the platform needs to move really fast.
Yep. A fast moving platform that stops abruptly will throw things off, a slow moving one will only nudge/gently push things off. Because the applied velocity is based on the platform's direction and speed (before it stopped)

With that ACS script replace the d: with f: like so

Code: Select all

Print (s:"Player velocity: ",f:intVelocityX,s:" ",f:intVelocityY,s:" ",f:intVelocityZ);
Because those are fixed point numbers.
I'd also change the delay to 1 instead of 35.

By the way, in case you missed it, please check my last post of page 4. It's about the path follower errors.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

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

Post by doomzie »

Test session recordings of v1.1.0 versus v1.1.1 mashed together:

https://www.youtube.com/watch?v=iaeO597r_FI

Sit back, relax and enjoy.

3D floor bug is demonstrated at https://youtu.be/iaeO597r_FI?t=530 for example.

v1.1.1 starts at : https://youtu.be/iaeO597r_FI?t=1043

New behavior is demonstrated here https://youtu.be/iaeO597r_FI?t=1867 and here https://youtu.be/iaeO597r_FI?t=2141 for example.

Note: v1.1.1 section in the video also shows the improvement due to the ROTATION-CENTER flag in the model definition.

I need to point out that in the past two weeks it's become clear that I have some kind of graphics issue with gzdoom that is perhaps specific to my setup. The visual jitter is not just happening with FCW_Platform based models (when standing on them). It's now become pretty clear that I have something similar with any moving floor, 3D floor or regular. It just starts shaking. Now the visual jitter on the platform is somewhat different though, but maybe there is a link. So I apologize if this annoys you in the video. The only way for me to get rid of it was to use VULKAN instead of OpenGL. However, 3D Platform 1.1.1 requires gzdoom 4.8.2 and I now simply get VM errors opening my test map with VULKAN HW renderer.

IWANTBUG:

So I just looked at your IWANTBUG map and you're using Interpolation points. Do the same with Platform Interpolation Points and you will trigger the warning.
I made the same path as you did and I moved a demon along an identical path using Platform Interpolation Points (path not visible). I tested it and it worked. Then added a Path Follower to the first "Map Interpolation Point" (path still not visible) and I get the warning when I load the map and the Demon doesn't move. First thing I did was to add the "Map Interpolation Point" again so I can access it in UDB. That's all.

Some feedback regarding other points:

Ok, so it looks like a rookie mistake but I actually tried fixed point as well, so it must be another problem then. It displays "0 0 0" as well with fixed point. I've modified it, but don't know how to get it working so I can see the actual player speed. Not important, I'll try to find some examples online. I'm obviously doing something wrong.

By the way, I feel the velocity is not balanced horizontally and vertically (with add velocity when stopping). It's actually stronger vertically, contrary to what you would expect. You can more easily throw enemies/player high up in the air than throw them forward (horizontally). I'm not sure if it's an issue. I leave that up to you. I personally like a strong effect. It's quite cool.

I've done more extensive testing using platform to platform movement/collision (so no 3d floors involved) and I've noticed some minor issues popping up. It's like in certain cases you can have a cube against a cube, and one of the cubes will suddenly shoot "1x model heigth" higher, before it recovers again. I've noticed how low otic values create this case more rapidly, even though there is no clipping. The models keep moving around. The cubes are stopped next to each other and one shoots higher. Something weird happens when I'm using very low otic values for travel time (like otic = [1-4]).

I looked at the setup with the diagonally sliding cubes which caused the model to be dragged all the way to the floor and I repositioned the Map Interpolation Points and it's not happening anymore. Should have recorded that. Now that section is processing several cubes in a row and never hangs. Just saying.

If you don' t mind, I'd like to understand something, I'm using a mod which allows the player to "climb ledges", it's awesome, but it doesn't work on the skullcube (model). Is this something that would need to be changed in FCW_Platform or would it need to be done in the "ledge climb" function of the mod (EOA). Maybe it's not possible. Just asking.

Another thing I don't know the answer to, is how can I attach lighting to my platforms and make it move with the platform, because I can now add torches/candles on them, but seperate lights are placed above the model and not on the model. So the lighting stays in its place. Would be nice to have the ability to place something on the model with a X/Y/Z offset? If it's not possible, ok. Similarly, what about attaching a decoration to the side or bottom of a model? I know, it's all nice to have, and I don't know how possible/difficult it would be, but I though I'd give you this input already.

Final question, I want my cubes to do 360° rotations (using three interpolation points) around their center point and I cannot make them do the rotation without pauses, even though hold time is zero on every Map Interpolation Point. It's shown in the video where I'm pushing enemies into the skullcube crusher. The cubes don't rotate continuously. Haven't tried yet with regular. It's all new to me and I'm discovering as I'm learning about how to have perfect control over model movement and rotation. Maybe it's best to work with the ROTATING flag. Need some more time for testing.

By the way, check what happens at : https://youtu.be/iaeO597r_FI?t=4273 (?)
Last edited by doomzie on Fri Mar 03, 2023 10:01 am, edited 1 time in total.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

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

Post by Fishytza »

doomzie wrote: Wed Aug 17, 2022 8:36 pm So I just looked at your IWANTBUG map and you're using Interpolation points. Do the same with Platform Interpolation Points and you will trigger the warning.
Oh my god, now I understand what you've done. The chief problem was not ChangeStatNum() in itself. That just enforced all path followers to tick before all platforms (or "models" if you insist).

doomzie, please understand that "Platform Interpolation Point" known internally as "FCW_PlatformNode" is only ever meant to be used by subclasses of "FCW_Platform". Do not have PathFollower or subclasses of PathFollower target it because PathFollower and co. are old classes already defined in gzdoom. "Platform Interpolation Point" is only meant to be used by platforms.
Spoiler: Technical explanation on what went wrong
In case it's still not clear, let me put it another way.
PathFollowers should only target the old "Interpolation Points".
Platforms can target both "Interpolation Point" and "Platform Interpolation Point"


I haven't yet read the rest of your post, I will address the other points in a moment.
(I'll watch those videos first.)
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

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

Post by Fishytza »

doomzie wrote: Wed Aug 17, 2022 8:36 pm I need to point out that in the past two weeks it's become clear that I have some kind of graphics issue with gzdoom that is perhaps specific to my setup. The visual jitter is not just happening with FCW_Platform based models (when standing on them). It's now become pretty clear that I have something similar with any moving floor, 3D floor or regular. It just starts shaking. Now the visual jitter on the platform is somewhat different though, but maybe there is a link. So I apologize if this annoys you in the video. The only way for me to get rid of it was to use VULKAN instead of OpenGL. However, 3D Platform 1.1.1 requires gzdoom 4.8.2 and I now simply get VM errors opening my test map with VULKAN HW renderer.
I see what you mean by "visual jitter". I have a potato laptop where the exact same issue happens. And in the laptop's case I have to switch to the OpenGL ES renderer if I want to get rid of it.
On my main pc (which is considerably getting old, but is much less a potato) I don't get the jitter, and that's on the OpenGL renderer. Although I have recently switched to Vulkan renderer and to my surprise it works pretty well.
As for needing gzd 4.8.2, well I've been told it's a good practice to make sure users have the latest stable release of gzdoom, but you can change that yourself if you want. The very first line in the zscript.txt file. That is where the minimum version is determined.

doomzie wrote: Wed Aug 17, 2022 8:36 pm By the way, I feel the velocity is not balanced horizontally and vertically (with add velocity when stopping). It's actually stronger vertically, contrary to what you would expect. You can more easily throw enemies/player high up in the air than throw them forward (horizontally). I'm not sure if it's an issue. I leave that up to you. I personally like a strong effect. It's quite cool.
Tbh, after watching the video I don't really see an issue here. And considering Doom physics being what they are (apparenty the Z stuff is an afterthought or something?) I rather not mess with that part. If it works for you then that's good enough for me.

doomzie wrote: Wed Aug 17, 2022 8:36 pm I've done more extensive testing using platform to platform movement/collision (so no 3d floors involved) and I've noticed some minor issues popping up. It's like in certain cases you can have a cube against a cube, and one of the cubes will suddenly shoot "1x model heigth" higher, before it recovers again. I've noticed how low otic values create this case more rapidly, even though there is no clipping. The models keep moving around. The cubes are stopped next to each other and one shoots higher. Something weird happens when I'm using very low otic values for travel time (like otic = [1-4]).
I suspect it might have something to do with the code trying to have stuck actors that clip into the platform from the top pushed slighty upward so it "stands on it".
It's one of those little things I'm going to have to look into later after I think things through.

doomzie wrote: Wed Aug 17, 2022 8:36 pm If you don' t mind, I'd like to understand something, I'm using a mod which allows the player to "climb ledges", it's awesome, but it doesn't work on the skullcube (model). Is this something that would need to be changed in FCW_Platform or would it need to be done in the "ledge climb" function of the mod (EOA). Maybe it's not possible. Just asking.
I suspect that mod's ledge climbing logic only takes into account actual geometry. My platforms are actors masquerading as geometry; but they're still just actors.
As for which mod should check for the other: Both? Neither? It's kinda beyond the scope of this project.
If I am to code a special case to somehow make the ledge climbing think of a platform as something to climb on, I would not put that in the repo.

As a general rule, if you want to combine mods that aren't really compatible, you may have to do the work yourself. I'm sorry.

doomzie wrote: Wed Aug 17, 2022 8:36 pm Another thing I don't know the answer to, is how can I attach lighting to my platforms and make it move with the platform, because I can now add torches/candles on them, but seperate lights are placed above the model and not on the model. So the lighting stays in its place. Would be nice to have the ability to place something on the model with a X/Y/Z offset? If it's not possible, ok. Similarly, what about attaching a decoration to the side or bottom of a model? I know, it's all nice to have, and I don't know how possible/difficult it would be, but I though I'd give you this input already.
For that, make those decorations/lights etc subclasses of FCW_Platform. Then use the grouping feature.
To use the group feature all you need is to give one of these platforms its own TID and everyone else to point to that TID in the "Platform(s) To Group With" argument.

So for example, if your skull cube already has a TID of, let's say, 616 and you wanted to attach a bottom chandelier-like thing. Make the chandelier a subclass of FCW_Platform and set its "Platform(s) To Group With" argument to 616.

doomzie wrote: Wed Aug 17, 2022 8:36 pm Final question, I want my cubes to do 360° rotations (using three interpolation points) around their center point and I cannot make them do the rotation without pauses, even though hold time is zero on every Map Interpolation Point. It's shown in the video where I'm pushing enemies into the skullcube crusher. The cubes don't rotate continuously. Haven't tried yet with regular. It's all new to me and I'm discovering as I'm learning about how to have perfect control over model movement and rotation. Maybe it's best to work with the ROTATING flag. Need some more time for testing.
You should need only 2 interpolation points for that. Both pointing to each other as the "next point" and both having 180 degree difference in either angle/pitch/roll from each other. (One has angle 0 and the other has angle 180 for example). And of course 0 hold time on both.

doomzie wrote: Wed Aug 17, 2022 8:36 pm By the way, check what happens at : https://youtu.be/iaeO597r_FI?t=4273 (?)
Are you talking about the bit where the skull cube gets pushed up the 3D floor, then the cube vanishes? Yeah, unfortunately, that's the 3D floor workaround at work.
The platform has, uh, "registered" it can fit at wherever it is before the 3D floor pushed it up. Then when the floor went down the cube was trying to go to where it would have ended up if it wasn't pushed upwards (I suspect it's the interpolation movement logic at work here). I know it's ugly and weird, it basically teleported as soon as the 3D floor was out of the way.

-----------------------------------

Other things I've noticed is the passengers falling off of and getting stuck in the cubes a few times, I really need to rework that so that they don't fall off as much. Which means stepping back and thinking things over. Again.

And the few oddities here and there. Skull cubes slowing down, being blocked by stuff, especially when getting blocked by a zombie or whatever. Might be a good idea to give all cubes some crush damage. And perhaps I should reexaming the obstacle pushing code.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

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

Post by doomzie »

FishyClockwork wrote: Thu Aug 18, 2022 1:46 am
doomzie wrote: Wed Aug 17, 2022 8:36 pm So I just looked at your IWANTBUG map and you're using Interpolation points. Do the same with Platform Interpolation Points and you will trigger the warning.
doomzie, please understand that "Platform Interpolation Point" known internally as "FCW_PlatformNode" is only ever meant to be used by subclasses of "FCW_Platform". Do not have PathFollower or subclasses of PathFollower target it because PathFollower and co. are old classes already defined in gzdoom. "Platform Interpolation Point" is only meant to be used by platforms.
In case it's still not clear, let me put it another way.
PathFollowers should only target the old "Interpolation Points".
Platforms can target both "Interpolation Point" and "Platform Interpolation Point"
Well, it didn't generate a warning before. Haha. Ok, let's wrap it up then. I checked the demo map again and ok, it looks like I misinterpreted the last sentence of the Path Follower comment. In either case, let it be clear, I didn't actually use it. This was just something that was added for testing purposes ("to show it doesn't do anything") during my initial testing. I've never added it since. In the recent additions to the test map I've fully switched to "Interpolation Points", now all my new paths and points are visible, and it allows usage of Path Follower to display spline paths as well.

As you said, Map Interpolation Points provide ability to work with seconds and it allows you to set a Pitch in the action tab, but it's not that much of an issue to work with otics.

Or am I missing something?
Last edited by doomzie on Thu Aug 18, 2022 11:27 am, edited 1 time in total.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

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

Post by Fishytza »

Nah, you can use the old "Interpolation Point" class just fine.
Map Interpolation Points
*Platform Interpolation Points
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

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

Post by doomzie »

Some more feedback about previously discussed points:

360° rotation:
I can't get it to work for Pitch with Interpolation points. Point angle and Roll 360° continuous rotation works, with two points. Can you confirm to me that Pitch for models does not work with "Interpolation Points". Properties tab does nothing. The Action tab setting only does the rotation partly and then flips back the model to the original position. Pitching models only works for me with "Platform Interpolation Points" as far as I can tell.

direction of rotation:
How do you control the direction of the rotation? In the case of point angle for example, how do you turn (counter) clockwise. How do you make the difference?

weird minor issue:
The cube models with low octic travel times that "shoot up 1x model height" can't be due to stuck actors. Nothing is spawning there. They're the horizontal jump platforms. Don't worry about it, I'll double check it again. The models are perfectly aligned. I checked that multiple times. This was not in the recorded video, as the behavior is not present if I keep the octic value >= 4. If I make a recording again, I'll add it. I only used these extremely low octic values because I wanted more "add velocity", but it doesn't make that much difference.

difference vertical / horizontal add velocity when stopping:
I don't see any issue with the vertical add velocity. I think it's great to throw enemies in the air. Crossing the same distance horizontally seems a lot harder, that's the only thing I wanted to convey. If people would use them as "jump platforms", it's harder to tune horizontally than vertically. It's not an actual issue, it's more the way I wanted to use them. I think if you can attach "lighting" to the cube model, you can likely attach a "Thrust" thing as well. I'll probably go in that direction for extra velocity if I see I can't make it work.

crushable platforms:
I'm aware of the implications of not using the flag since the beginning. I've just tested it without the flag to see if everything behaves as expected. If it's not set, then the platform can get stuck against obstacles. In the video it's shown how this basically works really well. The new section is carefully designed crushable versus not crushable. If there's any issues with enemies actually getting stuck inside platforms because they're not crushable, it's not noticable to me to be honest. So far I can (almost) always understand why a platform is stuck.

In the new section I'm spawning enemies where a non crushable platform passes and I need to double check in detail what happens when the spawning happens when the model is just there over the map spots. I've done this explicitly to see if such a design would trigger a potential bug.

The only issues that I see are almost always due to platforms sliding against other platforms or regular architecture. Now, the enemies are often pushed off the static 3D floors up in the air, but if the colliding platform is crushable, it will over time have crushed the enemies on the adjacent floor it passes, while in theory there should be no contact, unless a sporadic 'bump' happens.

I'm aware that making my platforms slide against each other on the pixel (without any actual collision though) is what creates these minor issues. Keeping distance between 3D platforms and (3D) floors is probably advisable for now, unless you understand well what may happen.

ledge climbing (EOA and other mods) on FCW_Platform actors:
Regarding the ledge climbing on FCW_Platform based actors, I want you to know I'm not asking for you to do anything about it. It's out of scope. I agree. You still need to take your long break. I haven't forgotten. I just wanted to know in which direction I had to look code-wise and basically if it's feasible. Reason is it would really trip up (EOA) players who will naturally expect that to work. Since the platforms just look like regular architecture. Hence, I've been experimenting with a function that uses a "ThinkerIterator" and Distance3D() in the actor class based on FCW_Platform. About 10 levels above my current skill, but whatever. I do believe I've seen a first glance of what will be required to trigger the "LedgeClimb" functionality when player reaches/touches the upper surface outer edge. Good enough for me, for now. Too complicated for me to spend any further time on.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

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

Post by Fishytza »

doomzie wrote: Sun Aug 21, 2022 7:11 am 360° rotation:
I can't get it to work for Pitch with Interpolation points. Point angle and Roll 360° continuous rotation works, with two points. Can you confirm to me that Pitch for models does not work with "Interpolation Points". Properties tab does nothing. The Action tab setting only does the rotation partly and then flips back the model to the original position. Pitching models only works for me with "Platform Interpolation Points" as far as I can tell.
For some reason I don't understand, the old "Interpolation Point" class clamps its pitch so it's not lower than -89 and not higher than 89 which might explain why you have that issue.
"Platform Interpolation Point" doesn't clamp its pitch.

doomzie wrote: Sun Aug 21, 2022 7:11 am direction of rotation:
How do you control the direction of the rotation? In the case of point angle for example, how do you turn (counter) clockwise. How do you make the difference?
With interpolation points? You don't. You'd have to use the Move() ACS utility function, called by ScriptCall().
For example, here's a ACS script that makes a platform rotate indefinitely clockwise. (It rotates by angle).

Code: Select all

//Taken from MAP01's SCRIPTS lump
script "SpinningThingInPool" OPEN
{
	ScriptCall("FCW_Platform", "Move", 20, 0, 0, 0, false, 35*6, -360.0); //Rotate
	while (ScriptCall("FCW_Platform", "IsActive", 20))
		Delay(1);
	Restart;
}
Negative values (eg. -360.0) make it rotate clockwise; positive values rotate counter-clockwise.
(For more info on what Move() does, check the thread OP. Look in the "More details" spoiler, then look inside the "ACS util" spoiler.)

doomzie wrote: Sun Aug 21, 2022 7:11 am weird minor issue:
The cube models with low octic travel times that "shoot up 1x model height" can't be due to stuck actors. Nothing is spawning there. They're the horizontal jump platforms. Don't worry about it, I'll double check it again. The models are perfectly aligned. I checked that multiple times. This was not in the recorded video, as the behavior is not present if I keep the octic value >= 4. If I make a recording again, I'll add it. I only used these extremely low octic values because I wanted more "add velocity", but it doesn't make that much difference.
8 octics equals 1 second so 4 octics is half of a second. Weird things tend to happen when they move ultra fast.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

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

Post by doomzie »

FishyClockwork wrote: Sun Aug 21, 2022 10:53 am
doomzie wrote: Sun Aug 21, 2022 7:11 am 360° rotation:
I can't get it to work for Pitch with Interpolation points. Point angle and Roll 360° continuous rotation works, with two points. Can you confirm to me that Pitch for models does not work with "Interpolation Points". Properties tab does nothing. The Action tab setting only does the rotation partly and then flips back the model to the original position. Pitching models only works for me with "Platform Interpolation Points" as far as I can tell.
For some reason I don't understand, the old "Interpolation Point" (IP) class clamps its pitch so it's not lower than -89 and not higher than 89 which might explain why you have that issue.
"Platform Interpolation Point" (PIP) doesn't clamp its pitch.
Thank you sir. Exactly what I'm seeing. It was driving me up the wall. I set it for 180 pitch and all I saw was a 90 rotation.
If anyone knows the reason for this, let us know. It feels inconsistent and trips you up as an editor. No warning or indication whatsoever.
So you effectively can't do 360 pitch rotation with IPs. Ok, thanks for confirming.

So this makes it necessary to use PIPs after all if you include a (>90°?) pitch rotation in your pathway, right?
FishyClockwork wrote: Sun Aug 21, 2022 10:53 am
doomzie wrote: Sun Aug 21, 2022 7:11 am direction of rotation:
How do you control the direction of the rotation? In the case of point angle for example, how do you turn (counter) clockwise. How do you make the difference?
With interpolation points? You don't. You'd have to use the Move() ACS utility function, called by ScriptCall().
For example, here's a ACS script that makes a platform rotate indefinitely clockwise. (It rotates by angle).

Code: Select all

//Taken from MAP01's SCRIPTS lump
script "SpinningThingInPool" OPEN
{
	ScriptCall("FCW_Platform", "Move", 20, 0, 0, 0, false, 35*6, -360.0); //Rotate
	while (ScriptCall("FCW_Platform", "IsActive", 20))
		Delay(1);
	Restart;
}
Negative values (eg. -360.0) make it rotate clockwise; positive values rotate counter-clockwise.
(For more info on what Move() does, check the thread OP. Look in the "More details" spoiler, then look inside the "ACS util" spoiler.)
Ok, but you can't do that through the editor, right? I tried negative values, but it's always converted back to positive.
But clockwise rotation for sectors and linedefs in the editor is done with negative values, I understand that obviously.
So, through the editor you only get the default actor rotation, which is counter-clockwise.

Looks like I'll be moving to ACS now for my next endeavours in model movement control.

grouped 3D platform actors (models):
Give me some time, the next exercises will require some effort to master (grouped model bridge movement with ACS, disappearing 3DP floor, wobbly 3DP floor, ...).

I've designed a few concepts for grouped models and did some tests, but what I had in mind was too advanced. I'm confronted with the implications of the vertical "rectangular cuboid" hitbox around the FCW_Platform actors (or any). I'll see if I can come up with something basic, but still cool.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

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

Post by Fishytza »

Ok, I've just pushed to the repo a workaround to GZDoom's inability to rotate an actor's hitbox when that actor's angle changes.
It should make passengers be less likely to fall off when platforms rotate (angle changes).

doomzie, please fetch the latest commit and see if it helps with monsters falling off.
User avatar
Fishytza
Posts: 788
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

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

Post by Fishytza »

Just a heads-up. A couple of more commits were added and it's likely that more will follow. Sorry for the inconvenience.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

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

Post by doomzie »

Ok, great, time to update.

I'll make some time to see how the new code behaves in terms of enemies falling off the platforms.


Short 4 min clip : [youtube]https://www.youtube.com/watch?v=Ef4iTihg21s[/youtube] (1.1.1 version not updated yet)

I'm managing quite well with the ACS routines.

However, I'm struggling a lot with getting textures loaded on models. I've spent (lost) more time on this than on anything else so far. Nothing to do with 3D Platform of course.

I've got one Laser Turret model with a single "grey" (diffuse) texture that loads fine, it's in a 3D Platform group and all is well afaik. You can briefly see it in the vid. Model is not animated though. A litle test of what could be possible for a "3D Platform group with defense weapons attached to it". Works well. I should be capable of making the laser turret fire, right? Anyhow, not my main concern.

I've got two skull models though with textures issues:
- The old skull (previously pink) only loads the texture on the bottom of the skull, but not the top.
- The new skull doesn't load the PBR material .png textures at all, although all files are present.

The .obj files are properly edited, all locations are good, et cetera.
It's not perfectly clear what type of image is really supported, so I tried converting, resizing resolution, decreasing color depth, compressing and no bueno.
I think my definitions are fine, it's hard to find clear information, but I've found some rare examples here and there.
So yeah the models are visualized with a flat .png that does work (for now) or some standard color the engine creates.
Last edited by doomzie on Fri Aug 26, 2022 3:12 pm, edited 2 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 (v1.1.0)

Post by Fishytza »

doomzie wrote: Fri Aug 26, 2022 10:47 am I should be capable of making the laser turret fire, right?
Yep. You can define them like regular actors with a "States" block no problem.

Unfortunately, I can't help you with the textures issue; I'm not really an expert on that. Hell, the only thing I know how to do is turn map geometry into models (via UDB).

Also, I was planning on making the next release on Sunday (ish), 28th August (ish). If any more bugs or odd things turn up, don't hesitate to post about it.
doomzie
Posts: 94
Joined: Sat Apr 30, 2022 4:26 am

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

Post by doomzie »

FishyClockwork wrote: Fri Aug 26, 2022 12:12 pm Also, I was planning on making the next release on Sunday (ish), 28th August (ish). If any more bugs or odd things turn up, don't hesitate to post about it.
As you wish.

Three short recordings mashed together running the updated platform-base.zs 1.1.1+ (I updated all files that were recently changed to be sure).

[youtube]https://youtu.be/ry5AEbSWP6w[/youtube] (HD is still processing)

Return to “Script Library”