Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

2 years ago

Advertisement
July 16, 2019, 04:11:32 pm

Author Topic: [Release] Longer Grapple  (Read 2885 times)

Dev_34

  • Full Member
  • ***
  • Posts: 158
    • View Profile
[Release] Longer Grapple
« on: August 23, 2015, 03:13:56 am »
Inspired by the single player mod, I decided to create a script that similarly allows players to grapple further distances than the standard grapple hook. The range and several other settings can be configured at the top of the file. This script uses the raycast function which doesn't seem to return the position argument past ~1250 meters so the script is limited to around this distance. Grappling trees or other tiny surface areas does not work very effectively. I'm guessing some freeroam servers might like this script.  :)
link: https://github.com/dev3434/LongerGrapple

Lord_Farquaad

  • Full Member
  • ***
  • Posts: 217
    • View Profile
Re: [Release] Longer Grapple
« Reply #1 on: August 23, 2015, 03:25:28 am »
Grappling onto a moving vehicle from a far distance may not work well either, and will probably result in the player grappled onto nothing in mid-air.

Trap

  • Donator
  • Full Member
  • *****
  • Posts: 192
    • View Profile
Re: [Release] Longer Grapple
« Reply #2 on: August 23, 2015, 12:15:35 pm »
Grappling onto a moving vehicle from a far distance may not work well either, and will probably result in the player grappled onto nothing in mid-air.

Yup , for example in the Survival District Server using the rocket grapple if you grapple on a moving object you will only land on the spot you Clicked on and will just stick there mid air lol

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Longer Grapple
« Reply #3 on: August 23, 2015, 12:59:06 pm »
Very nice. No midair grapple and seems to be very smooth. Good job.
« Last Edit: August 23, 2015, 01:37:48 pm by Darwood37 »

Dev_34

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Re: [Release] Longer Grapple
« Reply #4 on: August 26, 2015, 05:51:44 am »
Grappling onto a moving vehicle from a far distance may not work well either, and will probably result in the player grappled onto nothing in mid-air.
Yea  :'(

if you grapple on a moving object you will only land on the spot you Clicked on and will just stick there mid air lol
Yea  :'(

------------------

It doesn't really feel right to update a post in the release section but I figured I'd address this limitation.

I reworked much of the script and added a function to deal with extended grapples hitting vehicles and players. The interpolations are re-calculated every frame for vehicle and player entities meaning you can now grapple onto moving vehicles and players anywhere within the streaming radius of those entities and have a smooth path towards them that adjusts nicely. It may not look like the grapple is directed exactly at the entities since I had to use offsets to ensure the ClientStaticObject did not interact with them(like tipping the vehicle over on the client). I attempted to mimic the base-game handling for vehicular grappling where the player is put into the stunt position for cars or becomes a driver for bikes. Due to a bug or simple lack of functionality, I could not force players into the helicopters' default stunt position. In the configuration section of the client file, I added the ability to toggle grappling towards and even "tethering" to other players where you can cling to them. Maybe someone will find that cute  :P . Due to the player position syncing making it look ugly and the inconsistency of success, the player tethering feature is disabled by default but you can enable it if you want to play around with it.
To sum it all up, you can pretty much fly a plane in all sorts of crazy maneuvers and have a train of people all grappled to each other following the path you make  ;D

I apologize if there are any bugs; I tried to solve them all. You can do whatever you wish to modify the script to fix bugs or just to suit your own purposes.

Link is the same: https://github.com/dev3434/LongerGrapple

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Longer Grapple
« Reply #5 on: August 27, 2015, 02:55:31 am »
Nicely done, again. Now add a rocket grapple and Beast and I will be very happy  ;D


Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: [Release] Longer Grapple
« Reply #6 on: September 05, 2015, 03:13:22 pm »
Small bug, noticed sometimes when grappling to a building you end up glitching inside and cannot get out unless warp etc.

Dev_34

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Re: [Release] Longer Grapple
« Reply #7 on: September 05, 2015, 10:54:00 pm »
Small bug, noticed sometimes when grappling to a building you end up glitching inside and cannot get out unless warp etc.

Unfortunately I don't think I can do anything about this since moving the ClientStaticObject past the surface the player hit is what allows players to tether to those surfaces. Sometimes the player goes right through them, depends on the surface  :-\