Dynamic PlayerPawn properties?

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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Dynamic PlayerPawn properties?

Re: Dynamic PlayerPawn properties?

by Matt » Sat Mar 16, 2019 11:50 am

Try putting in your playerpawn's Tick() somewhere and give it a try:

Code: Select all

if(player.cmd.buttons&BT_ZOOM)player.viewheight=viewheight*0.8*player.crouchfactor;
else player.viewheight=viewheight*player.crouchfactor; 
A correction to my previous post: best to only manipulate "player.viewheight" (a property of the player thinker) not "viewheight" (a property of the player pawn) since that's the way it's done in the crouching code.

Re: Dynamic PlayerPawn properties?

by lumbo7332 » Sat Mar 16, 2019 10:13 am

Matt wrote:You can change the viewheight property on the playerpawn, but I haven't checked how exactly it would interact with crouching.

EDIT: you may need to multiply the height by player.crouchfactor or something similar.
Can you do it dynamically based of in-game input?

Re: Dynamic PlayerPawn properties?

by Matt » Fri Mar 15, 2019 11:57 pm

You can change the viewheight property on the playerpawn, but I haven't checked how exactly it would interact with crouching.

EDIT: you may need to multiply the height by player.crouchfactor or something similar.

Dynamic PlayerPawn properties?

by lumbo7332 » Fri Mar 15, 2019 6:24 pm

I'm looking to be able to dynamically adjust the player's view height based on whether they are aiming down the sights of a rifle or not. Is this possible?

Top