Jump to content

Gregory McLeod

Resident
  • Posts

    140
  • Joined

  • Last visited

Everything posted by Gregory McLeod

  1. Thanks Innula I will try your version as soon as I can. The script was meant to fall over and report the line that caused the failure if it was not correctly formatted but I changed that to simplify the testing. The verbose version gets as far as reading ALL the lines in the notecard but it is waiting for a message from the first script, the one that attaches the prim as a hud to complete the attaching, whereupon it sends a message to all the other scripts via link_message. When this script gets all the notecard lines it is supposed to go to the Initialize state and send the fact that it is finished. But the trace from the llOwnerSay tracking seems to indic ate that the message is never received. Thanks to all who took the time and trouble to help me out.
  2. Thanks for the input. I think I am sending a request for a line one at a time. The default state/state_entry calls LoadMessages() LoadMessages issues request for first line (giLine = 0) setting gkRequestID The Dataserver event checks the requestID received matches the gkRequestID and proceeds to process the line from the data supplied and then calls for a second line setting the gkRequestID again. Repeating this until EOF received. If I understand you correctly you are saying that the response may be arriving before the request is sent???
  3. I am struggling with a HUD that refuses to work correctly. One script handles the ATTACHing, another script hansles the ANIMATIONs and CONTROLS and the thirs handles the user ci=ommunication. It is this script that is causing me problems. It is structured so that in the defaults state_entry event it calls a function to load messages from a NOTECARD into memory and only when complete notify the other scripts it is ready to accept messages intended for the User. These messages are coming in the form of link_message events. They seem to interruot the dataserver event and prevent it from receiviing other lines which are requested. Is there a problem here or am I coding it incorrectly. <code> integer S5ChecksComplete = FALSE; integer AllChecksComplete = FALSE; key gkPlayer = NULL_KEY; float gfTimeOut = 60.0; integer giTimerMsgs = FALSE; integer giTimerChecks = FALSE; list gaMessageIDs = []; list gaMessages = []; string gsMessageNotecard = ""; integer giLine = 0; key gkRequestID = ""; string gsDefaultMessageNC = "@Messages"; string gsEscape = "~"; integer MSG_OWNERSAYMSG = 0x0210; integer MSG_WHISPERMSG = 0x0211; integer MSG_SAYMSG = 0x0212; integer MSG_SHOUTMSG = 0x0213; string gsHexDigits = "0123456789ABCDEF"; integer MessagesLoaded = FALSE; LoadMessages() { if (llGetInventoryType(gsMessageNotecard) == INVENTORY_NOTECARD) { gaMessageIDs = []; gaMessages = []; giLine = 0; gkRequestID = llGetNotecardLine(gsMessageNotecard,giLine); } else llOwnerSay((string)llGetUnixTime() + " UI: Messages notecard '" + gsMessageNotecard + "' not found!"); } string GetMessage(integer piMessageID, list paMessageData) { integer liIndex; integer liLast; integer liEnd; string lsRawMessage; string lsMessage; string lsData; string lsCode; list laData; liIndex = llListFindList(gaMessageIDs,[piMessageID]); if (liIndex >= 0) { lsRawMessage = llList2String(gaMessages,liIndex); lsMessage = ""; while (lsRawMessage != "") { liLast = llStringLength(lsRawMessage) - 1; liIndex = llSubStringIndex(lsRawMessage,gsEscape); lsData = ""; if (liIndex >= 0) { liEnd = liIndex - 1; if (liIndex < liLast) { ++liIndex; lsCode = llGetSubString(lsRawMessage,liIndex,liIndex); if (lsCode == gsEscape) lsData = gsEscape; else if (lsCode == "n") lsData = "\n"; else if (lsCode == "t") lsData = "\t"; else if ((string)((integer)lsCode) == lsCode) lsData = llList2String(paMessageData,(integer)lsCode); } } else liEnd = liLast; if (liEnd >= 0) lsMessage += llGetSubString(lsRawMessage,0,liEnd); lsMessage += lsData; lsRawMessage = llDeleteSubString(lsRawMessage,0,liIndex); } } else lsMessage = "[Unknown Message ID: "+BinaryToHex(piMessageID,4)+"; Params='"+llDumpList2String(llDeleteSubList(laData,0,0),"','")+"']"; return lsMessage; } string BinaryToHex(integer piData, integer piDigits) { string lsData; lsData = ""; do { lsData = llGetSubString(gsHexDigits,piData & 0x0F,piData & 0x0F) + lsData; piData = piData >> 4; piDigits -= 1; } while (piDigits > 0); return lsData; } default { state_entry() { llOwnerSay((string)llGetUnixTime() + " U5:default state_entry event"); llOwnerSay((string)llGetUnixTime() + " U5:default "+(string)llGetFreeMemory()); gkPlayer = llGetOwner(); llSetTimerEvent(gfTimeOut); giTimerMsgs = TRUE; giTimerChecks = TRUE; gsMessageNotecard = gsDefaultMessageNC; LoadMessages(); } dataserver(key pkRequestID, string psData) { integer liIndex; if (pkRequestID == gkRequestID) { if (psData != EOF) { liIndex = llSubStringIndex(psData,"="); if (liIndex > 0) { gaMessageIDs += [(integer)("0x"+llGetSubString(psData,0,liIndex-1))]; gaMessages += [llDeleteSubString(psData,0,liIndex)]; ++giLine; llOwnerSay((string)llGetUnixTime() + " dataserver line: " + (string)giLine); gkRequestID = llGetNotecardLine(gsMessageNotecard,giLine); } else llOwnerSay((string)llGetUnixTime() + " dataserver Bad Message line:\n"+psData); } else { llOwnerSay((string)llGetUnixTime() + " dataserver message lines loaded: " + (string)giLine); MessagesLoaded = TRUE; llSetTimerEvent(0.0); giTimerMsgs = FALSE; } } else llOwnerSay((string)llGetUnixTime() + " dataserver error"); } on_rez(integer piParam) { llResetScript(); } attach(key pkOwner) { llOwnerSay((string)llGetUnixTime() + " U5:default attach event"); if (pkOwner != NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " U5:default Game data set up!"); llSetTimerEvent(gfTimeOut); giTimerChecks = TRUE; } else { llOwnerSay((string)llGetUnixTime() + " U5:default Invalid game data!"); llSleep(10.0); llDie(); } } link_message(integer piSender, integer piData, string psData, key pkID) { llOwnerSay((string)llGetUnixTime() + " U5:default link_message-event"); llOwnerSay((string)llGetUnixTime() + " U5:default link_message data " + psData); if (psData == "S5ChecksComplete") { llOwnerSay((string)llGetUnixTime() + " U5:default S5ChecksComplete message received"); S5ChecksComplete = TRUE; giTimerChecks = FALSE; llSetTimerEvent(0.0); if (S5ChecksComplete & MessagesLoaded) { state Initialize; } else llOwnerSay((string)llGetUnixTime() + " U5:default waiting for MessagesLoaded"); } else llOwnerSay((string)llGetUnixTime() + " U5:default waiting for S5ChecksComplete message"); } timer() { if (giTimerChecks) { llOwnerSay((string)llGetUnixTime() + " U5:default timed out waiting on " + "S5CheckComplete message"); llSleep(10.0); llDie(); } if (giTimerMsgs) { llOwnerSay((string)llGetUnixTime() + " U5:default timed out waiting on " + "message loading"); llSleep(10.0); llDie(); } } } state Initialize { state_entry() { llOwnerSay((string)llGetUnixTime() + " U5:Initialize state_entry event"); llOwnerSay((string)llGetUnixTime() + " U5:Initialize doing other things"); llMessageLinked(LINK_THIS,0,"U5ChecksComplete",gkPlayer); } on_rez(integer piParam) { llResetScript(); } link_message(integer piSender, integer piData, string psData, key pkID) { llOwnerSay((string)llGetUnixTime() + " U5:Initialize link_message-event"); llOwnerSay((string)llGetUnixTime() + " U5:Initialize link_message data " + psData); if (psData == "AllChecksComplete") { llOwnerSay((string)llGetUnixTime() + " U5:Initialize AllChecksComplete message received"); AllChecksComplete = TRUE; giTimerChecks = FALSE; llSetTimerEvent(0.0); state Runtime; } else llOwnerSay((string)llGetUnixTime() + " U5:Initialize waiting for AllChecksComplete message"); } timer() { if (giTimerChecks) { llOwnerSay((string)llGetUnixTime() + " U5:Initialize timed out waiting on " + "AllCheckComplete message"); llSleep(10.0); llDie(); } } } state Runtime { state_entry() { llOwnerSay((string)llGetUnixTime() + " U5:Runtime state_entry event"); llOwnerSay((string)llGetUnixTime() + " U5:Runtime doing other things"); } attach(key pkPlayer) { llOwnerSay((string)llGetUnixTime() + " U5:Runtime attach event"); if (pkPlayer == NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " U5:Runtime attach null-key"); } else { gkPlayer = pkPlayer; llOwnerSay((string)llGetUnixTime() + " U5:Runtime waiting"); } } link_message(integer piSender, integer piData, string psData, key pkID) { list laData; if ((piData == MSG_OWNERSAYMSG) || (piData == MSG_WHISPERMSG) || (piData == MSG_SAYMSG) || (piData == MSG_SHOUTMSG)) { laData = llParseString2List(psData,["\n"],[]); psData = GetMessage((integer)llList2String(laData,0),llDeleteSubList(laData,0,0)); if (piData == MSG_OWNERSAYMSG) llOwnerSay(psData); else { psData = "[" + llKey2Name(llGetOwner()) + "] " + psData; if (piData == MSG_WHISPERMSG) llWhisper(0,psData); else if (piData == MSG_SAYMSG) llSay(0,psData); else if (piData == MSG_SHOUTMSG) llShout(0,psData); } } } on_rez(integer piParam) { llResetScript(); } touch_start(integer number) { llOwnerSay((string)llGetUnixTime() + " U5:Touched in Runtime state"); llOwnerSay((string)llGetUnixTime() + " U5:Messages loaded: " + (string)llGetListLength(gaMessages)); } } </code> Any help cheerfully acknowledged.
  4. @LeprKhan reply timed at 1-10-2014 7.21 pm I tried your version of the scripts which run but after I had added something to let me see which scripts were running I found only the MultiScriptS3 was running. This is not a criticism but a fact to prevent others trying it. I have a version which works but it still has all the documenting llOwnerSay s in it so I wount burden you all with re-pasting it. I have now moved on to modifications to implement the actual tasks that the scripts are meant to do. Also modification of my one is necessary to overcome a failing 'it does restart correctly'.
  5. Is this possible. My reading of the attach entry in the wiki seems to indicate that it is not. You must detach from one position and then of course the script is no longer running so can't attach to another position. Anyone know of a way?
  6. @LepreKhaun Thank you for your help and input. Points on your content 1. The many too many llOwnerSay lines weree put in after I was having a terrible time determining why it wasn't working. I agree 90% or more of them could be eliminated. 2. <quote>Now observe the two lines in S3 that inactivate the other two scripts. They appear twice, once in state_entry() and again in attach(). But one can't get to that second spot without having gone through the first, which makes the second occurrence redundant clutter, so remove them as well.</quote> This has been done in the version I have now which is working as expected withe help received earlier. 3. <quote>/* HUH??? I thought you said this script was meant to "get permissions to animate and or control the avatar". Are you certain you also want it to be involved with the attaching and detaching of the object as well? And what's with all the "DETACH" I see here. Are you certain it's messaging that correctly each time? */ </quote> These have been working correctly but have all now been removed. I was under the wrong impression that should not request permission to attach in any other script than the first. It seems that is wrong. My bad. 4. <quote> timer() { // this event will never be triggered llMessageLinked(LINK_THIS,0,"DETACH",NULL_KEY);</quote> Absolutely correct I forgot to remove it when I changed the approach. With so much happeneing at different time and different sequences each time I try the scripts I felt it was necessary to stop timer events happening willy-nilly so cut a lot of them out but forgot to remove the timer event. Thanks again for your patience and help.
  7. @Ron Khondji Thank you for your thoughts and reply. In fact the three scripts set out to do exactly what you suggested. MultiScriptS3 is the one that does the attaching and detachs if permission is not granted. It also communicates with a website to confirm that the version of the HUD is the correct one and detach if not after sending a new one of the latest version. It also performs a check that the player(user) is registered by further communication with the website it checks that the player is known what functions they can perform and that they are not using an 'alt' by reference to a table held on the website. MultiscriptM3 is the one that will do all the animating and control functions. As such it needs to request permission to animate and control the avatar detaching if permission not granted. MultiScriptU3 is the one that will do the interfacing with the user. A problem arises if the user does not permit the animation and control functions. This must cause detaching. The same problem exists to a lesser extent in the the third script. Now examine the effect of the following scenario. 1. All the scripts execute correctly. 2. The player does what they came to do and then detachs the HUD from themselves. This will leave the HUD in the state that it reached, the running state. 3. When the HUD is again 'worn' or 'attached' it must redo the checks that were done the firast time by Script S3 It is the problem of ensuring that the other scripts are in a compatible state to restart. Remembering that the second script M3 may have to cause a detach event. My work on this leads me to believe that with all the possibilities of which state the scripts are in when detached they must be reset so that the crosschecking can be done again. I hope this might help to explain my problem and confusion.
  8. I am not sure I understand you. "Becouse it seems to have no thought on logic" Please explain in more detail why you think there is no logic. I am always open to discussion and will explain in more detail the thinking behind this truncated script tester if you want.
  9. Thank you for that info. I had not thought to touch the box which I will investigate. Do you have any thoughts as to why the "cannot find MultiScriptxx" appear?
  10. If permission to attach is not given you are correct it dies - expected action. The script S3 is meant to attach the prim to the HUD position bottom right and then signal to the other scripts that it has completed that. It initially stops the other two scripts until this has been done. The other two scripts are then started before the message to them is sent. They then will 'do other things' meaning that part of the script is not yet coded but they will eventually have sections which in M3 will get permissions to animate and or control the avatar and in U3 will manage the user interface send and receive messages and commands to and from the Avatar. I expected the scripts initially to run asynchronously which is why the stopping and restarting of the scripts was coded. What I observe happening is the following If the prim is rezzed on the ground and the scripts recompiled they seem to be compiled ok but never in the same oreder twice. If the prim is reszzed on the ground and the scripts initially compiled in the non running state and then reset the S3 script asks for permission to ATTACh and if given OK continues as do the others but I never get the message from the S3 script that it is 'doing other things' which should be the same as the other two. However if I then detach from self and try to 'wear' it it stops I think because it is not being attached as HUD. If instead I attach as HUD borttom right it seems to work except it does not repeat a second time. I cannot get a consistent execution to enable me to debug the code. I hope that helps you to help me further Thanks for your input.
  11. I have a big favor to ask. I need some help to find out why the attached scripts do not work. Put all three scripts in a single prim they should co-operate and ask for permission to attach as HUD bottom right and end with message from each that the runtime state is doing other things. integer ChecksComplete = FALSE; integer M3ChecksComplete = FALSE; integer U3ChecksComplete = FALSE; integer AllChecksComplete = FALSE; integer AllChecksCount = 0; key gkPlayer = NULL_KEY; float gfTimeOut = 60.0; integer giTimer = FALSE; default { state_entry() { llOwnerSay((string)llGetUnixTime() + " S3:default state_entry event"); llSetScriptState("MultiScriptM3",FALSE); llSetScriptState("MultiScriptU3",FALSE); llOwnerSay((string)llGetUnixTime() + " S3:default "+(string)llGetFreeMemory()); gkPlayer = llGetOwner(); llSetTimerEvent(gfTimeOut); giTimer = TRUE; llRequestPermissions(gkPlayer,PERMISSION_ATTACH); } run_time_permissions(integer piPerm) { if (piPerm & PERMISSION_ATTACH) { llOwnerSay((string)llGetUnixTime() + " S3:default r_t_p Permission granted"); llAttachToAvatar(ATTACH_HUD_BOTTOM_RIGHT); } else { llOwnerSay("Permission not granted. - DIE"); llSleep(5.0); llDie(); } } attach(key pkOwner) { llOwnerSay((string)llGetUnixTime() + " S3:default attach event"); llSetScriptState("MultiScriptM3",FALSE); llSetScriptState("MultiScriptU3",FALSE); gkPlayer = pkOwner; if (pkOwner != NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " S3:default:attach S3 OK"); llSetTimerEvent(gfTimeOut); giTimer = TRUE; llSetScriptState("MultiScriptM3",TRUE); llSetScriptState("MultiScriptU3",TRUE); state Runtime; } else { llOwnerSay((string)llGetUnixTime() + " S3:default:attach S3 FAIL"); state Detach; } } timer() { if (giTimer) { llOwnerSay((string)llGetUnixTime() + " S3:default timed out waiting on " + "permission to attach"); llDie(); } } } state Runtime { state_entry() { llOwnerSay((string)llGetUnixTime() + " S3:Runtime state_entry event"); llMessageLinked(LINK_THIS,0,"S3ChecksComplete",gkPlayer); } attach(key pkOwner) { llOwnerSay((string)llGetUnixTime() + " S3:Runtime attach event"); if (pkOwner == NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " S3:Runtime attach null-key"); state Detach; } else { gkPlayer = pkOwner; llOwnerSay((string)llGetUnixTime() + " S3:Runtime waiting"); } } link_message(integer piSender, integer piData, string psData, key pkID) { llOwnerSay((string)llGetUnixTime() + " S3:Runtime link_message-event"); llOwnerSay((string)llGetUnixTime() + " S3:Runtime link_message data " + psData); if (psData == "DETACH") { llOwnerSay((string)llGetUnixTime() + " S3:Runtime DETACH message received"); state Detach; } if (psData == "M3ChecksComplete") { llOwnerSay((string)llGetUnixTime() + " S3:Runtime M3ChecksComplete message received"); M3ChecksComplete = TRUE; } if (psData == "U3ChecksComplete") { llOwnerSay((string)llGetUnixTime() + " S3:Runtime U3ChecksComplete message received"); U3ChecksComplete = TRUE; } if (M3ChecksComplete & U3ChecksComplete) { AllChecksComplete = TRUE; AllChecksCount++; if (AllChecksComplete & (AllChecksCount < 2)) { llMessageLinked(LINK_THIS,0,"AllChecksComplete",gkPlayer); } } else llOwnerSay((string)llGetUnixTime() + " S3:Runtime doing other things"); } touch_start(integer number) { llOwnerSay((string)llGetUnixTime() + " S3: touched in Runtime state"); } } state Detach { state_entry() { llOwnerSay((string)llGetUnixTime() + " S3:Detach state_entry event"); llSetTimerEvent(0.0); integer liPerms = llGetPermissions(); if (liPerms & PERMISSION_ATTACH) { llOwnerSay((string)llGetUnixTime() + " S3:Detach s_e liPerms " + (string)liPerms); llSetForce(ZERO_VECTOR,TRUE); llOwnerSay((string)llGetUnixTime() + " S3:Detach s_e Detaching!"); llDetachFromAvatar(); } else llRequestPermissions(llGetOwner(),PERMISSION_ATTACH); } run_time_permissions(integer piPermissions) { if ((piPermissions & PERMISSION_ATTACH) != 0) { llOwnerSay((string)llGetUnixTime() + " S3:Detach r_t_p Detaching"); llDetachFromAvatar(); } } attach(key pkOwner) { llOwnerSay((string)llGetUnixTime() + " S3:Detach attach event"); if (pkOwner == NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " S3:Detach attach null-key resetting script"); llResetScript(); } else state default; } } integer S3ChecksComplete = FALSE; integer AllChecksComplete = FALSE; key gkPlayer = NULL_KEY; float gfTimeOut = 60.0; integer giTimer = FALSE; default { state_entry() { llOwnerSay((string)llGetUnixTime() + " M3:default state_entry event"); llOwnerSay((string)llGetUnixTime() + " M3:default "+(string)llGetFreeMemory()); gkPlayer = llGetOwner(); llOwnerSay((string)llGetUnixTime() + " M3:default Game data set up!"); } attach(key pkOwner) { llOwnerSay((string)llGetUnixTime() + " M3:default attach event"); if (pkOwner != NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " M3:default Game data set up!"); llSetTimerEvent(gfTimeOut); giTimer = TRUE; } else { llOwnerSay((string)llGetUnixTime() + " M3:default Invalid game data!"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } link_message(integer piSender, integer piData, string psData, key pkID) { llOwnerSay((string)llGetUnixTime() + " M3:default link_message-event"); llOwnerSay((string)llGetUnixTime() + " M3:default link_message data " + psData); if (psData == "S3ChecksComplete") { llOwnerSay((string)llGetUnixTime() + " M3:default S3ChecksComplete message received"); S3ChecksComplete = TRUE; llSetTimerEvent(0.0); state Initialize; } else llOwnerSay((string)llGetUnixTime() + " M3:default waiting for S3ChecksComplete message"); } timer() { if (giTimer) { llOwnerSay((string)llGetUnixTime() + " M3:default timed out waiting on " + "S3CheckComplete message"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } } state Initialize { state_entry() { llOwnerSay((string)llGetUnixTime() + " M3:Initialize state_entry event"); llOwnerSay((string)llGetUnixTime() + " M3:Initialize doing other things"); llMessageLinked(LINK_THIS,0,"M3ChecksComplete",gkPlayer); } link_message(integer piSender, integer piData, string psData, key pkID) { llOwnerSay((string)llGetUnixTime() + " M3:Initialize link_message-event"); llOwnerSay((string)llGetUnixTime() + " M3:Initialize link_message data " + psData); if (psData == "AllChecksComplete") { llOwnerSay((string)llGetUnixTime() + " M3:Initialize AllChecksComplete message received"); AllChecksComplete = TRUE; state Runtime; } else llOwnerSay((string)llGetUnixTime() + " M3:Initialize waiting for AllChecksComplete message"); } timer() { if (giTimer) { llOwnerSay((string)llGetUnixTime() + " M3:Initialize timed out waiting on " + "AllCheckComplete message"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } } state Runtime { state_entry() { llOwnerSay((string)llGetUnixTime() + " M3:Runtime state_entry event"); llOwnerSay((string)llGetUnixTime() + " M3:Runtime doing other things"); } attach(key pkAvatar) { llOwnerSay((string)llGetUnixTime() + " M3:Runtime attach event"); if (pkAvatar == NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " M3:Runtime attach null-key"); } else { llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } touch_start(integer number) { llOwnerSay((string)llGetUnixTime() + " M3: touched in Runtime state"); } timer() { if (giTimer) { llOwnerSay((string)llGetUnixTime() + " M3:default timed out waiting on " + "S3CheckComplete message"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } } integer S3ChecksComplete = FALSE; integer AllChecksComplete = FALSE; key gkPlayer = NULL_KEY; float gfTimeOut = 60.0; integer giTimer = FALSE; default { state_entry() { llOwnerSay((string)llGetUnixTime() + " U3:default state_entry event"); llOwnerSay((string)llGetUnixTime() + " U3:default "+(string)llGetFreeMemory()); gkPlayer = llGetOwner(); llOwnerSay((string)llGetUnixTime() + " U3:default Game data set up!"); } attach(key pkOwner) { llOwnerSay((string)llGetUnixTime() + " U3:default attach event"); if (pkOwner != NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " U3:default Game data set up!"); llSetTimerEvent(gfTimeOut); giTimer = TRUE; } else { llOwnerSay((string)llGetUnixTime() + " U3:default Invalid game data!"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } link_message(integer piSender, integer piData, string psData, key pkID) { llOwnerSay((string)llGetUnixTime() + " U3:default link_message-event"); llOwnerSay((string)llGetUnixTime() + " U3:default link_message data " + psData); if (psData == "S3ChecksComplete") { llOwnerSay((string)llGetUnixTime() + " U3:default S3ChecksComplete message received"); S3ChecksComplete = TRUE; llSetTimerEvent(0.0); state Initialize; } else llOwnerSay((string)llGetUnixTime() + " U3:default waiting for S3ChecksComplete message"); } timer() { if (giTimer) { llOwnerSay((string)llGetUnixTime() + " U3:default timed out waiting on " + "S3CheckComplete message"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } } state Initialize { state_entry() { llOwnerSay((string)llGetUnixTime() + " U3:Initialize state_entry event"); llOwnerSay((string)llGetUnixTime() + " U3:Initialize doing other things"); llMessageLinked(LINK_THIS,0,"U3ChecksComplete",gkPlayer); } link_message(integer piSender, integer piData, string psData, key pkID) { llOwnerSay((string)llGetUnixTime() + " U3:Initialize link_message-event"); llOwnerSay((string)llGetUnixTime() + " U3:Initialize link_message data " + psData); if (psData == "AllChecksComplete") { llOwnerSay((string)llGetUnixTime() + " U3:Initialize AllChecksComplete message received"); AllChecksComplete = TRUE; state Runtime; } else llOwnerSay((string)llGetUnixTime() + " U3:Initialize waiting for AllChecksComplete message"); } timer() { if (giTimer) { llOwnerSay((string)llGetUnixTime() + " U3:Initialize timed out waiting on " + "AllCheckComplete message"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } } state Runtime { state_entry() { llOwnerSay((string)llGetUnixTime() + " U3:Runtime state_entry event"); llOwnerSay((string)llGetUnixTime() + " U3:Runtime doing other things"); } attach(key pkAvatar) { llOwnerSay((string)llGetUnixTime() + " U3:Runtime attach event"); if (pkAvatar == NULL_KEY) { llOwnerSay((string)llGetUnixTime() + " U3:Runtime attach null-key"); } else { llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } touch_start(integer number) { llOwnerSay((string)llGetUnixTime() + " U3: touched in Runtime state"); } timer() { if (giTimer) { llOwnerSay((string)llGetUnixTime() + " U3:default timed out waiting on " + "S3CheckComplete message"); llMessageLinked(LINK_THIS,0,"DETACH",gkPlayer); } } } the scripts are MultiScriptS3, MultiScriptM3, and MultiScriptU3. Thanks in advance for any help
  12. What is the purpose and effect of clicking the BLOCK button on the permission to attach dialog? It seems to cause the prim in which the llRequestPermissions(llGetOwner(),PERMISSION_ATTACH) is located to die. Is this right?
  13. #LepreKhaun I really must thank you for the extensive reply which has been very helpful. I am working my way through the contents having sampled the references. #revochen Thank you too for your input I have not heard of uDraw. I tend to use Visio when I want to chart things as it provides a method of communicating with others with MS S/W. In this case I thought it would be overkill as it involves a little more effort than I thought would be necessary. LepreKahaun's reply is astounding in it's completeness. Thanks to both. I am now fully prepared to get to grips with my personal problems (old age).
  14. Thanks. I don't think the attach temp would work in my case but I will keep it in mind.
  15. Thank you for the reply. Unforunately I cannot see anything from the second link you gave http://ace.c9.io/#nav=api all I get is a page headed by ACE and some options none of which respond to clicking. Do you have a complete page link? I am finding it difficult to visualise the events which happen in three scripts in a HUD. I am intially tryiing to document how the scripts are started as much for my own understanding as for whomever takes over from me. I am interested in your solutions to the various problem you outline. I am using Link messages for communicate between the scripts. Yes I know about the never ending loop danger. I detect all the messages but throw away the ones not intended for the script I am coding at the time. I have a feeling that this subject is one which might be better addressed to expert in business system documentation methodology. I am NOT implying that you are not an expert.
  16. A HUD with a script inside which requests permission to attach to avatar work OK if rezzed and permission granted. What action should the script take if the permission is NOT granted? Is llDie the only answer?
  17. If you are the Owner of the prim that contains the script then you need to check that your name matches the name of the creator or owner of the prim. Putting a line such as if (llDetectedKey(0) == llGetOwner()) after the line touch_start(integer total_number) { followed by the rest of the script will only allow you to execute the remainder of the script. remember to enclose the rest in braces. How does that sound
  18. I am having trouble trying to document the interaction between three scripts in a HUD. They are structured so that one script (let's call it Start) prepares itself with various functions and then sends a LINK_THIS message to the two other scripts (Main & UserInterface). These are set up so that they do some intialization but wait on the receipt of the LINK_THIS message from the Start script before proceeding to more complex tasks. If they do not get this first message from Start they all abort and detach the HUD with appropriate messages to the wearer. Before you ask the necessity of three scripts is because of memory limitations. These two other scripts when they have completed their initialization send a LINK_THIS message to all the other scripts. The Start script when it has received both the messages from the Main and UserInterface scripts sends a final LINK_THIS message to the two other scripts which then switch to a Running state. Because the scripts are event driven I cannot find a satisfactory way to document them. Can anyone suggest a method, notation or other way of doing this?
  19. @Dora It is amazing what you miss when you don't read all the caveats. Thanks for pointing it out.
  20. When you request permissions for a HUD to animate an avatar is the permission granted to the requesting script or any script within the HUD, I have had to spolit my HUD scripts in three to get round a stack/heap collision problem. One of the scripts currently requests the permission to animate the avatar, does this apply to all the scripts in the HUD or does each have to ask permission?
  21. SORRY The script copied into the prim had a duplication 130 lines down and I missed it. SORRY The syntax error was trying to tell me that the key had already been defined.
  22. I have a script which has compiled in mono successfully for a few years and has stopped with a syntax error on the line key SERVER_REQ_ID; What is the syntax error? for reference Second Life 3.6.9 (282535) Oct 18 2013 04:31:50 (Second Life Release) Release Notes You are at REDACTED Second Life Server 13.10.15.282406 Release Notes CPU: Intel(R) Core(TM) i7 CPU 975 @ 3.33GHz (3340.96 MHz) Memory: 12280 MB OS Version: Microsoft Windows 7 64-bit Service Pack 1 (Build 7601) Graphics Card Vendor: NVIDIA Corporation Graphics Card: GeForce GTX 295/PCIe/SSE2 Windows Graphics Driver Version: 9.18.0013.1422 OpenGL Version: 3.3.0 libcurl Version: libcurl/7.21.1 OpenSSL/0.9.8q zlib/1.2.5 c-ares/1.7.1 J2C Decoder Version: KDU v7.0 Audio Driver Version: FMOD Ex 4.44.12 Qt Webkit Version: 4.7.1 (version number hard-coded) Voice Server Version: Vivox 4.5.0009.17865 Built with MSVC version 1600 Packets Lost: 0/28,431 (0.0%)
×
×
  • Create New...