Notecard Teleportation
|
Zac Bunderfeld
Registered User
Join date: 19 Mar 2004
Posts: 16
|
01-01-2005 14:16
Since March, I, along with several others, have been creating teleportation scripts. They are highly refined and work greatly, better than any other script I've seen.
They have one minor flaw, however. Editing the flttext, sittext and destination requires editing the actual script, a feat too hard for the average user to do.
So, for a few weeks, I have been working on notecard support for the script, getting nowhere. I am completely stumped. I have no idea how this works. So, please, help.
The destination is a vector named "dest." How can I get "dest," to read a notecard line?
-Zac
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
01-01-2005 14:40
Here's a sample notecard: DEST:<349, 129, 43>
and the script to read it: vector dest;
// The prefix of the line containing the destination vector. string DEST_LINE_PREFIX = "DEST:"; // Put notecard's name here: string NOTECARD_NAME = "";
// For notecard reading: integer curLine; key curRead;
// Utility, helps with string parsing. string removePrefixFrom(string str, string prefix) { if (llSubStringIndex(str, prefix) != 0) return ""; return llDeleteSubString(str, 0, llStringLength(prefix) - 1); }
default { state_entry() { // Put this where you want the read to occur. state readDest; } }
state readDest { state_entry() { curLine = 0; curRead = llGetNotecardLine(NOTECARD_NAME, curLine); } dataserver(key read, string data) { if (read == curRead) { curRead = ""; if (llSubStringIndex(data, DEST_LINE_PREFIX) == 0) { string destStr = removePrefixFrom(data, DEST_LINE_PREFIX); dest = (vector) destStr; state postRead; } else if (data != EOF) { // Try finding dest on the next line. curLine++; curRead = llGetNotecardLine(NOTECARD_NAME, curLine); } else { // dest was not found in the notecard } } } }
state postRead { state_entry() { // Code to run after dest is found goes here. } }
|
Zac Bunderfeld
Registered User
Join date: 19 Mar 2004
Posts: 16
|
01-01-2005 14:48
You have to be kidding me. There must be an easier way to do that. What do I do with that script? Add it to the teleportation script? I don't want anything complex, I just want "dest," to read the numbers from the notecard.
-Zac
EDIT: Nvm, I hadn't even read the whole script before I wrote that. I get it now. Thanks SOO much. It needs a little work to be completly compatible, but it's a step in a great direction. Thanks again! -Zac
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-01-2005 16:36
are you using note card to store locations or are you using it to store settings that would normally just be hidden in the script. ? if you are using note cards to store locations. Do you plan to have support for teleporting across many sims?
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
01-01-2005 22:35
From: Kurt Zidane Do you plan to have support for teleporting across many sims? Isn't it impossible to "teleport" across sims using llSitTarget? Unless the powers that be changed something recently, I think so... ==Chris
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-02-2005 01:00
I have herd it can be done. but dn't ask me how. I guess it's the same way some one can teleprot from one end of the sim to another.
|
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
01-02-2005 04:54
The limit in distance for llSitTeleport is 300m. Sim borders do not affect this limit in any way, except POSSIBLY if you try to cross into a sim that does not share a border with you (sims that only share corners do NOT share borders). To find out for yourself, test it.
_____________________
</sarcasm>
|
DNA Prototype
Mad Scientist
Join date: 8 Aug 2004
Posts: 179
|
01-02-2005 05:36
Why not set up sensors so you dont change the script or notecard or anything- The teleporters could find each other and report their location automatically.
DNA
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-02-2005 06:55
I though sensors had a 300 M limit.
|
Chalky White
Second Life Resident
Join date: 1 Nov 2004
Posts: 140
|
01-02-2005 10:37
I think sensors have a 96m limit, sit-teleporting a 300m limit, so finding the arrival pad with a sensor reduces the effective range. Sit-teleporting across a sim boundary works, but likely you'll arrive with crippled legs - the walk animation in a mess and no reliable easy way to correct it. Though sitting on something often works. Its not elegant.
|
Adam Marker
new scripter
Join date: 2 Jan 2004
Posts: 104
|
object description?
01-02-2005 14:54
Now that we have llGetObjectDesc, would it work to store the destination in the teleporter's description? Seems like you would have to make the object modifiable, but that is probably ok, since all the real value could be stored in protected scripts.
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-02-2005 15:24
The problem with storing values inside a script. If at some point the scrip need to updated, it will require a manual update of all instances. Worse the manual update will require manual editing of each script. Maybe it could be done with e-mail, but that has it's own complications right? Actually storing it in the desc not a bad idea, Because it is dynamic. But the desc field has a sever size limit.
He could store the values in a separate script. And use link lists to extract the values. Witch would be dynamic. And allow him to maintain the settings. Using a list so new values fields can be added. If he need to update that data storing script, that going to requires even more coding. Script reset when dragged into a new object right? I really don't know. if it doesn't that very powerful.
If he uses a note card, he just has to update the script, and it will load it's old values. It's also easy to distribute a note card between all the teleports. Plus it could go to place where a destination ball can't be placed.
E-mail hmm email.. shout... hmm. Ether one would require no field to edit manually. E-mails slower then shouting. But later on if they do add support for teleporing. And it's not limited to a set distance.E Then e-mail becomes the better choice.
|
Adam Marker
new scripter
Join date: 2 Jan 2004
Posts: 104
|
storing in description works ok
01-03-2005 10:41
I gave it a try, and it worked fine. The teleporter object must be modifiable, so the new owner can set the description. The teleport script can be protected as you like.
I set the object description to: <0, 0, 10> Then set the sit target: llSitTarget((vector) llGetObjectDesc(), ZERO_ROTATION) ; And then, I was sitting on air!!
|
Synch Thetan
Full of Cheese
Join date: 26 Feb 2004
Posts: 27
|
01-03-2005 11:04
Zac, I have what you are looking for. I don't have the code with me at the moment or I would post it. Talk to me in world.
_____________________
"I reject your reality and substitute my own."
|
Synch Thetan
Full of Cheese
Join date: 26 Feb 2004
Posts: 27
|
01-03-2005 11:33
I've had a notecard teleporter working for quite a while now... it doesn't have nearly as many failsafes as the notecard script above... Call it quick and dirty 
_____________________
"I reject your reality and substitute my own."
|