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

Parachute accelerate | Map's Highest Point


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-09-2018 , 19:44   Parachute accelerate | Map's Highest Point
Reply With Quote #1

Hello!

I got a few questions:

1) Is there any way to change the current parachute accelerate? It's so pathetic, you can't even accelerate when you have it on. I'd like to make the acceleration more sensitive.
2) I remember (not sure) there was a thread where someone asked for a method to find map's highest point, but I failed to find it, I need to retrieve the highest available point in the map to spawn a player.

Thanks in advance!
__________________

Last edited by edon1337; 01-09-2018 at 19:45.
edon1337 is offline
Hey
Member
Join Date: Dec 2017
Old 01-09-2018 , 20:31   Re: Parachute accelerate | Map's Highest Point
Reply With Quote #2

2. this maybe ?
PHP Code:
stock get_max_z(indexFloat:point[3])
{
    new 
Float:aimorigin[3], Float:origin[3], Float:vangles[3], Float:fov
    
    
// you'll want to replace aimorigin with the victim's origin
    
fm_get_aim_origin(indexaimorigin)
    
    
pev(indexpev_originorigin)
    
pev(indexpev_view_ofsvangles// view offset for killer's eye's origin
    
origin[0] += vangles[0]
    
origin[1] += vangles[1]
    
origin[2] += vangles[2]
    
    
pev(indexpev_fovfov)
    
fov /= 1.5 // for some reason this works well, but theoretically it should be 2.0
    
    
pev(indexpev_v_anglevangles
    
vangles[0] *= -1.0 // this is done because looking up angle < 0, level angle = 0, looking down angle > 0
    
    
point[0] = aimorigin[0]
    
point[1] = aimorigin[1]
    
// magic calculations brought to you by my brain + some guesswork
    
point[2] = aimorigin[2] + get_distance_f(aimoriginorigin) * floatsin(fov M_PI 360) / floatsin((180 vangles[0] - fov) * M_PI 360)
    
    
// this is better than nudging the entity straight down
    // it will do a traceline between the killer's head and the desired
    // point, and it will stop when it hits a wall or ceiling or whatever
    
new tr create_tr2()
    
engfunc(EngFunc_TraceLineoriginpointDONT_IGNORE_MONSTERSindextr)
    
get_tr2(trTR_vecEndPospoint)
    
free_tr2(tr)
    
    
    
// just in case we end up outside the map, move the point closer to the killer
    
new pc engfunc(EngFunc_PointContentspoint)
    while(
pc == CONTENTS_SOLID || pc == CONTENTS_SKY)
    {
        
point[0] += (origin[0] - point[0]) * 0.05
        point
[1] += (origin[1] - point[1]) * 0.05
        point
[2] += (origin[2] - point[2]) * 0.05
        pc 
engfunc(EngFunc_PointContentspoint)
    }

Code from here: https://forums.alliedmods.net/showthread.php?t=79675

Last edited by Hey; 01-09-2018 at 20:32. Reason: link
Hey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-09-2018 , 21:31   Re: Parachute accelerate | Map's Highest Point
Reply With Quote #3

Sure! You can edit your parachute plugin however you would like it to work.
__________________
fysiks is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-10-2018 , 07:45   Re: Parachute accelerate | Map's Highest Point
Reply With Quote #4

Quote:
Originally Posted by Hey View Post
2. this maybe ?
PHP Code:
stock get_max_z(indexFloat:point[3])
{
    new 
Float:aimorigin[3], Float:origin[3], Float:vangles[3], Float:fov
    
    
// you'll want to replace aimorigin with the victim's origin
    
fm_get_aim_origin(indexaimorigin)
    
    
pev(indexpev_originorigin)
    
pev(indexpev_view_ofsvangles// view offset for killer's eye's origin
    
origin[0] += vangles[0]
    
origin[1] += vangles[1]
    
origin[2] += vangles[2]
    
    
pev(indexpev_fovfov)
    
fov /= 1.5 // for some reason this works well, but theoretically it should be 2.0
    
    
pev(indexpev_v_anglevangles
    
vangles[0] *= -1.0 // this is done because looking up angle < 0, level angle = 0, looking down angle > 0
    
    
point[0] = aimorigin[0]
    
point[1] = aimorigin[1]
    
// magic calculations brought to you by my brain + some guesswork
    
point[2] = aimorigin[2] + get_distance_f(aimoriginorigin) * floatsin(fov M_PI 360) / floatsin((180 vangles[0] - fov) * M_PI 360)
    
    
// this is better than nudging the entity straight down
    // it will do a traceline between the killer's head and the desired
    // point, and it will stop when it hits a wall or ceiling or whatever
    
new tr create_tr2()
    
engfunc(EngFunc_TraceLineoriginpointDONT_IGNORE_MONSTERSindextr)
    
get_tr2(trTR_vecEndPospoint)
    
free_tr2(tr)
    
    
    
// just in case we end up outside the map, move the point closer to the killer
    
new pc engfunc(EngFunc_PointContentspoint)
    while(
pc == CONTENTS_SOLID || pc == CONTENTS_SKY)
    {
        
point[0] += (origin[0] - point[0]) * 0.05
        point
[1] += (origin[1] - point[1]) * 0.05
        point
[2] += (origin[2] - point[2]) * 0.05
        pc 
engfunc(EngFunc_PointContentspoint)
    }

Code from here: https://forums.alliedmods.net/showthread.php?t=79675
Thanks, that's what I was searching for!

Quote:
Originally Posted by fysiks View Post
Sure! You can edit your parachute plugin however you would like it to work.
Any tip what I should change? The velocity? Thanks.
__________________
edon1337 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-10-2018 , 09:52   Re: Parachute accelerate | Map's Highest Point
Reply With Quote #5

Quote:
Originally Posted by edon1337 View Post
Any tip what I should change? The velocity? Thanks.
I have no idea and neither does anyone else since you haven't posted a link to the parachute plugin you use.
__________________
fysiks is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-10-2018 , 10:28   Re: Parachute accelerate | Map's Highest Point
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
I have no idea and neither does anyone else since you haven't posted a link to the parachute plugin you use.
All parachutes use almost the same code. I'm using the parachute from H.RED.ZONE https://forums.alliedmods.net/showthread.php?t=175775

I think that it could be done by adding more velocity to x or y coordinates but I'm not sure which. I need the parachute to go faster just like in PlayerUnknown's BattleGrounds or Fortnite. I'm not talking about the fall speed, though.

Quote:
Originally Posted by Hey View Post
2. this maybe ?
PHP Code:
stock get_max_z(indexFloat:point[3])
{
    new 
Float:aimorigin[3], Float:origin[3], Float:vangles[3], Float:fov
    
    
// you'll want to replace aimorigin with the victim's origin
    
fm_get_aim_origin(indexaimorigin)
    
    
pev(indexpev_originorigin)
    
pev(indexpev_view_ofsvangles// view offset for killer's eye's origin
    
origin[0] += vangles[0]
    
origin[1] += vangles[1]
    
origin[2] += vangles[2]
    
    
pev(indexpev_fovfov)
    
fov /= 1.5 // for some reason this works well, but theoretically it should be 2.0
    
    
pev(indexpev_v_anglevangles
    
vangles[0] *= -1.0 // this is done because looking up angle < 0, level angle = 0, looking down angle > 0
    
    
point[0] = aimorigin[0]
    
point[1] = aimorigin[1]
    
// magic calculations brought to you by my brain + some guesswork
    
point[2] = aimorigin[2] + get_distance_f(aimoriginorigin) * floatsin(fov M_PI 360) / floatsin((180 vangles[0] - fov) * M_PI 360)
    
    
// this is better than nudging the entity straight down
    // it will do a traceline between the killer's head and the desired
    // point, and it will stop when it hits a wall or ceiling or whatever
    
new tr create_tr2()
    
engfunc(EngFunc_TraceLineoriginpointDONT_IGNORE_MONSTERSindextr)
    
get_tr2(trTR_vecEndPospoint)
    
free_tr2(tr)
    
    
    
// just in case we end up outside the map, move the point closer to the killer
    
new pc engfunc(EngFunc_PointContentspoint)
    while(
pc == CONTENTS_SOLID || pc == CONTENTS_SKY)
    {
        
point[0] += (origin[0] - point[0]) * 0.05
        point
[1] += (origin[1] - point[1]) * 0.05
        point
[2] += (origin[2] - point[2]) * 0.05
        pc 
engfunc(EngFunc_PointContentspoint)
    }

Code from here: https://forums.alliedmods.net/showthread.php?t=79675
I tried it 3 times, 2 times it spawned me in a low point inside a mountain (stuck), on the third try it spawned me correctly, I guess it needs some extra checks..
__________________

Last edited by edon1337; 01-10-2018 at 11:04.
edon1337 is offline
Hey
Member
Join Date: Dec 2017
Old 01-10-2018 , 11:16   Re: Parachute accelerate | Map's Highest Point
Reply With Quote #7

something like this:
PHP Code:
    if(get_user_button(id) & IN_USE)
    {
        new 
Float:velocity[3];
        
entity_get_vector(idEV_VEC_velocityvelocity);
        if(
velocity[2] < 0.00)
        {
            
set_user_gravity(id0.10);
            new 
var3;
            if (
velocity[2] + 40.00 fallspeed)
            {
                
var3 velocity[2] + 40.00;
            }
            else
            {
                
var3 fallspeed;
            }
            
velocity[2] = var3;
            
entity_set_vector(id2velocity);
        }
        else
        {
            
set_user_gravity(id1.00);
        }
    } 
Hey is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-10-2018 , 11:54   Re: Parachute accelerate | Map's Highest Point
Reply With Quote #8

Quote:
Originally Posted by Hey View Post
something like this:
PHP Code:
    if(get_user_button(id) & IN_USE)
    {
        new 
Float:velocity[3];
        
entity_get_vector(idEV_VEC_velocityvelocity);
        if(
velocity[2] < 0.00)
        {
            
set_user_gravity(id0.10);
            new 
var3;
            if (
velocity[2] + 40.00 fallspeed)
            {
                
var3 velocity[2] + 40.00;
            }
            else
            {
                
var3 fallspeed;
            }
            
velocity[2] = var3;
            
entity_set_vector(id2velocity);
        }
        else
        {
            
set_user_gravity(id1.00);
        }
    } 
Gravity has nothing to do with this.
__________________
edon1337 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 08:58.


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