How Long Should llMessageLinked take???
|
|
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
|
07-04-2007 17:07
I have two scripts in the same prim (for memory reasons, sigh.) When the prim is touched it sends out this message: llMessageLinked(LINK_THIS, 0, "Start Music", ToucherID); The second script has this: link_message(integer sender_num, integer num, string str, key id) { if (str == "Start Music){ ToucherID = id; ToucherName = llKey2Name(ToucherID); llSay(0,"test got message"  ; MyFunction(); } } Issue: when object is rezzed or scripts reset in it, and you touch it, it takes like 20 to 30 seconds for my test message llSay(0,"got message"  ; to appear on the screen. It appears that it's taking *forever* for the sent message from script 1 to reach script 2. yet, if you then afterward touch the prim repeatedly, it's instanteous. Any idea what is going on, anyone? Would carrier pigeons be faster?
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
07-04-2007 18:32
I've never encountered anything like that. Perhaps one of the scripts is taking a very long time initializing variables and running state_entry. If the scripts are reset and the prim sits idle for 30 seconds before touching, is the same result obtained? (If so, it's not the initialization thing.)
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
07-04-2007 23:29
First, check to see if it's something else in your script by using a simple test setup.. put these two script in your prim, reset them and and see if there's a delay. If no delay, then the problem is likely logic within your particular scripts. default { state_entry() {llMessageLinked(LINK_THIS, 0, "ping", ""  ;} } default { link_message(integer sender_num, integer num, string str, key id){ llOwnerSay(str); } }
|
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
07-05-2007 09:51
Were you testing this in a sandbox (worst case = weapons test?). Some places are bogged down by scripts so badly (in the case of a sandbox by griefer, and sometimes just as bad - anti griefer scripts) that this would not be unexpected behavior.
Just on the offchance you can go to view->statistics and the 'sim' section of the statistics hud will give you information about how many scripts are running, updates per second etc. Just a thought, probably irrelevant.
Cheers, S
|
|
SLii Action
Registered User
Join date: 4 Dec 2006
Posts: 0
|
Same behavior with eMails
07-05-2007 22:58
I am noticing something similar with some of my scripts... i have a Notecard client/server pair that normally works fine. Somebody clicks the client, it sends an email to the server and the server gives the notecard to the person that clicked the client. I have checked the "statistics bar" and did not notice anything odd but after waiting a few minutes to an hour or so with nobody clicking ANY of the clients... the first click to the client seems to be ignored by the server. I know its sending out the email tho... The server starts responding again if you click the client again. The server polls for an email every 5 seconds... if its processing emails and there are more.. it fires every second till there are no more to process then it falls back to 5 seconds. I tested the polling with a simple llOwnerSay("beep"  and it seems to be timed fine. I added a reset to the script if the available memory falls lower than 100 but it seems that has not had to fire yet.
|
|
Web Page
slow but steady
Join date: 4 Dec 2004
Posts: 129
|
07-08-2007 10:20
Im surprised that even compiled: if (str == "Start Music){ is not a valid line.
|
|
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
07-08-2007 10:35
Could just be script lag -- too many scripts (or inefficent scripts) running wherever you were. Try again in a sim that's not very busy. Test using some scripts you're familiar with, that do simple things on touch or say, and make sure response is reasonable first.
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
07-08-2007 12:29
From: Web Page if (str == "Start Music){ is not a valid line. Apparently there is another double-quote farther down the script which was interpreted as the close of that string. It might compile, but it certainly won't execute as intended.
|
|
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
|
fair enough
07-09-2007 09:07
>> Im surprised that even compiled:
>> if (str == "Start Music){
>> is not a valid line.
LOL. Okay, fair enough. When I posted here in this forum, I changed the actual wording of the string on the fly cause was thinking i should change it back in the script, and was careless and forgot the closing quote here.
You know what I think was making the response so slow: the reading the notecard routine. I will post about this in a thread about notecards where it may be more relevant. Thanks everyone, got it licked.
p.s. was testing in Anacortes Harbor sim, just about the lowest lag sim in SL there is.
|
|
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
|
07-09-2007 11:03
Yes, reading data from a notecard will cause your script to be slow down. From the Wiki: http://lslwiki.net/lslwiki/wakka.php?wakka=llGetNotecardLineFrom: someone Note: This function delays the script for 0.1 seconds. So multiple 0.1 * the number of lines in your notecard (or worse multiple cards).
|