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.
Post Reply
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Pitch and Roll - how?

Post by Enjay »

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
AFADoomer
Posts: 1322
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Pitch and Roll - how?

Post by AFADoomer »

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
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Pitch and Roll - how?

Post by Enjay »

Perfect! That's exactly the information I needed. I've got it working now. :)
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Pitch and Roll - how?

Post by Enjay »

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
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Pitch and Roll - how?

Post by Enjay »

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
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Pitch and Roll - how?

Post by Caligari87 »

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
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Pitch and Roll - how?

Post by Enjay »

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
AFADoomer
Posts: 1322
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Pitch and Roll - how?

Post by AFADoomer »

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.
Post Reply

Return to “Mapping”