Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Grappling Hook script

Jet Eldrich
Registered User
Join date: 19 Feb 2006
Posts: 11
04-13-2007 23:48
Ive been fudging aorund with various bits of code and the like, ive even got two talented scripters trying to help me with it too, but I cant seem to get my grappling hook device to work. Ive tried to look at the one included in the Multi Gadget by timeless prototype but of course, I cant see the scripts due to permissions. Can anybody point me in the right direction?
Fenrir Reitveld
Crazy? Don't mind if I do
Join date: 20 Apr 2005
Posts: 459
04-14-2007 00:40
Depends on how you want it to behave. Here's how I'd do it (for a Bionic Commando-style hook):

Rez a seeker prim. Have it travel along path of aim (calculated via mouselook) until it encounters a prim using a short-range llSensor call.

It then shouts back its position, starts a particle chain back to the avatar (or a prim on the avatar's body) and the main script on the agent pushes you toward the seeker prim. Once it's within X distance of the seeker prim, the chain effect stops and shouts to the seeker prim to de-rez.

These are, of course, the drunk rambles of a LSL coder so YMMV.
_____________________
----
----
----
Jet Eldrich
Registered User
Join date: 19 Feb 2006
Posts: 11
04-14-2007 01:19
Sounds awesome, but I also can never get the whole particle targeting thing to work for me and no matter how many things i look at I never understand it still. But yeah, I'll try that and see.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
04-14-2007 12:42
huh, I've never thought of doing this before but it could be a fun project.



How about this approach.

have your grapling gun fire a "Sticky" munition, that is, a bullet that turns off physics when it collides with something (still temp_on_rez though), and then does both these things simultaneously, shoots a particle stream towards your avatar (or perhaps the gun attachment) and has the gun attachment apply a force or push along an appropriate vector that will send you towards where the bullet is. of course cross sim this won't work to well, but I think it's a doable idea. If they've changed the way llMoveToTarget behaves (my first week back since a 4 or 5 month hiatus) so that it can work with attachments, this will be even easier to implement.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
04-14-2007 16:56
llMoveToTarget() can and will work to pull someone toward something while they are wearing an attachment. Essentially...a grappling-hook script and a slave collar chain script are exactly the same...
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Jet Eldrich
Registered User
Join date: 19 Feb 2006
Posts: 11
04-18-2007 20:22
Ive been trying to use the llMovetoTarget but for some reason I cant seem to get it to work the way I want it to. That and when I try to make the ammunition stick it never seems to want to collide with anything so It can unstick, I'm not sure if its something with the gun itself or the bullets though.
Hg Beeks
llGetElement(80);
Join date: 13 Apr 2006
Posts: 134
04-20-2007 01:11
From: Jet Eldrich
Ive been trying to use the llMovetoTarget but for some reason I cant seem to get it to work the way I want it to. That and when I try to make the ammunition stick it never seems to want to collide with anything so It can unstick, I'm not sure if its something with the gun itself or the bullets though.

Silly question; Is the ammunition phantom?