Scripts / Grappling hook

Author
Message
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 16th Apr 2023 16:47
I've been "playing" with Amen Moses's "grapplinghook2" and have managed to add a "release" so that while you're moving towards the hook you can let go of it. It was added between the "setfreezeposition" and "teleporttofreeze..." as it looks like the movement towards the hook is in there. What I'd like to do is add momentum to the player so that when you "release" you don't just drop straight down. That and "air control" so that while you're being pulled you can still steer while in the air. It seems like these need some of AM's funky math.

I made a "hoverboard and Grappling Hook" way back in 2003 for UT99 using uscript and unrealed 2.0 and had the same problem with the air control where if you jumped off or released you just went straight up and down.

I'm kinda stuck at this point and would really appreciate any help at this time.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd May 2023 20:20
Mouse Button control version
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 3rd May 2023 21:26
Awesome!!
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 4th May 2023 16:58 Edited at: 4th May 2023 17:01
I've changed a couple of settings to make it just like the UT Tranlocator. Sped up the "move to speed" so that you disappear and reappear instantly, removed the charge timer so that just a click of the mouse button and it throws....... LMB to throw it and RMB to travel to it.

The only issues are with the "hold distance" and death.

local hold_dist = 50.0 is too close. It pushes you up in the air if you look straight down. I think what's causing this is the collision barriers. 50 works great while looking straight forward since the players collision capsule is oblong 50 actually hits the bottom of it and pushes you up. 63.4 keeps the hook visible at the ground and far enough away that it won't affect you looking down. But if your on a platform in the air, look down and move forward you'll walk onto the hook and as long as you're looking down you'll move forward. Maybe stop the player from looking straight down?

The death part. So long as your last operation was to "move_to" the hook then no matter how far you fall you won't lose any health. If I throw it at a platform in the air, got to it and miss it I'll drop to the ground without losing health. If I land on the platform and then walk off I'm dead.

Even "as-is" it's a great tool.

and Amen, can I have one of those t-shirts
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th May 2023 19:55
Try turning off physics when carrying it by using the command CollisionOff(e), then turn it back on again using CollisionOn(e) before throwing it.
Been there, done that, got all the T-Shirts!
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 4th May 2023 23:01
I tried that before with no luck, but I also turned physics off on the hook and there was no pushing up so I guess it's me not getting it right.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th May 2023 11:12 Edited at: 5th May 2023 11:12
You will probably have to make sure that there is a one frame gap between CollisionOn(e) and the actual throwing part.
Been there, done that, got all the T-Shirts!
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 5th May 2023 15:48 Edited at: 5th May 2023 20:10
I kinda thought that because I could pick it up but not throw it sometimes, it just stays in your hand. But also if you are just on the ground, the hook set for collisionoff(e) I could still look down and jump and you'll still float upwards.

At least I can read the script like a book, now I need to find which "sentence" to put in which "paragraph".

edit:
It doesn't matter what I do or where I put it the CollisionOff( e ) doesn't stop you getting held in the air. Just for kicks I tried this
else
if perc > 0 then
perc = 0
gh.state = "firing"
CollisionOff(e)

and couldn't fire, (yes I know it's because collision is off), but the only way that I will not be held in the air is to turn "off" physics in the hook properties. But then it won't fire.
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 8th May 2023 15:18
Trying this from another aspect. Is it possible to limit a players "head" movement so that he can't "look" straight down. In other words, if the player is looking down at 90 deg, I'd like to restrict that 90 deg to 85 deg. Straight up and down is quite unrealistic anyway.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 9th May 2023 18:03
Try this.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 9th May 2023 20:03
Thx, looks like it's working. I "put a band-aid" on it this morning by restricting the vertical view angle to 70 and -70 in the gameplayercontrol. That just kept the player from looking straight up or down but I'd much rather not mess with that file if I don't have to.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 9th May 2023 21:14
Well for homework why not do the CollisionOff trick I used but only when the view angle is below a certain value?
Been there, done that, got all the T-Shirts!
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 9th May 2023 23:18
I will definitely compare scripts and check that out. Thank you
PM
Tater
1
Years of Service
User Offline
Joined: 30th Mar 2023
Location:
Posted: 13th May 2023 19:57 Edited at: 13th May 2023 20:15
OK so here it is. Collision is on when "holding". When the player looks down below 65 then the entity's collision is off.


In the "position entity wrt player" I turned the collision on at the bottom of that block. Then I added the above.
PM

Login to post a reply

Server time is: 2024-05-03 22:50:14
Your offset time is: 2024-05-03 22:50:14