childhoodbestfriend489 Posted February 21, 2021 Share Posted February 21, 2021 How to make it correct? default { state_entry() { llListen(6, "", llGetOwner(), ""); } listen( integer channel, string name, key id, string message ) { llSetStatus(STATUS_PHYSICS, TRUE); llMoveToTarget(message,100); } } How to make it correct? Link to comment Share on other sites More sharing options...
KT Kingsley Posted February 21, 2021 Share Posted February 21, 2021 You must typecast message to a vector: llMoveToTarget((vector) message,100); And when you chat the vector you need to be careful to get it exactly right. An invalid vector in the message will be converted to the ZERO_VECTOR <0.0, 0.0, 0.0>, and your object will wander off into the distance. After that's happened a couple of times you might want to use this code snippet to test if the message string does represent a valid vector: integer IsVector(string s) { list split = llParseString2List(s, [" "], ["<", ">", ","]); if(llGetListLength(split) != 7)//we must check the list length, or the next test won't work properly. return FALSE; return !((string)((vector)s) == (string)((vector)((string)llListInsertList(split, ["-"], 5)))); //it works by trying to flip the sign on the Z element of the vector, //if it works or breaks the vector then the values won't match. //if the vector was already broken then the sign flip will have no affect and the values will match //we cast back to string so we can catch negative zero which allows for support of ZERO_VECTOR }//Strife Onizuka Link to comment Share on other sites More sharing options...
Rolig Loon Posted February 21, 2021 Share Posted February 21, 2021 Also, note that the llMoveToTarget function will only work if you are wearing the object or if you have made it physical, and that it will not move an object more than 64 m. Note also that the damping time, which you set to 100 seconds, is supposed to be a float, not an integer. You can get away with the integer, because the compiler will typecast it implicitly, but the value really should be 100.0. Link to comment Share on other sites More sharing options...
childhoodbestfriend489 Posted February 21, 2021 Author Share Posted February 21, 2021 and how is the speed counted here? Is it Seconds to pass 1 meter? Link to comment Share on other sites More sharing options...
Rolig Loon Posted February 21, 2021 Share Posted February 21, 2021 http://wiki.secondlife.com/wiki/LlMoveToTarget float tau – seconds to critically damp in Link to comment Share on other sites More sharing options...
childhoodbestfriend489 Posted February 21, 2021 Author Share Posted February 21, 2021 How many coordinates will and object pass through for float tau 1? Link to comment Share on other sites More sharing options...
Rolig Loon Posted February 21, 2021 Share Posted February 21, 2021 That depends on how far away your target is. If your target is 10.0 m away and you have tau set to 1.0 sec, it will move 10m (unless it bumps into something, of course). 1 Link to comment Share on other sites More sharing options...
animats Posted February 21, 2021 Share Posted February 21, 2021 Also note that all the movement commands in LSL, other than directly setting position, are "best effort". Movement may get there. Movement may just get close. Movement may get stuck. Movement may overshoot (especially in overloaded sims). You have to check, if the final position matters. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now