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?
probably not.
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.
Yes, possible. But animation won't be same.
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
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
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, :)
Updated the function and made it more minimalistic.
Quote from: KAKAN on Feb 01, 2017, 05:49 PMQuote from: vito on Feb 01, 2017, 03:37 PMQuote 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).
Quote from: vito on Feb 02, 2017, 07:17 AMQuote from: KAKAN on Feb 01, 2017, 05:49 PMQuote from: vito on Feb 01, 2017, 03:37 PMQuote 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.
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#
First test looks pretty smooth to me :)
@Shadowhttp://www.mediafire.com/file/eucx189xo3jr2nl/paragliding.mp4
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)
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
https://www.youtube.com/watch?v=dDN4TDvvYMI&feature=youtu.be#