Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Camera Teleporter

Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-15-2008 14:01
Ok i have a script already setup to use Warpdes... with siting... but i have seen other's that have one that is one touch TP and they don't require you to sit... Now here is my delema.. i know that u need to have a physical object to move u .. sphere around avatar.. llApplyImpluse is needed to be used... BUT there is nothing stating really how to make it work i don't have any real good learning tips from it from the wiki's i have searched for the past couple days and have found nothing... Is there anyone out there that can assist me with this? would be willing to pay for a basic script that will tp to a location that the camera is at or just set with script not with camera. i will do the rest BUT i have not found somthing that works with it. Thnx if anyone can help i am in game right now...
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
03-15-2008 22:17
attachments CAN move an avatar who allows it.
But its coppy, tricky, has bad performance, is not so save, and is easily abused.
Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-16-2008 02:20
well i have all the steps for securing it ... i just have to figure out how to stop myself once i hit the pos that my hud tells the object... for now it is a object that rez's bc there are more options to this that what ppl think.... Anyways i would appreciate now if someone could help me if i use the applyimpulse how can i script a stop in there when it get to the destination... i have not come up with a real sure way it still moves:(
Anthony Hocken
Registered User
Join date: 16 Apr 2006
Posts: 121
03-16-2008 07:46
Try applying impulse in the opposite direction when you reach the destination.
/54/35/244507/1.html
_____________________
Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-16-2008 11:55
now the thing is not that it is tring to get the script to STOP u when u reach the point that u wanted.... i can stop me but i can't get it to stop me were i want.. like where my camera is....
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
03-16-2008 12:23
How about using llGetCameraPos( ); to supply your destination vector
Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-16-2008 12:35
going to post up the code i have right now.. just a well crappy code mess but u get idea... i will redo once i learn how to stop where the postion is:)

CODE



/////////////
float Force = 500.0;
default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 1.0>, ZERO_ROTATION);
llSetRot(ZERO_ROTATION);
llSetScale(llGetAgentSize(llGetOwner()));
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);
llSetStatus(STATUS_PHYSICS, TRUE);
llListen( 1568, "", NULL_KEY, "" );

}
changed(integer change)
{
llSetText((string)llGetMass(), <1.0, 1.0, 1.0>, 1.0);
}
attach(key id)
{
llSetText((string)llGetMass(), <1.0, 1.0, 1.0>, 1.0);
}
listen( integer channel, string name, key id, string msg )
{
if (channel == 1568)
{
vector pos = (vector) msg;
vector direction = llVecNorm(pos - llGetPos());
llApplyImpulse(direction * 100, 0);
// state stop;
}
}
}


Above is the code i am working with for right now i plan on changing it more when i can.. but for right now this is what i have:(
Haplo Voss
Registered User
Join date: 18 Nov 2006
Posts: 137
03-16-2008 13:08
I see where you are using listen to inform the object of the vector to stop at, but I don't see where you are supplying it with a vector.

Maybe llSay(1568,(string)destPos) ??
Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-16-2008 13:13
CODE

vector pos = (vector) msg;
vector direction = llVecNorm(pos - llGetPos());
llApplyImpulse(direction * 100, 0);


it is getting the destination just can't stop it once it gets there that is the problem:( i can seem to find anywhere that show the use of a FULL stop once it hits the destination... i am tring to right use llTarget but it is not stoping once it hits it either:( keeps saying still going...

Below is newest edition:

CODE

integer targetID;
vector direction;
/////////////

default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 1.0>, ZERO_ROTATION);
llSetRot(ZERO_ROTATION);
llSetScale(llGetAgentSize(llGetOwner()));
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);
llSetStatus(STATUS_PHYSICS, TRUE);
llListen( 1568, "", NULL_KEY, "" );

}
changed(integer change)
{
llSetText((string)llGetMass(), <1.0, 1.0, 1.0>, 1.0);
}
attach(key id)
{
llSetText((string)llGetMass(), <1.0, 1.0, 1.0>, 1.0);
}
listen( integer channel, string name, key id, string msg )
{
if (channel == 1568)
{
vector pos = (vector) msg;
vector direction = llVecNorm(pos - llGetPos());
targetID = llTarget( pos, 0.5 );
llApplyImpulse(direction * 100, 0);
// state stop;
}
}
not_at_target()
{
// We're not there yet.
llWhisper(0, "Still going");
llApplyImpulse(direction * 100, 0);
}

at_target( integer number, vector targetpos, vector ourpos )
{
llSay(0, "We've arrived!");

// Stop notifications of being there or not
llTargetRemove(targetID);
llApplyImpulse(-llGetMass()*llGetVel(),FALSE);

}
}
CODE
Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-17-2008 11:08
i am still not able to STOP at the vector that is givin in the listen.... HELP:( anyone out there please is there a sure fire way to stop applyimpulse once u get it moving??
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
03-17-2008 12:18
From: Saladin Nightfire
i am still not able to STOP at the vector that is givin in the listen.... HELP:( anyone out there please is there a sure fire way to stop applyimpulse once u get it moving??


I have not fully digested your code, but I get the impression that you are trying to use chat to tell it where to stop. That will never work, as a script cannot hear itself using the chat commands.
Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-17-2008 16:04
no it already has a vector that it has to go to but i can't get it to STOP once it gets there.. i have it getting that it knows it has reached it but i can't seem to make it stop... at alll once it reachs its point...
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-17-2008 18:14
CODE

float EPSILON = ...;
vector targetPos = ...;

if (llVecDist(targetPos, llGetPos()) <= EPSILON)
{
llApplyImpulse(-llGetMass()*llGetVel(), FALSE);
// Maybe repeat, or llMoveToTarget() to targetPos, or whatever
} else
{
// wait and/or analyze trajectory, re-aim, and shove ;-)
}
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
03-18-2008 00:37
From: Saladin Nightfire
...but i have seen other's that have one that is one touch TP and they don't require you to sit...


The trick there is that even those DO require you to sit. They just have their default touch action set to sit.
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
03-25-2008 09:36
I created this a *long* time ago. https://slexchange.com/modules.php?name=Marketplace&file=item&ItemID=210908
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
03-25-2008 10:15
From: Geuis Dassin


Nice ad.

I don't remember who originally made this script or even where I got it but it does what you want to do.

For free.

CODE

integer i=0;
//Channels
integer MOVE_TO = 7000;
vector target = <0,0,0>;
integer move_target=0;
default
{
state_entry(){
llRequestPermissions(llGetOwner(),PERMISSION_TRACK_CAMERA);
}

touch(integer total_number){
llMessageLinked(LINK_SET,7000,(string)llGetCameraPos(),"");
}

link_message(integer sn, integer c, string msg, key id){
if(c==MOVE_TO){
target = (vector)msg;
if(target.x > 0 && target.x < 256){
move_target = llTarget(target,0.001);
llSetTimerEvent(0.0001);
}
}
}

timer(){
llMoveToTarget(target,0.0444444444444);
llApplyImpulse((target - llGetPos()) * llVecDist(target,llGetPos()),FALSE);
i++;
if(i>100){
llOwnerSay("Timed out");
llTargetRemove(move_target);
llSetTimerEvent(0);
llStopMoveToTarget();
i = 0;
return;
}
}

at_target(integer tnum, vector targetpos, vector ourpos){
llApplyImpulse(-llGetVel(),FALSE);
llTargetRemove(tnum);
llSetTimerEvent(0);
//llOwnerSay("Target " + (string)target + ":: Location: " + (string)llGetPos());
llStopMoveToTarget();
}
}


Put it in a prim, attach it as a HUD and touch it to TP to wherever your cam is looking.

Enjoy.
_____________________
There are no stupid questions, just stupid people.
Bobbyb30 Zohari
SL Mentor Coach
Join date: 11 Nov 2006
Posts: 466
03-26-2008 03:29
From: Saladin Nightfire
well i have all the steps for securing it ... i just have to figure out how to stop myself once i hit the pos that my hud tells the object... for now it is a object that rez's bc there are more options to this that what ppl think.... Anyways i would appreciate now if someone could help me if i use the applyimpulse how can i script a stop in there when it get to the destination... i have not come up with a real sure way it still moves:(


at_target(vector pos, vector loc)
{
llStopMoveToTarget();
}
Saladin Nightfire
Scripter for HIRE
Join date: 6 Jan 2008
Posts: 20
03-31-2008 01:22
And i thought everyone was jsut not familer with applyimpulse:) LOL but this helps thnxs i will try this and see if it works like i would like:) THNXS again all... and yea nice add... seen that one but hell who cares about that... i want to learn it not buy somthing like that? :) LOL and that does NOT do what i want to:)