Burke Prefect
Cafe Owner, Superhero
Join date: 29 Oct 2004
Posts: 2,785
|
09-05-2005 19:36
Using Hank Ramos's Open-Source HyperTeleporter, I'd like to distribute little business cards/promotional thingies that can take a person automatically to a preset destination(s), namely, my store in Behrii. The cost of the trip would be free, with unlimited uses. It would be more efficient than landmarks because, well, we don't have point-to-point yet and I hate dealing with telehubs. This shouldn't take long for someone to hack up, I'm just afraid it's beyond my abilities for now as I'm not in SL as much as I'd like this week. Of course, the script would be free to the public, etc, etc. Would I be willing to pay for this? Yes, how does L$500 for a full-rights copy sound? With permission to box this as a freebie in my upcoming little venue. 
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
09-06-2005 00:52
I'd gladly do it for free if I knew how... Let me think about it some time, maybe there's a solution.
[Edit] I'm thinking about a small card-sized object displaying info about the destination which you'd rez next to you, and that would when clicked attach to your AV to take you there. How does it sound ?
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
09-06-2005 03:04
OK, I got a prototype of a card that gets you automatically to the destination pointed at by the landmark file inside it. Can't test it until this evening though.
Should it provide more information before transporting ?
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
09-06-2005 13:36
Got it, tested it, it works GREAT  [Edit] Actually, not so great  I'm removing this version until I test the fixed one I wrote today.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
09-07-2005 13:22
OK, this is the definite version ! Drop your store's landmark inside, then distribute these around so people can hyperport to it  (requires rerouting script, ghost script and reroutes notecard from Hank Ramos's hyperport set) //Inter-Simulator Transport //by HankRamos //Version 1.4.2 //Modified into an autotransporting card by Jesrad Seraph upon request by Burke Prefect
//Options float travelHeight = 1000; float moveTau = 0.05;
//Variables list targetRegionList; vector targetLandmarkFileWPos; // World Coordinates for Landmark File vector evalPosition; vector subTravelWPos; vector subTravelLPos; vector targetRegionWPos; //World Coordinates vector targetRegionLPos; //Local Coordinates string targetRegionName; string targetName; string travelMode; key regionReadKey; key agentInfoKey; key ownerKey; key landmarkReadKey; integer targetHandle; integer timeoutCounter; integer evalDirection; integer secondTrigger; float subArrivalDistance; float distanceToTarget;
//Constants vector totarget(vector global, vector local) { vector target; vector dir; vector corner = llGetRegionCorner(); vector pos = llGetPos(); pos.x = pos.x + corner.x; pos.y = pos.y + corner.y; target.x = global.x + local.x; target.y = global.y + local.y; target.z = pos.z; dir = target - pos; distanceToTarget = llVecMag(dir); //Update global distance calculation variable return llVecNorm(global - llGetRegionCorner()); }
processGoCommand(vector tglob, vector tloc) { //Process Local Coordinates targetRegionLPos = tloc;
targetRegionWPos = tglob; targetRegionName = "LandmarkFile"; targetLandmarkFileWPos = targetRegionWPos; if (TRUE) state prep; } travelEvaluation() { llSetTimerEvent(0); //llApplyImpulse(-llGetMass()*llGetVel(),FALSE); vector currentSim = llGetRegionCorner(); vector pos = llGetPos(); evalPosition = totarget(targetRegionWPos, targetRegionLPos); integer moveHorizontal; //Figure out what direction to go... if (currentSim != targetRegionWPos) { secondTrigger = FALSE; vector directionPos; if (evalPosition.x == 0) { //llOwnerSay("evalPosition.x == 0"); //move vertical directionPos.x = 0; directionPos.y = evalPosition.y; //Check Edge of World if (llEdgeOfWorld(pos, llVecNorm(directionPos))) { //Request Reroute llSetTimerEvent(0); llMessageLinked(LINK_SET, 8449550, (string)llVecNorm(directionPos), NULL_KEY); return; } } else if (evalPosition.y == 0) { //llOwnerSay("evalPosition.y == 0"); //move horizontal directionPos.x = evalPosition.x; directionPos.y = 0; //Check Edge of World if (llEdgeOfWorld(pos, llVecNorm(directionPos))) { //Request Reroute llSetTimerEvent(0); llMessageLinked(LINK_SET, 8449550, (string)llVecNorm(directionPos), NULL_KEY); return; } } else if (llFabs(evalPosition.x) >= llFabs(evalPosition.y)) { //move horizontal directionPos.x = evalPosition.x; directionPos.y = 0; //Check Edge of World if (llEdgeOfWorld(pos, llVecNorm(directionPos))) { //move vertical directionPos.x = 0; directionPos.y = evalPosition.y; if (llEdgeOfWorld(pos, llVecNorm(directionPos))) { //Request Reroute directionPos.x = evalPosition.x; directionPos.y = 0; llSetTimerEvent(0); llMessageLinked(LINK_SET, 8449550, (string)llVecNorm(directionPos), NULL_KEY); return; } } } else if (llFabs(evalPosition.x) < llFabs(evalPosition.y)) { //move vertical directionPos.x = 0; directionPos.y = evalPosition.y; //Check Edge of World if (llEdgeOfWorld(pos, llVecNorm(directionPos))) { //move horizontal directionPos.x = evalPosition.x; directionPos.y = 0; if (llEdgeOfWorld(pos, llVecNorm(directionPos))) { //Request Reroute directionPos.x = 0; directionPos.y = evalPosition.y; llSetTimerEvent(0); llMessageLinked(LINK_SET, 8449550, (string)llVecNorm(directionPos), NULL_KEY); return; } } } directionPos.z = evalPosition.z; //llOwnerSay("Need to Move to Another Sim. Direction: " + (string)llVecNorm(directionPos)); subTravelWPos = currentSim; subTravelWPos += llVecNorm(directionPos) * 256; subTravelLPos.x = 128; subTravelLPos.y = 128; subArrivalDistance = 45; } else if (llGetListLength(targetRegionList) > 0) { targetRegionName = llList2String(targetRegionList, 0); targetRegionList = llDeleteSubList(targetRegionList, 0, 0); if (targetRegionName == "LandmarkFile") { targetRegionWPos = targetLandmarkFileWPos; travelEvaluation(); } else { regionReadKey = llRequestSimulatorData(targetRegionName, DATA_SIM_POS); } return; } else if (distanceToTarget < 1) { if (TRUE) state arrive; } else { //llOwnerSay("Need to move within this sim."); subTravelWPos = targetRegionWPos; subTravelLPos = targetRegionLPos; subTravelLPos.z = travelHeight; subArrivalDistance = 1; } llSetTimerEvent(moveTau); }
default { state_entry() { llSetText("", ZERO_VECTOR, 0.0); llSetForce(<0,0,0>, FALSE); distanceToTarget = 0; ownerKey = llGetOwner(); targetName = "Idle"; llMessageLinked(LINK_SET, 612, "", NULL_KEY); }
on_rez(integer p) { if (llGetInventoryNumber(INVENTORY_LANDMARK) > 0) { llSetObjectName("Telecard: " + llGetInventoryName(INVENTORY_LANDMARK, 0)); llOwnerSay("Touch me or wear me to transport to " + llGetInventoryName(INVENTORY_LANDMARK, 0)); } else { llOwnerSay("Drop a landmark in my contents then touch me to transport there"); } } changed(integer c) { if ((c & CHANGED_INVENTORY) && (llGetInventoryNumber(INVENTORY_LANDMARK) > 0)) { targetName = llGetInventoryName(INVENTORY_LANDMARK, 0); llSetObjectName("Telecard: " + targetName); if (llGetAttached() == 0) return; llOwnerSay("Transport Initialized!"); llOwnerSay("Going to " + targetName); travelMode = "teleport"; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); landmarkReadKey = llRequestInventoryData(targetName); } } touch_start(integer c) { if (llDetectedKey(0) != llGetOwner()) return; if (llGetInventoryNumber(INVENTORY_LANDMARK) > 0) { llSetObjectName("Telecard: " + llGetInventoryName(INVENTORY_LANDMARK, 0)); llRequestPermissions(llGetOwner(), PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION); } else { llOwnerSay("No landmark found ! Cannot offer transport..."); } } run_time_permissions(integer permissions) { if (permissions & PERMISSION_ATTACH) { if (llGetAttached() == 0) llAttachToAvatar(ATTACH_LHAND); } } attach(key id) { if (id != NULL_KEY) { if (llGetInventoryNumber(INVENTORY_LANDMARK) <= 0) { llOwnerSay("No landmark found ! Cannot offer transport..."); return; } llOwnerSay("Transport Initialized!"); travelMode = "teleport"; targetName = llGetInventoryName(INVENTORY_LANDMARK, 0); llOwnerSay("Going to " + targetName); llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); landmarkReadKey = llRequestInventoryData(targetName); } } dataserver(key requested, string data) { vector tWPos; vector tLPos; if (requested != landmarkReadKey) return; vector targetPos = (vector)data;
targetPos += llGetRegionCorner(); tWPos = targetPos; tWPos.x = ((integer)((tWPos.x) / 256)) * 256; tWPos.y = ((integer)((tWPos.y) / 256)) * 256; tLPos.z = targetRegionWPos.z; tWPos.z = 0; tLPos.x = targetPos.x - tWPos.x; tLPos.y = targetPos.y - tWPos.y; processGoCommand(tWPos, tLPos); } }
state prep { state_entry() { llMessageLinked(LINK_SET, 611, "", NULL_KEY); llRemoveInventory(llGetInventoryName(INVENTORY_LANDMARK, 0)); llSetObjectName("Telecard"); list tempList = llParseString2List(llKey2Name(llGetOwner()), [" "], []); if (llToLower(llList2String(tempList, llGetListLength(tempList) - 1)) != "linden") llSetForce(<0,0,9.8> * llGetMass(), FALSE); //Targets subTravelLPos = llGetPos(); if (travelMode == "hop") subTravelLPos.z = llGround(ZERO_VECTOR) + 50; if (travelMode == "teleport") subTravelLPos.z = travelHeight; if (travelHeight == 0) subTravelLPos.z = llGround(ZERO_VECTOR) + 50; if (llGetRegionCorner() == targetRegionWPos) { travelEvaluation(); state movement; } targetHandle = llTarget(subTravelLPos, 0.4); } not_at_target() { vector tempPos = subTravelLPos; vector pos = llGetPos(); if (llFabs(pos.z - tempPos.z) > 50 ) { if (pos.z > tempPos.z) { tempPos.z = pos.z - 50; } else { tempPos.z = pos.z + 50; } } llMoveToTarget(tempPos, 0.1); } at_target(integer tnum, vector targetpos, vector ourpos) { subTravelWPos = llGetRegionCorner(); subTravelLPos.x = 128; subTravelLPos.y = 128; subArrivalDistance = 75; state movement; } attach(key id) { state default; } on_rez(integer star_param) { state default; } touch_start(integer total_number) { llOwnerSay("Aborting transport."); llStopMoveToTarget(); llApplyImpulse(-llGetMass()*llGetVel(),FALSE); llTargetRemove(targetHandle); }
state_exit() { llStopMoveToTarget(); llApplyImpulse(-llGetMass()*llGetVel(),FALSE); llTargetRemove(targetHandle); } }
state movement { state_entry() { llOwnerSay("Moving..."); //llOwnerSay("Region Route List Currently: " + llDumpList2String(targetRegionList, "*")); llSetTimerEvent(0.1); } attach(key id) { state default; }
on_rez(integer star_param) { state default; } touch_start(integer total_number) { llOwnerSay("Aborting transport."); llStopMoveToTarget(); llApplyImpulse(-llGetMass()*llGetVel(),FALSE); } dataserver(key requested, string data) { if (requested == regionReadKey) { targetRegionWPos = (vector)data; travelEvaluation(); } }
link_message(integer sender_num, integer num, string str, key id) { if (num == 8449551) { secondTrigger = FALSE; targetRegionList = llCSV2List(str) + [targetRegionName] + targetRegionList; //llOwnerSay("Region Route List Updated to: " + llDumpList2String(targetRegionList, "*")); targetRegionName = llList2String(targetRegionList, 0); targetRegionList = llDeleteSubList(targetRegionList, 0, 0); if (targetRegionName == "LandmarkFile") { targetRegionWPos = targetLandmarkFileWPos; travelEvaluation(); } else { regionReadKey = llRequestSimulatorData(targetRegionName, DATA_SIM_POS); } } else if (num == 8449552) { if (secondTrigger) { llOwnerSay("Can't find a route... Transport aborted :("); state default; } //Try Other Direction vector directionPos; //llOwnerSay("Trying Other Direction: " + (string)evalPosition); if (llFabs(evalPosition.x) >= llFabs(evalPosition.y)) { //move vertical //llOwnerSay("Second Change Try Vertical..."); directionPos.x = 0; directionPos.y = evalPosition.y; } else { //move horizontal //llOwnerSay("Second Change Try Horizontal..."); directionPos.x = evalPosition.x; directionPos.y = 0; } directionPos.z = evalPosition.z; if (llEdgeOfWorld(llGetPos(), directionPos)) { //Request Reroute secondTrigger = TRUE; llMessageLinked(LINK_SET, 8449550, (string)llVecNorm(directionPos), NULL_KEY); return; } subTravelWPos = llGetRegionCorner(); subTravelWPos += llVecNorm(directionPos) * 256; subTravelLPos = <128,128, travelHeight>; subArrivalDistance = 45; llSetTimerEvent(moveTau); } }
timer() { integer whileCounter; vector pos = llGetPos(); float tau; integer x; while (((pos.x < 0) || (pos.x > 255) || (pos.y < 0) || (pos.y > 255)) && (whileCounter < 100)) { llSleep(0.1); pos = llGetPos(); whileCounter++; }
if (travelHeight == 0) subTravelLPos.z = llGround(ZERO_VECTOR) + 50; if (travelMode == "hop") subTravelLPos.z = llGround(ZERO_VECTOR) + 50; if (travelMode == "teleport") subTravelLPos.z = travelHeight; vector targetPos = subTravelWPos - llGetRegionCorner() - pos + subTravelLPos; float distance = llVecMag(targetPos); if (distance > 60) targetPos = llVecNorm(targetPos) * 60; targetPos += pos; //llApplyImpulse(evalPosition * llGetMass(), TRUE); llMoveToTarget(targetPos, moveTau); if (distance < subArrivalDistance) { travelEvaluation(); } } state_exit() { llStopMoveToTarget(); llTargetRemove(targetHandle); } }
state arrive { state_entry() { llApplyImpulse(-llGetMass()*llGetVel(),FALSE); llMessageLinked(LINK_SET, 612, "", NULL_KEY); llOwnerSay("Arriving..."); float groundHeight = llGround(ZERO_VECTOR); llSetForce(<0,0,0> * llGetMass(), FALSE); if (targetRegionLPos.z < groundHeight) targetRegionLPos.z = groundHeight; //Targets targetRegionLPos.z += 60; targetHandle = llTarget(targetRegionLPos, 0.1); //llOwnerSay("Landing at " + (string)(targetRegionLPos.z ) + " meters..."); } not_at_target() { vector tempPos = targetRegionLPos; vector pos = llGetPos(); //llOwnerSay("Not At Arrival Target!" + (string)tempPos);
if (llFabs(pos.z - tempPos.z) > 60 ) { if (pos.z > tempPos.z) { tempPos.z = pos.z - 60; } else { tempPos.z = pos.z + 60; } } llMoveToTarget(tempPos, 0.1); } at_target(integer tnum, vector targetpos, vector ourpos) { llApplyImpulse(-llGetMass()*llGetVel(),FALSE); llSleep(0.1); llStopMoveToTarget(); llTargetRemove(targetHandle); targetRegionLPos.z -= 60; targetRegionLPos.z -= llGround(ZERO_VECTOR) - 0.5; llSetHoverHeight(targetRegionLPos.z, FALSE, 0.16); llSleep(0.1); llSetHoverHeight(0, FALSE, 0.1); llOwnerSay("Here you are !"); } on_rez(integer star_param) { state default; } collision_start(integer num_detected) { llSay(0, "Arrived. Collided with " + llDetectedName(0)); state default; } state_exit() { llStopMoveToTarget(); llTargetRemove(targetHandle); llOwnerSay("Transport Complete!"); llSleep(0.25); llApplyImpulse(-llGetMass()*llGetVel(),FALSE); llSleep(1.0); llStopAnimation("falldown"); } }
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|