Jump to content

revochen Mayne

Resident
  • Posts

    208
  • Joined

  • Last visited

Everything posted by revochen Mayne

  1. Thank You, Rolig! Yes, it doesnt seems to do it yet. The object is orbiting around a fix point using the sample code from your link but its also rotating now. If i exclude the rotation part then it just moves the object forward. :matte-motes-confused:
  2. I dont want to rotate a link prim based on its root prim rotation. Just think of a ferris wheel. The gondolas are separate objects but have to rotate around the wheels center depending on the wheels rotation.
  3. steph Arnott wrote: Do a rotation offset. Please explain me, what do you mean by a "rotation offset" and how does that work? :matte-motes-nerdy: I know you cant because "rotation offset" is just nonsense. steph, please just resist in answering if you cant provide any help. At least on my requests. Thank You!
  4. steph, its a left over because the original script was much larger. This script is even missing its llSetTimer call to start the timer. And what do you mean by "Do people actually make any effort to study? "? I was looking for a solution for some time now and thought its a good idea to request some advises at the scripting forum. Whats wrong with? No need to be that offensive, steph. I am requesting for help and already appreciate any help. You're posts wasnt helpfull yet, sorry.
  5. No, it has to keep its rotation but orbit around a fix point along its local object axis only. Currently its orbiting along the global world axis.
  6. Greetings! I need to make an object orbit based on its orientation. I figured how to do it along the global axis but not based on the objects local rotation. Any help and advise is much appreciated. vector VECTOR_ORIGIN; float angle; float radius = 1.4; //in meters out from the start float increment = -1; // positive = counterclockwise float spin_rate = 0.1; default { state_entry() { angle = sp; VECTOR_ORIGIN = llGetPos(); llSetTimerEvent(spin_rate); } timer() { llSetPos( <0, llSin(angle * DEG_TO_RAD),llCos(angle * DEG_TO_RAD)> * radius + VECTOR_ORIGIN ); angle += increment; } }
  7. you also may change those mouse behaviour: llSetClickAction(CLICK_ACTION_NONE); // for default cursorllSetClickAction(CLICK_ACTION_TOUCH); // for touch cursor
  8. Either that way or just within a single state which will avoid redundant code. Would look something like this: key requestid;string mode = "default";default{ state_entry() { requestid = llHTTPRequest("http://yourURL.com/interface.php?cmd=get_mode",[HTTP_METHOD,"GET"],""); } touch_start(integer num) { if(mode=="default") { // implement default behaviour } else if(mode=="mode_a") { // implement a custom behaviour } // implement more else if's if required } http_response(key request_id, integer status, list metadata, string body) { if(request_id==requestid) { mode = body; } }}
  9. Oh sure there is but there is no real native method to inject or delegate a function from an outside source. Your http event may check for certain responses and trigger specific functions or change its state then.
  10. There doesn't seems to be a native method available for this purpose. There is no such thing like injections or delegates in LSL. Some time ago scripts were able to do XML RPC calls but those got deprecated and the wiki sais: XML-RPC should not be used anymore. Use http-in instead http://wiki.secondlife.com/wiki/LlOpenRemoteDataChannel So you would need to predefine those methods and variables first in order to activate or initialize them through a http request.
  11. If thers really no error message appearing then i guess its something within the llRequestAgentData calls. Does your flow rely on a previous succeed process? If yes, i would try to debug the agent keys and see if its always the same key used which makes the script freeze. Because the dataserver event doesnt trigger when you use an invalid avatar key. The dataserver event is missing something like a "AGENT_KEY_INVALID" return flag. llRequestAgentData("im an invalid key", DATA_BORN); compiles but doesnt produce an error message nor triggers the dataserver event.
  12. Using texture or sound UUIDs in scriptsis a great way to protect them if you intend to share or sell the item. You also may get a royal free sound like from www.freesound.org, upload it and us its UUID in your script. To get an texture or sound UUID just right click on it in your inventory, pick 'Copy Asset UUID' and paste it into your script.
  13. Double click on the the script to open it in the editor and press the reset button. Thers also an option for at the top building menu i believe but i almost reset scripts in editor. Requires specific perms on the script though.
  14. Ela Talaj wrote: As far as SL and other grids are concerned LSL is a fully developed object-oriented programming language. LSL would stay a procedural programming (scripting) language as the characteristics of obejct-oriented programming are classes, inheritance, encapsulation and polymorphism. Might missed one or two thoug (recursion i believe).
  15. Dora Gustafson wrote: KISS (Keep It Simple Stupid) I changed my KISS-philosophy to keep it smart & simple :matte-motes-wink-tongue:
  16. I would prefer storing the prim type data into a global variable rather than calling them each 0.1s. Also added a boolean block variable as i figured the script will break the cut if touched within the cut process. integer gON = -1;integer gCount;float gCut = 0.0;list gPrimData; integer gBlocked = TRUE; default{ state_entry() { gPrimData = llGetLinkPrimitiveParams(LINK_THIS,[PRIM_TYPE]); } touch_start(integer total_number) { if(!gBlocked) { gBlocked = TRUE; gON = -gON; llSetTimerEvent(0.1); } } timer() { gPrimData = llListReplaceList(gPrimData,[llList2Vector(gPrimData,2) + <0.01,-0.01,0.0>*gON],2,2); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TYPE]+ gPrimData); if (!(++gCount% 25)) { gBlocked = FALSE; llSetTimerEvent(0.0); } }}
  17. I appologize for trying to help you and others here. :matte-motes-nerdy:
  18. I did 5 test runs, 4 of on an empty homestead sim. The last on an full region, also empty (only me been on). In all cases the most-expected-case-first version is faster. Not much though, but it is. :matte-motes-nerdy:
  19. No, its a matter of logic only. :matte-motes-nerdy: Take my example with a 99 lines notecard. In 99% of reading through it top to bottom, data will be explicitly !=EOF. Thats why it doesnt really makes sense to check for if data ==EOF. EOF is only 1% of the notecard. I did a test with a 1000 lines notecard (Yes, really. I know i'm crazy). Scripts compiled on mono, both the same code, except the order/type of the if and else. Results are: 134.061874s with if == EOF first 133.819778s with if != EOF first I agree that in this specific case there's no significant difference in performance, but there is a difference at all. Most obvious when you have a duzend of if/else if/else cases. And i still advice to catch the most expected cases first, less expected last.
  20. if (data == EOF) notecard_read = TRUE; else { //Get the next notecard line, process and repeat... } Always try to catch the most expected case first. Just imagine your notecard has 99 lines of text. Your script will check if data==EOF on any line and then goes to the else code block if its not, which would be 99% of the notecard. Rather do: if (data != EOF) // catching most expected case { // process data and get next notecard line } else // catching less expected case { notecard_read = TRUE; }
  21. Hello steph, Your script wont proceed if there is an empty line in the middle of your notecard. The lineCounter increment and next line request belongs outside the if-data-isnt-empty-space code block. Also the EOF check has to come first. I believe the else-return code block never gets executed. if(queryid == dataRequestID){ if(data!=EOF) { if(data!="") { gOffSetList += data; } ++lineCounter; string msg = llList2String(gFormList,0); // no string typecast required dataRequestID = llGetNotecardLine(msg + "_config", lineCounter); } // no else required if you just return} Also your global noteCard function needs a revision. You're first requesting a notecard line (which will result in an script error message if the notecard is missing if i remember right) but then you're checking if the notecard is existing at the following line, which doesnt really makes sense. You also might want to use llInstantMessage instead of llOwnerSay as it only works if the owner is within the same sim (sl-wiki: Silently fails ~45 seconds after the owner leaves the region the object is in.) . Better do: if(llGetInventoryType(msg + "_config") == INVENTORY_NOTECARD) // catch the most expected case first { dataRequestID = llGetNotecardLine(msg + "_config", lineCounter); } else // hopefully the script will never reach following lines { // notify owner of missing file llInstantMessage(owner_key, "ERROR!\nMissing inventory configuration notecard '"+msg+"_config"' +"\n or name of notecard is not the same as the exterior form name: ' "+ msg+"'"); }
  22. Das beste waere doch, wenn LL endlich mal ein vernuenftiges Konzept fuer Neumitglieder auf die Reihe bekommt. Das ist naemlich schon laengst ueberfaellig. Anonsten werden wir noch oefters erleben, dass Leute keine 4 Stunden in SL bleiben. Es kann doch nicht sein, dass Neumitglieder irgendwelchen selbsternannten Mentoren ueberlassen werden, die sich bei jeder Gelegenheit anbiedern muessen. Das wirkt einfach unprofessionell und damit auch abschreckend.
  23. Willkommen in SL, Elena! Orca wrote: Die Betreiber von SL, Linden Lab, setzen dich also heutzutage einfach auf irgend ner Insel aus? Die Dummkoepfe. Warum wundert mich das nicht? ^^
  24. Hello, I'm not aware of an site for but i am currently teaching basic scripting classes and soon building classes too at the Dikto University in SL. One of my building classes topic will be Fireworks which i taught at the SLLC some time ago. My classes are free yet and any supplies like scripts and textures are full perms. Feel free to join the Ditko University group in SL. I plan to start my building classes soon again, just not sure about a final schedule for yet.
  25. Hello, I guess you need to get the root prims rotation first and then set its opposite angle for x and y axis on the engine prim.
×
×
  • Create New...