Pitch and Roll - how?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Pitch and Roll - how?

Postby Enjay » Tue Aug 13, 2019 3:55 pm

I notice in the GZDB UDMF tings dialogue that there are options to set the pitch and roll of an actor.

The problem is, I can't seem to get any placed actors to appear any different regardless of how I set these. The actors concerned are just very simple 1 frame static actors with models attached. What do I need to do to get the actor to appear differently when they spawn? Are there some flags I'm missing or something? I know it must work because I've seen other people saying they have used the feature.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Pitch and Roll - how?

Postby AFADoomer » Tue Aug 13, 2019 6:58 pm

Model-based actors have to have USEACTORPITCH and/or USEACTORROLL specified in MODELDEF.

If your actors were sprite-based, the actor class would have to be flagged with +FLATSPRITE to be affected by pitch, and +ROLLSPRITE to be affected by roll.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: Pitch and Roll - how?

Postby Enjay » Tue Aug 13, 2019 7:47 pm

Perfect! That's exactly the information I needed. I've got it working now. :)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Pitch and Roll - how?

Postby Enjay » Wed Aug 14, 2019 4:25 am

It's worth pointing out that, quite often, a model that is set to work well in its normal orientation will not work as well when pitched/rolled.

Image

However, in this particular instance, the fix was easy enough. UDMF allows individual objects to have their gravity changed (in the Action/Tag/Misc tab of the GZDB things editor). The chairs are non-blocking so all I had to do was set gravity to 0 and move their z position up a few units.

Image


[edit]Hmmm, I wonder if changing "Rotation-Center" would also address this? Need to check...[/edit]
[edit2]Nah, it wasn't particularly useful (in this case anyway).[/edit2]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Pitch and Roll - how?

Postby Enjay » Wed Aug 14, 2019 7:31 am

Perhaps related, perhaps not...

Is there any way in GZDoom for actors to be set to automatically align with the plane that they are standing on. Risen3D has this ability and while this screenshot may be a bit amusing in the way it looks, it does show the principle (BTW, these guys were vertically oriented until I killed them):



So, is there an actor/modeldef flag that allows this (can't see one) or would any actors need their pitch/roll set manually instead? I'm mainly thinking about static decorations that would be placed on a slope and stay there.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Pitch and Roll - how?

Postby Caligari87 » Wed Aug 14, 2019 9:25 am

There's no built-in option that I know of, but a few people have accomplished this by using z-checks / line traces at the corners of the actor's bounding box to set pitch / roll / angle appropriately. I think BoA uses it for tanks, for example.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Pitch and Roll - how?

Postby Enjay » Wed Aug 14, 2019 12:42 pm

Caligari87 wrote:I think BoA uses it for tanks, for example.

I've checked out the repository and there does indeed seem to be something in the zscript that handles this. Too complicated for me to make much sense of though because it's all wrapped up in other stuff to do with tank movement. I'd only need if for a static item, but I'd struggle to isolate only the bits of code that I need.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Pitch and Roll - how?

Postby AFADoomer » Sun Sep 08, 2019 1:07 pm

Sorry to bump...

@Enjay - What you are looking for is the SetPitchRoll function here. You probably also will need to delete line 21, but I'm pretty sure everything should work out of the box as-is - If the actor won't ever move, just call the function once in PostBeginPlay(), otherwise you can call it in Tick() for continuous updating, or once in the Death state if you want to emulate your example above.
User avatar
AFADoomer
 
Joined: 15 Jul 2003


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest