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

Long grenades v1.3


Post New Thread Reply   
 
Thread Tools Display Modes
thEsp
BANNED
Join Date: Aug 2017
Old 06-29-2019 , 13:13   Re: Long grenades v1.1
Reply With Quote #11

v1.2 (6/29/2019) - Fixed a issue, now fully supported by AMXX < 1.8.2
thEsp is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-29-2019 , 19:22   Re: Long grenades v1.2
Reply With Quote #12

Also keep in mind speed is not the same as velocity

PHP Code:
stock bool:min_speed(entity,Float:X,Float:Y,Float:Z)
{
        static 
Float:velocityVec[3], Float:speedVec[3];
        
pev(entity,pev_velocity,velocityVec);
        
speedVec[0] = floatabs(velocityVec[0]); floatabs(X);
        
speedVec[1] = floatabs(velocityVec[0]); floatabs(Y);
        
speedVec[2] = floatabs(velocityVec[0]); floatabs(Z);
        return (
speedVec[0] >= && speedVec[1] >= && speedVec[2] >= Z);


I still don't understand why do you need the speed check like that makes no sense.


Better for you to check the direct speed of the nade instead of checking each axis
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-29-2019 at 19:45.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thEsp
BANNED
Join Date: Aug 2017
Old 06-30-2019 , 02:24   Re: Long grenades v1.2
Reply With Quote #13

I only named it speed nonetheless it is supposed to capture velocity, it does matter since that checks if grenades are about to be stopped.
thEsp is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-30-2019 , 03:43   Re: Long grenades v1.2
Reply With Quote #14

You are not doing it correctly thats doesn't tell if the nade is slowing down because you are checking velocity in specific axis you need to get the direct speed
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-30-2019 at 03:46.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thEsp
BANNED
Join Date: Aug 2017
Old 06-30-2019 , 03:55   Re: Long grenades v1.2
Reply With Quote #15

How so? I guess there's no reason at all why it still works.
Axis speed is more accurate in this case.

Last edited by thEsp; 06-30-2019 at 04:38.
thEsp is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-30-2019 , 05:48   Re: Long grenades v1.2
Reply With Quote #16

What if I throw the nade downward and in the Y axis with speed below 50 unit. It will explode in my face.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-30-2019 , 06:08   Re: Long grenades v1.2
Reply With Quote #17

^can't have negative Z velocity on the ground


A grenade is stopped when all directional velocity is at 0, no idea why did you choose these negative values in particular though.
__________________

Last edited by <VeCo>; 06-30-2019 at 06:08.
<VeCo> is offline
thEsp
BANNED
Join Date: Aug 2017
Old 06-30-2019 , 07:05   Re: Long grenades v1.2
Reply With Quote #18

<VeCo> during debugging, I noticed that grenades when they're about to explode can have negative axis in velocity vector. The point of the plugin is to make grenades behave like the default SGs, which explode when they have a bit of speed, so 0 vector length is optional; that's why I made definitions, some users might not like defaults.

Last edited by thEsp; 06-30-2019 at 07:09.
thEsp is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-21-2019 , 13:44   Re: Long grenades v1.2
Reply With Quote #19

Your min_speed function is weird and even if it made sense I doubt your regular server owner would know what values to put there.

Looking at the smokegrenade logic, I see the only condition for it to explode if it's the smokegrenade is on the ground, no speed check. Also when the smokegrenade hits the ground the velocity is set to 95% of the current velocity.
https://github.com/s1lentq/ReGameDLL...enade.cpp#L791
(line 801 and line 816)

If you want to mimic the sg functionality that's what you should do. Reduce velocity when the nade is on ground and prevent explosion until the nade hits the ground.
If you stil want a speed check, why don't you check speed directly(sqrt of velocity[0]^2 + velocity[1]^2 + velocity[2]^2)?
__________________
HamletEagle is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-31-2019 , 12:30   Re: Long grenades v1.2
Reply With Quote #20

Unapproved for now. If you decide to make the changes please let me know.

If you do not understand what I said or you have something else in mind please let me know. Everything can be discussed.
__________________
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 07:40.


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