Raised This Month: $51 Target: $400
 12% 

Setting eye angles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IceCucumber
Member
Join Date: Dec 2011
Old 10-25-2014 , 16:50   Setting eye angles
Reply With Quote #1

Hello,

I'm trying to basically turn a player around. Getting no errors, but this doesn't affect my view direction in the slightest.
Any ideas? Am I editing the correct vector? Is there a particular "eye angles vector" that I could edit with SetEntPropVector instead of using TeleportEntity?
Any help would be appreciated.

PHP Code:
new Float:eyeAngles[3];
GetClientEyeAngles(clienteyeAngles);

PrintToConsole(client"Current eye angles: %f %f %f"eyeAngles[0], eyeAngles[1], eyeAngles[2]);
PrintToConsole(client"Creating eye angles offset...");

eyeAngles[0] += 10.0;
eyeAngles[1] += 10.0;
eyeAngles[2] += 10.0;

PrintToConsole(client"Offset eye angles: %f %f %f"eyeAngles[0], eyeAngles[1], eyeAngles[2]);

PrintToConsole(client"Changing eye angles...");
TeleportEntity(clientNULL_VECTOReyeAnglesNULL_VECTOR);

GetClientEyeAngles(clienteyeAngles);
PrintToConsole(client"New eye angles: %f %f %f"eyeAngles[0], eyeAngles[1], eyeAngles[2]); 
And an example console print:
Quote:
Current eye angles: 6.009521 222.654418 0.000000

Creating eye angles offset...
Offset eye angles: 16.009521 232.654418 10.000000

Changing eye angles...
New eye angles: 6.009521 222.654418 0.000000

Last edited by IceCucumber; 10-25-2014 at 17:00. Reason: Improved the debug
IceCucumber is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-25-2014 , 17:50   Re: Setting eye angles
Reply With Quote #2

...doing any other way may screw up client prediction.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 10-25-2014 , 20:04   Re: Setting eye angles
Reply With Quote #3

Not sure why using TeleportEntity() fails to work, but you could try directly changing the m_angEyeAngles netprop on the client.
bl4nk is offline
IceCucumber
Member
Join Date: Dec 2011
Old 10-25-2014 , 21:09   Re: Setting eye angles
Reply With Quote #4

Thanks, no luck with m_angEyeAngles either. I was trying to do this for Neotokyo. Can't be bothered to set up a dedicated server for other games, but I'm pretty sure Neotokyo just doesn't support changing this. Oh well.
IceCucumber is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-27-2014 , 08:43   Re: Setting eye angles
Reply With Quote #5

There is no way to do this...
Only when crouched can you set it, otherwise it is reset every frame.
View height can be set with model scale.. But that also changes your bounds and some other things.
Valve really needs to make an input for view height for us, so we have proper height and csp. Or more preferred, a way to scale models while maintaining a separate sized collision hull.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 10-27-2014 , 17:35   Re: Setting eye angles
Reply With Quote #6

Quote:
Originally Posted by friagram View Post
There is no way to do this...
Only when crouched can you set it, otherwise it is reset every frame.[...]
wat

You can set the angles however you please.
If you want something more smooth you can hack around with setviewentity and viewcontrol entities.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-27-2014 , 22:04   Re: Setting eye angles
Reply With Quote #7

Oh, I totally misread this. I meant there is no way to set the view height. viewcontrol is crap and has CSP issues. Eyeposition is like.. hard coded into the mod AFAIK so that the shoot position is always calculated from some point on the collision hull. The only way to change that/view height is to change the hull, which is real bad.

To answer the original post, one of the thinks will get this done smoothly enough. Probably PreThink/PreThinkPost
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 10-27-2014 , 22:07   Re: Setting eye angles
Reply With Quote #8

Quote:
Originally Posted by friagram View Post
[...]To answer the original post, one of the thinks will get this done smoothly enough. Probably PreThink/PreThinkPost
Smoothly setting eye angles in think without any magic? Forget it. If the player moves around it will jerk around horribly.
Assuming we're talking about smooth "I am moving my head to look at X" transitions. But as said, if I'm not mistaken there's entities for that. Or the hacks I've mentioned above.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 10-27-2014 at 22:08.
Dr. Greg House is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-27-2014 , 22:12   Re: Setting eye angles
Reply With Quote #9

It depends on what you are doing. If you're trying to shake their screen or something to make them walk drunk, it's going to be really choppy doing it on a think. Then again, there are other things that can be used if you need a constant effect, like viewpunch -- that does not suffer from CSP.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 10-27-2014 , 22:16   Re: Setting eye angles
Reply With Quote #10

Quote:
Originally Posted by friagram View Post
It depends on what you are doing. If you're trying to shake their screen or something to make them walk drunk, it's going to be really choppy doing it on a think.[...]
My point exactly. Where would you use that?
Unless you can prevent the client from actually using the camera client-side you run into side-effects. Why would you want those?
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 10-27-2014 at 22:20.
Dr. Greg House is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode