Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llMoveToTarget() not working in HUD or attachment

Kai Venkman
Will script for food...
Join date: 21 Feb 2006
Posts: 43
06-19-2006 11:25
Greetings,

I have the following bit of code in a hud although I've also tried it in an attachment. Everything works fine with the exception of the llMoveToTarget call. My av doesn't move at all. If I move the my AV manually to the target the at_target event fires correctly (I'm going to replace at_target with collision).

CODE

state kiss
{
state_entry() {
avFindName = TRUE;
llSensor( "", NULL_KEY, AGENT, sensorDistance, PI );
}

on_rez( integer startcode ) {
llResetScript();
}

sensor(integer total_number) {
if ( avFindName ) {
integer i;
for ( i = 0; i < total_number; i++ ) {
if (llDetectedName(i) == avTarget && llDetectedKey(i) != llGetOwner() ) {
avName = llDetectedName(i);
llWhisper(0, "You have offered to kiss " + avName + "." );
llMessageLinked( LINK_THIS, linkChannel, linkStringRequest, llDetectedKey(i) );
avName = llList2String( llParseString2List( avName, [" "], [] ), 0 );
avKey = llDetectedKey(i);
return;
}
}
}
else {
avPos = llDetectedPos(0);

targetID = llTarget(avPos, 0.5);
llMoveToTarget(avPos, 0.2);
}
}

at_target(integer tnum, vector targetpos, vector ourpos)
{
llTargetRemove(targetID);
llStopMoveToTarget();
...


Any ideas as to why the llMoveToTarget is failing?
Zi Ree
Mrrrew!
Join date: 25 Feb 2006
Posts: 723
06-19-2006 13:12
There is a bug that makes llMoveToTarget() fail when you edit a script. Try detaching the object and re-attaching again without editing the script.
_____________________
Zi!

(SuSE Linux 10.2, Kernel 2.6.13-15, AMD64 3200+, 2GB RAM, NVidia GeForce 7800GS 512MB (AGP), KDE 3.5.5, Second Life 1.13.1 (6) alpha soon beta thingie)

Blog: http://ziree.wordpress.com/ - QAvimator: http://qavimator.org

Second Life Linux Users Group IRC Channel: irc.freenode.org #secondlifelug