Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Weapons Scripting Help

Zeashay Bluebird
Registered User
Join date: 22 Jan 2009
Posts: 2
01-29-2009 20:18
Hello. I've been playing SL for about a month now. Right now I am trying to create homing missiles I can fire from attached components upon my avatar (thighs and shoulder attachments). My issue is getting the missiles to home in on targets, whether they be near by or targeted by me. How can I make scripted missiles to behave in this manner? (In all honesty, I've tried scripting such myself with pre-made scripts, but I can't seem to get the script to work at all, and scripting from scratch I haven't mastered how to do yet...)
Faust Vollmar
llSetAgentSanity(FALSE);
Join date: 3 Feb 2007
Posts: 87
01-29-2009 20:35
If you have targeting handled, then I'll skip to what makes the sort of thing tick.

llGetObjectDetails. This works on Agents (Avatars) for every input except Description, Creator (naturally) and Group. (I'm guessing as an anti-group-targeting thing.)

Combine an occasional call to llGetObjectDetails(AvatarKey,[OBJECT_POS]) with llMoveToTarget (And optionally llLookAt if you want it to "point.";)
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-30-2009 10:05
You might also try a sensor with a limited arc (less than or equal to pi/2). That way the missile can "lock onto" whatever is in front of it (make sure the x-axis of the prim containing the sensor script points "forward".

http://www.lslwiki.net/lslwiki/wakka.php?wakka=sensors