These forums are CLOSED. Please visit the new forums HERE
How to counteract Damping in llMoveToTarget |
|
|
Tai Clifford
Registered User
Join date: 26 Jul 2006
Posts: 45
|
09-08-2006 15:32
I am using llMoveToTarget to move an object, when it gets close to the target I move it again. Can someone help me to stop it slowing down as much when it nears the target. I guess I need to apply impulses but I am not sure how to work out when to apply them etc. Thanks in advance.
|
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
09-08-2006 20:30
Ok, I am still a major noobie when it comes to scripting but I have thought about this very thing. I don't know if this will work because I haven't tried it out yet, but it seems like it should.
Look at this page in the wiki: http://secondlife.com/badgeo/wakka.php?wakka=at_target In the sample script there is a variable called range. The script uses it to set a range from the actual target that the script will perform an action. My thoughts were to set you target about 5 to 10 meters past the place you really want for your target. Then set the range variable so that it occurs on spot you want for your real target. Then have it just set a new target from that point. Seems to me that it should start moving to the next target from that point, and since it's still a ways from the point the script thinks is the target it should still be moving fairly quickly. But like I said, I haven't had time to test this yet, so it might not work. And one of the pros here, like that Newgate guy, can probably give you a better answer. ![]() _____________________
|
|
Tai Clifford
Registered User
Join date: 26 Jul 2006
Posts: 45
|
09-09-2006 00:32
Thanks Vares, because my object is going through some very narrow spaces I can't really tell it to go to the next point too early, but I did use your suggestion with the "at_target" and when I am about 3 metres from the target I apply impulses which speeds up the final approach to the target. Not perfect but I think it will do.
|
|
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
|
09-09-2006 12:57
Tai, I think you may have misunderstood what Vares ment. They were suggesting moving the target the script gets past the actual target you want, and set the range so it triggers at the right point. Example: Say you're trying to move 5 meters west, set the target in the script to 10m west with a range of 5m so when the at_target triggers you're at the target you wanted.
_____________________
|
|
Tai Clifford
Registered User
Join date: 26 Jul 2006
Posts: 45
|
09-09-2006 14:03
oh, of course ... that would work perfectly. I am a bit slow some times
![]() |
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
09-09-2006 14:18
oh, of course ... that would work perfectly. I am a bit slow some times ![]() Well, I am not really sure if it will work or not as I have never tried it. But it seems like it should. But you know how that goes. If you try it I would be interested to know how it works. _____________________
|
|
Tai Clifford
Registered User
Join date: 26 Jul 2006
Posts: 45
|
09-09-2006 15:40
If you try it I would be interested to know how it works. For some reason my target coordinates were fine one minute, then the next minute they were all out of wack. So I have made a different approach to it. I have a series of transparent markers, all numbered in sequence. The object that follows the markers calls for the coordinates of the next marker as it needs it. Because of the confined spaces I can't really place the markers beyond where they need to be. And because my maths is not too good I wouldn't know how to calculate in the extra distance needed to try your method. I am pretty sure your idea would work, although they way I have it now, where it speeds, slows a bit and then pulses a couple of times is not a bad effect. Thanks again for the help. |