|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
10-06-2006 11:11
In a nut-shell, I created a vehicle which moves by following the camera around. nothing all that fancy. my problem is when I cross a sim border, the vehicle goes "nuts" and zooms off to a far corner of the previous sim instead of crossing into the new sim. I know that this is because llGetCameraPos() calls out regional coordinates. As soon as my camera goes into a new sim the updated coordinates for the new sim are the same coordinates as ones on the opposite side of the old sim, and so the vehicle zooms off away from where I wanted to go. I was hoping to find out how non-physical vehicles move between sims, but my searches for example scripts of them have turned up empty. Here's my simple testing code so far; nothing fancy, just a box you sit on and it follows your camera around. default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA); llSetTimerEvent(1); } timer() { vector campos=llGetCameraPos(); campos=campos+<0,0,-1>;//moves the block below the camera so you can actually see something besides your avvie. rotation camrot=llGetCameraRot(); llMoveToTarget(campos,1); llSetRot(camrot);//faces the block with the camera. } }
Why did I want a vehicle this way? Manuvering is very easy to do, and in laggy sims it doesn't fall through the ground like most all hover vehicle scripts do.
_____________________
My SLExchange shopTypos 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.
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
10-06-2006 11:17
Neat idea.
Moving the vehicle into the next sim is usually just a matter of giving it a vector that is relative to where you are... but outside the current sim, for instance, if you're at <0.0, 20.0, 70.0> moving to <-5.0, 20.0, 70.0> moves you 5 meters into the next sim. Now, I'd have expected llGetCameraPos() to give sim relative coordinates...
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
10-06-2006 11:56
From: Jillian Callahan Now, I'd have expected llGetCameraPos() to give sim relative coordinates... heh, that's what I meant to say Hangover FTL >_>. Since the movement is controlled by llMoveToTarget, what would be a good way to tell if it's moving outside the sim so that it knows to start moving along a given vector instead of continuing with llMoveToTarget? The only way I can think of right now is to have it compare it's position with the edge of the sim, and if it's headed towards the sim's edge, to suspend llMoveToTarget, and give it a push that sends it into the next sim
_____________________
My SLExchange shopTypos 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.
|