Raised This Month: $ Target: $400
 0% 

Landing slowdown


Post New Thread Reply   
 
Thread Tools Display Modes
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-04-2012 , 15:08   Re: Landing slowdown
Reply With Quote #51

Try debugging the values, that will tell you which condition didn't get through.
Backstabnoob is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-04-2012 , 15:27   Re: Landing slowdown
Reply With Quote #52

Quote:
Originally Posted by Backstabnoob View Post
Try debugging the values, that will tell you which condition didn't get through.
lol yeah....that's on my to-do list. I'm just pretty busy today so any shortcuts i can get, i'll take.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-04-2012 , 15:38   Re: Landing slowdown
Reply With Quote #53

This is how variable should be declared :

new Float:speedCache[33][3]


This is how it should be filled :

pev(victimID, pev_velocity, speedCache[victimID])


And how it should be set (was already correct) :

set_pev(victimID, pev_velocity, speedCache[victimID])


If you only use speedCache in TakeDamage pre and post, you don't need to make a player array.

You can do :

new Float:speedCache[3]

pev(victimID, pev_velocity, speedCache)

set_pev(victimID, pev_velocity, speedCache)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-04-2012 , 16:00   Re: Landing slowdown
Reply With Quote #54

Few questions about that....
1. I thought velocity was a scalar? What are the 3 values in the array? This explains the strange numbers i got from it...and how SDK was talking about pev->velocity.Length()
2. If there are two people getting attacked with the same power at the same time, wouldn't there be a data leak if it isn't in a player array? Or am i thinking of timing being way too immediate? i.e. the engine would never fire player1->TakeDamagePre player2->TakeDamagePre player1->TakeDamagePost player2->TakeDamagePost (if that example makes sense)
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-04-2012 , 16:13   Re: Landing slowdown
Reply With Quote #55

1. because C/C++ can handle vectors, pawn can not.
Normalize in pawn is xs_vec_normalize

2. Can't happen, don't worry.
The only problem could be a plugin that would, inside a TakeDamage hook, cann ExecuteHamB(Ham_TakeDamage
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-04-2012 , 16:17   Re: Landing slowdown
Reply With Quote #56

Quote:
Originally Posted by ConnorMcLeod View Post
1. because C/C++ can handle vectors, pawn can not.
Normalize in pawn is xs_vec_normalize

2. Can't happen, don't worry.
The only problem could be a plugin that would, inside a TakeDamage hook, cann ExecuteHamB(Ham_TakeDamage
So velocity is a vector? Good to know....

And if it is possible for an external plugin to mess with it via ExecuteHamB, i think i'll take a little extra efficiency for more security.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-04-2012 , 16:19   Re: Landing slowdown
Reply With Quote #57

In fact, if the array is [33] or not, a plugin calling TakeDamage gonna make the same dysfunctionnement.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-04-2012 , 16:19   Re: Landing slowdown
Reply With Quote #58

Quote:
Originally Posted by Liverwiz View Post
So velocity is a vector? Good to know...
Bitch please... http://forums.alliedmods.net/showthread.php?t=91474
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-04-2012 , 16:29   Re: Landing slowdown
Reply With Quote #59

Quote:
Originally Posted by ConnorMcLeod View Post
In fact, if the array is [33] or not, a plugin calling TakeDamage gonna make the same dysfunctionnement.
Oh. Ok....So i'll just keep the indexing down, won't i?
Quote:
Originally Posted by meTaLiCroSS View Post
LOL! thanks for that.


EDIT: ok....after reading metalicross' post about velocity and stuffs i got all bruit force about it. Forcing the set of speed AND velocity to be equal. But it still doesn't work
This is the code that i currently have. But it still isn't working. Am i missing anything crazy?
Code:
    new Float:g_vect_velCache[3]	// it would seem velocity is a vector
    new Float:g_speedCache
// TakeDamagePre
			// This is bruit force as a mother fucker
		pev(victimID, pev_velocity, g_vect_velCache)
		pev(victimID, pev_speed, g_speedCache)

// TakeDamagePost
		set_pev(victimID, pev_velocity, g_vect_velCache)
		//set_pev(victimID, pev_speed, g_speedCache)
			// That didn't work....lets be a dick abuot it
		set_pev(victimID, pev_speed, vector_length(g_vect_velCache) )
In all my logging i also noticed that in pre it set velocity as 0.00000 like seriously....this is blowing my mind. If i can get a velocity, shouldn't i logically get a speed as well?

In good news....i stopped the knockback with this code. When i get attacked in the air i just stop, rather than fly backwards. But, honestly, this is the case in most situations, so it isn't much of an accomplishment.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 08-05-2012 at 01:26.
Liverwiz 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 06:36.


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