steph Arnott Posted June 28, 2013 Share Posted June 28, 2013 gone Link to comment Share on other sites More sharing options...
Ela Talaj Posted June 29, 2013 Share Posted June 29, 2013 I'm not sure what the problem is either because this sentence makes no sense to me: If i switch the state so the object does not rezz on tp and the tp around, when i then call the objectt the script is locked to the exterior tp call function when it should use the summon function. However your code is very poorly written, which may well be the reason it doesn't work. Let's look for example at this snippet: link_message(integer sender_number, integer number, string data, key id) { if (number == 2002400) { llGetListLength(gFormList); llGetListLength(gOffSetList); gFormList = llDeleteSubList(gFormList,0,-1); gOffSetList = llDeleteSubList(gOffSetList,0,-1); gFormList = llParseString2List(data, ["|"], []); state readNotecard; } else if ((number == 2002100) && (data == "SummonTTC")) { Exterior_summon_call(); state noRezz; } else if ((number == 2002700) && (data == "noRezz")) { state noRezz; } } llGetListLength(gFormList) and llGetListLength(gOffSetList) are both meaningless because they don't store result in a variable; if you don't need the result (and you don't) why call the method? gFormList = llDeleteSubList(gFormList,0,-1) and gOffSetList = llDeleteSubList(gOffSetList,0,-1) clear respective lists in the most convoluted way. What is wrong with gFormList = gOffSetList = []; In fact you don't even need to clear gFormList because the very next line overwrites its previous value anyways. You don't need any "elses" there either because if the condition is satisfied your code changes states. So the snippet should look like this: link_message(integer sender_number, integer number, string data, key id) { if (number == 2002400) { gOffSetList = [ ]; gFormList = llParseString2List(data, ["|"], []); state readNotecard; } if (number == 2002100 && data == "SummonTTC") { Exterior_summon_call(); state noRezz; } if (number == 2002700 && data == "noRezz") { state noRezz; } } I know it is not very helpful in respect to the problem, but perhaps if you restate more concisely what the problem is I could look more. Link to comment Share on other sites More sharing options...
steph Arnott Posted June 29, 2013 Author Share Posted June 29, 2013 Thx Ela for the lesson, i will study your points. I not a programer or scripter just a girl trying to do things as best i can. Trouble is reading sl book and wiki does not reaally explain what acctually happens.I will rerite the question. When i teleport, the object rezz around me and if i summon the object it rezz in front of me. this works ok. I tell the hud not to rezz on teleport then i can teleport ie clubs without the object rezzing. this works fine, the problem is when i do summon the object after teleporrting around it does not rezz in front of me as it should but around me. It only does this once then the summon works perfect. Not sure that any clearer, lol As i say i not a programer, but i will make every effort to keep writing scripts to just use as little code as poss. Link to comment Share on other sites More sharing options...
steph Arnott Posted June 29, 2013 Author Share Posted June 29, 2013 ok inderstand that this clears the value gOffSetList = [ ]; But not how this is gFormList = llParseString2List(data, ["|"], []); Link to comment Share on other sites More sharing options...
Ela Talaj Posted June 30, 2013 Share Posted June 30, 2013 Your script appears to listen to linked messages and do something when a certain link message is received. But who is it received from? Who issues linked messages? Is there another script? Link to comment Share on other sites More sharing options...
steph Arnott Posted June 30, 2013 Author Share Posted June 30, 2013 gone Link to comment Share on other sites More sharing options...
Ela Talaj Posted July 1, 2013 Share Posted July 1, 2013 All states are equal, Stephania, and none is more equal than others. "default" is simply where the server starts execution after it loads the script in its memory. It is basically the same as "main" in C/C++. When a program is booted the loader looks for "main" to start execution, but more often than not main simply creates child processes which run on their own and never return to main. By the same token LSL default state may immediately pass control to another state and the thread never returns to default unless llResetScript() is executed. Each state consists of events processing, there is nothing else to it. An "event" is simply a signal processing function. When something occurs, like an object is touched or collision is detected or a message is received the server sends a respective signal to the script in whatever state it may be. The server always sends all signals but whether or not they are processed by the script depends on if there is a processing function in the state the script is in. For instance in your script there is changed event in the default state. So if the script is in the default state, this event will be processed and control will be passed to Exterior_teleport_call() user function. However if change occurs while the script is in a state other than default, it will be ignored because there is no user processing function.in those states. That's where most probably your error is. There should be changed event in each state. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now