Vice City: Multiplayer

VC:MP Discussion => General Discussion => Topic started by: Eva on Feb 01, 2017, 12:10 PM

Title: parachutes
Post by: Eva on Feb 01, 2017, 12:10 PM
Hi maybe its a silly question, but would it be possible to port the parachute from San Andreas into vcmp? I guess its not but if so how can it be done?
Title: Re: parachutes
Post by: MatheuS on Feb 01, 2017, 12:18 PM
probably not.
Title: Re: parachutes
Post by: jWeb on Feb 01, 2017, 12:22 PM
With a bit of work and some math skills probably yes http://forum.vc-mp.org/?topic=1051.0 But for the average VCMP scripter... absolutely not.

For a better performance and accuracy, this should probably be implemented as a native plugin.
Title: Re: parachutes
Post by: vito on Feb 01, 2017, 12:34 PM
Yes, possible. But animation won't be same.
Title: Re: parachutes
Post by: KAKAN on Feb 01, 2017, 02:13 PM
Whatever you do, it'll be a good addition to a private server not a public one. With a bit more improvement on client side, this can be done totally on client side :D
Title: Re: parachutes
Post by: Shadow on Feb 01, 2017, 02:29 PM
Quickly expanding @happymint 's solution, I came up with this which looks smooth enough and it doesn't deal any damage to the player upon falling.

// quick function that I coded on the go
function clamp(value, min, max)
{
return value < min ? min : (value > max ? max : value);
}

local g_PlayerFallAccum = array(GetMaxPlayers(), 0.0);

function onPlayerFall(player, speed)
{
player.Speed.z += clamp(speed, (-1) * player.Speed.z * 0.7, (-1) * player.Speed.z * 0.9);
}

function onPlayerMove(player, px, py, pz, cx, cy, cz)
{
    // Get the speed to avoid too many table lookups
    local speed = g_PlayerFallAccum[player.ID];
    // Update the accumulated speed
    speed += pz > cz ? pz - cz : 0.0;
    // Check the accumulated speed
    if (speed > 1.0) onPlayerFall(player, speed);
    // Save the accumulated speed
    g_PlayerFallAccum[player.ID] = speed;
}

function _PlayerFallResetFunc()
{
    g_PlayerFallAccum.apply(@(v) 0.0);
}

local _PlayerFallResetTimer = NewTimer("_PlayerFallResetFunc", 500, 0);

EDIT: Updated the function
Title: Re: parachutes
Post by: Eva on Feb 01, 2017, 03:24 PM
Quote from: Shadow on Feb 01, 2017, 02:29 PMQuickly expanding @happymint 's solution, I came up with this which looks smooth enough and it doesn't deal any damage to the player upon falling.

// quick function that I coded on the go
function clamp(value, min, max)
{
return value < min ? min : (value > max ? max : value);
}

local g_PlayerFallAccum = array(GetMaxPlayers(), 0.0);

function onPlayerFall(player, speed)
{
player.Speed.z += clamp(speed, (-1) * player.Speed.z * 0.7, (-1) * player.Speed.z * 0.9);
}

function onPlayerMove(player, px, py, pz, cx, cy, cz)
{
    // Get the speed to avoid too many table lookups
    local speed = g_PlayerFallAccum[player.ID];
    // Update the accumulated speed
    speed += pz > cz ? pz - cz : 0.0;
    // Check the accumulated speed
    if (speed > 1.0) onPlayerFall(player, speed);
    // Save the accumulated speed
    g_PlayerFallAccum[player.ID] = speed;
}

function _PlayerFallResetFunc()
{
    g_PlayerFallAccum.apply(@(v) 0.0);
}

local _PlayerFallResetTimer = NewTimer("_PlayerFallResetFunc", 500, 0);
I will experiment with this, :)
Title: Re: parachutes
Post by: vito on Feb 01, 2017, 03:37 PM
Quote from: KAKAN on Feb 01, 2017, 02:13 PMnot a public one
Why?
Title: Re: parachutes
Post by: KAKAN on Feb 01, 2017, 05:49 PM
Quote from: vito on Feb 01, 2017, 03:37 PM
Quote from: KAKAN on Feb 01, 2017, 02:13 PMnot a public one
Why?
Try it with 250+ pingers and find out why.
Title: Re: parachutes
Post by: Shadow on Feb 01, 2017, 06:03 PM
Updated the function and made it more minimalistic.
Title: Re: parachutes
Post by: vito on Feb 02, 2017, 07:17 AM
Quote from: KAKAN on Feb 01, 2017, 05:49 PM
Quote from: vito on Feb 01, 2017, 03:37 PM
Quote from: KAKAN on Feb 01, 2017, 02:13 PMnot a public one
Why?
Try it with 250+ pingers and find out why.
Lag is not a big problem, player will lag for others in the sky, but this part of gameplay not so important if you planning no critical shooting to this player during fall. (Its hard to kill him).
Title: Re: parachutes
Post by: KAKAN on Feb 02, 2017, 08:53 AM
Quote from: vito on Feb 02, 2017, 07:17 AM
Quote from: KAKAN on Feb 01, 2017, 05:49 PM
Quote from: vito on Feb 01, 2017, 03:37 PM
Quote from: KAKAN on Feb 01, 2017, 02:13 PMnot a public one
Why?
Try it with 250+ pingers and find out why.
Lag is not a big problem, player will lag for others in the sky, but this part of gameplay not so important if you planning no critical shooting to this player during fall. (Its hard to kill him).
Well, he'll start falling simply and then after a few seconds, your parachute system will work, so it won't be a "immediate" one, the only way to make it lag-free is it if it's implemented natively( in vcmp's client code ofc ) or via a client side script.
Title: Re: parachutes
Post by: vito on Feb 02, 2017, 11:01 AM
Quote from: KAKAN on Feb 02, 2017, 08:53 AMWell, he'll start falling simply and then after a few seconds, your parachute system will work, so it won't be a "immediate" one, the only way to make it lag-free is it if it's implemented natively( in vcmp's client code ofc ) or via a client side script.
Of course it should be created in client-side. Actually I did almost same few months ago (safari gamemode) - attach player to helicopter and it worked fine (for local player). We need a smooth mainly for local player, so lags for others players is not a big problem.

Yesterday I've tested flying over city via client side and got some fun in the border of map.

https://www.youtube.com/watch?v=JeS7NCEDuuA#
Title: Re: parachutes
Post by: Eva on Feb 03, 2017, 07:12 PM
First test looks pretty smooth to me :) @Shadow
http://www.mediafire.com/file/eucx189xo3jr2nl/paragliding.mp4
Title: Re: parachutes
Post by: Eva on Feb 21, 2017, 07:29 PM
First betatest with parachutes

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fbc31%2Fcau7wz1rkynket16g.jpg&hash=8c727537f962dcdda0abea39c40bbc58cb1dd0e3)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fb2c1%2Fj7w84c5v0g0wp0c6g.jpg&hash=c872547b186aaa26705cfa27a31ae12196b041bc)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fbc31%2Fwg56t24glizz98k6g.jpg&hash=9b72d601f6910c3e96f4d9837128da7c946b8d55)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fc730%2F9716phnxlk69s326g.jpg&hash=6db1314169ea8e50f6de141f6daca5f1dd860498)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2F3464%2Fzkchbxwqfzki26k6g.jpg&hash=0f45855d6ed534e17841a5984190c4ebb8024358)

Title: Re: parachutes
Post by: vito on Feb 21, 2017, 08:11 PM
Quote from: Eva on Feb 21, 2017, 07:29 PMFirst betatest with parachutes

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fbc31%2Fcau7wz1rkynket16g.jpg&hash=8c727537f962dcdda0abea39c40bbc58cb1dd0e3)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fb2c1%2Fj7w84c5v0g0wp0c6g.jpg&hash=c872547b186aaa26705cfa27a31ae12196b041bc)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fbc31%2Fwg56t24glizz98k6g.jpg&hash=9b72d601f6910c3e96f4d9837128da7c946b8d55)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2Fc730%2F9716phnxlk69s326g.jpg&hash=6db1314169ea8e50f6de141f6daca5f1dd860498)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.mediafire.com%2Fconvkey%2F3464%2Fzkchbxwqfzki26k6g.jpg&hash=0f45855d6ed534e17841a5984190c4ebb8024358)


Awesome Eva :o
Title: Re: parachutes
Post by: Eva on Feb 24, 2017, 09:23 PM
https://www.youtube.com/watch?v=dDN4TDvvYMI&feature=youtu.be#