Raised This Month: $32 Target: $400
 8% 

Setting player velocity?


Post New Thread Reply   
 
Thread Tools Display Modes
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 01-08-2014 , 15:36   Re: Setting player velocity?
Reply With Quote #11

There's two different standards as to how to name the ordinates.

Valve uses uses x (0) and y (1) "on the ground" and z (2) for height.
__________________
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
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 01-08-2014 , 20:16   Re: Setting player velocity?
Reply With Quote #12

Quote:
Originally Posted by NIGathan View Post
By x,y, and z do you mean 0,1, and 2 relatively?
Yes.

Quote:
Originally Posted by NIGathan View Post
Also I believe setting the m_vecBaseVelocity will alter the m_vecVelocity based off what you give it. It won't actually change it to what you set. So for example:

m_vecVelocity is currently 42,42,0.
If you change the m_vecBaseVelocity to -42,-42,0 then the player will actually have no velocity at all.

If you are trying to actually set the velocity then set m_vecVelocity.
I tried using m_vecVelocity, but nothing happend. Sounds like this is what I would want though.

My main issue comes from having to lift the player off the ground, to bypass the 520 hu/s cap.
CoolJosh3k is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 01-08-2014 , 20:33   Re: Setting player velocity?
Reply With Quote #13

Take a look at what the sdk does in "TeleportEntity".
__________________
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
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 01-09-2014 , 02:19   Re: Setting player velocity?
Reply With Quote #14

Quote:
Originally Posted by Dr. Greg House View Post
Take a look at what the sdk does in "TeleportEntity".
I shall. The [2] part of m_vecBaseVelocity is rather useful, expect that it also takes player height into account.

Is there any tricks anyone knows that will allow us to bypass the 520 speed limit, while keeping the vertical velocity at 0.0? My thought is to hover the player up 16hu + set velocity to zero, then apply the changes. If I can do this in 2 frames, the player would only encounter problems if they were 16hu below an brush.
CoolJosh3k is offline
NIGathan
Senior Member
Join Date: Aug 2011
Location: /dev/null
Old 01-09-2014 , 03:05   Re: Setting player velocity?
Reply With Quote #15

Afaik there is no way to go faster than the max, however, I don't think 520 is the max.

Have you tried this:
PHP Code:
new Float:vec[3] = {0.0,0.0,16.0};
TeleportEntity(clientNULL_VECTORNULL_VECTORvec); 
NIGathan is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 01-09-2014 , 18:27   Re: Setting player velocity?
Reply With Quote #16

I am guessing that if I do that, then after 0.1 seconds increase the players x,y velocity. How small can a timer be made anyway (how many frames until timers can trigger)?

If I can alter the player height with velocity, then the game should have no issues with collision detection.

Also, I cannot find how the Teleport function works. Where is the best place to see this code?

edit:..

From testing it looks like the Medic's speed is capped at 300.8 under normal movement conditions. This makes me think of a very simple fix: change the speed cap to 9001, then back to normal after. Anyone know the exact property to tweak for this offhand? I shall begin searching for it.

Last edited by CoolJosh3k; 01-09-2014 at 19:42.
CoolJosh3k is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 01-09-2014 , 21:46   Re: Setting player velocity?
Reply With Quote #17

http://hg.alliedmods.net/hl2sdks/hl2...tity.cpp#l3969
__________________
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
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 01-10-2014 , 01:30   Re: Setting player velocity?
Reply With Quote #18

Quote:
Originally Posted by Dr. Greg House View Post
Ah, thankyou.

Unfortunately this doesn't help me much, as writing a mod using C+ like that is beyond my current abilities.

update:
Found what might allow me to avoid having to change the vertical position/velocity: 'm_flMaxspeed'. Will test soon.

Last edited by CoolJosh3k; 01-10-2014 at 01:32.
CoolJosh3k is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 01-10-2014 , 03:17   Re: Setting player velocity?
Reply With Quote #19

Dagnammit!
Setting m_flMaxspeed to 9001.0, only changes it from 300.8 to 520.

I also tried the m_vecVelocity properly (used 9001.0), but after using
PHP Code:
SetEntPropFloat(clientProp_Data"m_vecVelocity[0]"value); 
I get the error:
Code:
Native "SetEntPropFloat" reported: Property "m_vecVelocity[0]" not found (entity 1/player)
Come to think of it, the Demoman can bypass this when charging. Perhaps we can use a trick related to this?

Last edited by CoolJosh3k; 01-10-2014 at 03:22.
CoolJosh3k is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 01-10-2014 , 06:16   Re: Setting player velocity?
Reply With Quote #20

Because there is no float m_vecVelocity[0] prop. There is only vector m_vecVelocity prop which can be set by
PHP Code:
decl Float:vecCurrentVel[3];
GetEntPropVector(clientProp_Data"m_vecVelocity"vecCurrentVel);
vecCurrentVel[0] = 9001.0;
SetEntPropVector(clientProp_Data"m_vecVelocity"vecCurrentVel); 
Untested, only based on your data.
xf117 is offline
Send a message via ICQ to xf117
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 01:31.


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