Jump to content

LepreKhaun

Resident
  • Posts

    1,384
  • Joined

  • Last visited

Everything posted by LepreKhaun

  1. Qwalyphi Korpov wrote: ... I see that further responses will be of no use. The OP apparently has some agenda they are attempting to further here or some point they are trying to make that precludes any appeal to reason or fact. It's also obvious at this point that they thrive on argument, dissension and the attention they get by flaunting the rules. The only way I see to deal with that is to do no more than point out their misbehavior so others don't get the idea that it's appropriate in our forums and, if they persist, report it to the moderators. That would at least lower the incidence of disruptive noise until this problem is resolved. For those that do wish to be recognized as creditable programmers, modifying or incorporating other people's work into your own efforts is allowable, but only as long as you follow the licensing that applies to your source. It's not difficult to do and shows others that you take enough pride in your creation to show due respect to the original author(s) whose work you are building upon.
  2. Miranda Umino wrote: Yes , but Wandering SoulStar wants to use llRemoteloadScriptPin So the state_entry will be the first event triggered . And llGetStartparemeter will know wich parameter we have sent to llRemoteloadScriptPin You're missing the point- state_entry() is an event handler that may be used in any state. Only the state_entry() specifically within the default{} state is triggered on reset. This does not apply to any other state's state_entry(). Dora was making a necessary clarification of this so beginners reading the convo become aware of the difference and not wonder later why their state_entry() in (say) state working{} isn't being triggered on reset. Because it won't, that .state_entry() will wait to be triggered until the working state is later entered.
  3. I'm delighted that you are following my suggestion to properly comment your code, but if you wish to be taken seriously as a programmer you should correctly use licenses when including or modifying the work of other people. Disregarding the terms of both the CC-BY-3.0 (which covers anything published under that license) and the CC-BY-SA (which covers anything extracted from the LSL Portal wiki) might lead beginners to believe that these can be ignored with impunity, which is definitely not the case. Full, correct attribution and following licensing requirements is a sign of professionalism. Here's a link to a introduction to these licenses and how to correctly use them. Please take the time to study it and have enough respect for your fellow content creators and other beginners to follow them properly.
  4. Well, one does need to take a break from building at times, even if it is to make another pot of coffee. :smileylol:
  5. It's difficult to guess exactly what you need without looking at a complete specification of the problem. However, I'll venture a possible solution if it's a matter of just distributing and activating one script among a number of rezzed prims: Have the script in the inventory prim to begin with, but have only a listen() event handler in the default state and, when triggered, have it switch to the "working" state. You could also toggle between the default and working states the same way, effectively turning "on" and "off" the script. ETA: There are two ways to toggle back to default()- state default; and llResetScript();. They both will clear the event queue but the second also reinitializes your global variables and clears the timer.
  6. Perrie Juran wrote: LepreKhaun wrote: I've learned to be careful just rubbing a strange cat. Some of them don't like it and I've got some scars for not picking up on it in time. My neighbors dog and my cat got into it one day. My neighbor grabbed his dog. I grabbed my cat. This is when you learn how fast a cat really is. I never saw the swipe that layed open my arm. Faster than the blink of an eye. I've still got the scars too. (After that fight they never fought again. We actually found them sleeping together a couple of times) Delightful story, thanks for sharing! However, this is veering far from both the topic and the purpose of this forum which is for discussions about scripts and scripting. Perhaps we could talk about our pets in General Discussion some time.
  7. I feel a lot of difficulty in understanding the LSL event model is due to a pervasive looseness of the term "event" being used in place of a number of phrases that contain the word "event". Unfortunately, this looseness dates all the way back to the initial LSL language definitions and probably isn't changeable at this late date. I try to distinguish the differences in my own writing by, for instance, referring to the touch_end() "event handler" rather than the touch_end() "event" unless I'm actually talking about the message itself. Otherwise, the reader requires a certain level of understanding to correctly read what is being written in the context they find "event".
  8. Wandering Soulstar wrote: Thanks for the reply Nova ... In followup to this, and based on the actual situation of what I am trying to do. What I'll actually be doing is loading the script mentioned into another prim, using llRemoteLoadScriptPin, and having delt a bit deeper into what the wiki says about this function it indicates: 'When the script is set to run (with running, the running checkbox or llSetScriptState) state_entry will be queued.' Does this mean what I think, i.e. that the script will go through it's normal startup in the Default state? Even if when it was stopped it was in another state? Correct, the default State is always activated from scratch when a script is reset by any means and its state_entry() Event Handler will always take precedence in the Event Queue,
  9. Wandering Soulstar wrote: Hi All, Question regarding a script detecting owner change. Now I understand clearly from the Wiki that I can use the changed event with the CHANGED_OWNER flag to check this, but I have a specific scenario in mind: I own the script and the prim it is in. I Set the script to not running I then give the prim and script to another They then start the script running ?? Will the changed event then fire ?? Thanks in advance! Wanda Events, in their truest sense, are messages. The code in our LSL scripts have Event Handlers contained within States. When a State becomes active in a script, the script's Event Queue is cleared and the Event Handlers of the active State are registered with the server. Only registered Event Handlers can have an Event placed into a script's Event Queue. A script that is not running has no State active, no Event Handlers registered and, for that matter, no Event Queue to receive Events. This differs from a running script whose object is taken into inventory.; it's changed() Event Handler (if it's within an active State) remains registered and it also has an Event Queue which awaits processing until it is rezzed.
  10. See this thread for solution.
  11. I've learned to be careful just rubbing a strange cat. Some of them don't like it and I've got some scars for not picking up on it in time.
  12. Here's a good link on how to do the Blender materials to SL faces bit.
  13. In Blender, make separate materials (up to eight) that will become faces within SL. Each face can be UV mapped and textured on its own that way.
  14. Join everything in Blender so it's one object. Make a model for the lowest and (possibly) next lowest LOD that is nothing but elongated cubes. No need for that much detail at further distances. Use the physics model as you have it, it'll work correctly for a single object. Otherwise you'll need a physics model for each separate mesh. This should reduce your Server weight from 3.50 to 0.50 (each mesh object requires 0.50) and both Physics weight (which is currently driving your LI) and Download weight (which is being driven by the lowest LODs) to less than 1.0.
  15. Very well done and illustrative how LSL (with all its warts LOL) can be used to implement even advanced math algorithms. With its reproducible pseudorandom results within a set, I can see how this would be useful for a number of game situations and your excellent commenting should enable any intermediate coder the means to modify it to their use.
  16. Perrie Juran wrote: You should be honored. Where irihapeti is from, the Warriors only ate Opponents who fought valiantly. What you said kept tickling the back of my mind, but it took awhile to recall the exact phrase that it reminded me of- Do not meddle in the affairs of Dragons, for you are crunchy and taste good with ketchup! ~ Anon ~
  17. And, it should be pointed out to those learning about licensing, the Combined Library is found within Linden Lab's Wiki, which itself is licensed under the Creative Commons Attribution-Share Alike 3.0 License and Linden Lab is somewhat explicit in how material from it must be credited.
  18. irihapeti wrote: ... so yes agree. Is unproductive to continue wasting spacetime on computing an answer to a problem where no problem exists Good, it sounded to me as if you actually saw a problem there. A few decimal places in an extremely small approximtion is less germane to programing than defective licensing and ones spacetime should be spent wisely.
  19. irihapeti wrote: this the latest iteration of encoding and decoding keys stored in UTF16 strings. Is called oranges encoder it started as a convo on sluniverse. The convo moved to here LSL Library forum. Then to LSL Scripting forum. Thru the convo was 4 iterations of this based on feedback and eagle eyes and ideas of other scripters so thanks to all them who contributed to it and also thanks to the earlier works by other scripters on the lsl wiki portal (: They all named in the script and bc their contributions are mostly CCby3 then if publish/post/distribute then you need maintain their credits ok. For mine credits then dont worry about it bc I just put anything I do in public domain bc I dont publish/write much public code anyways + just about CCby3 credits. Why scripters do this mostly is bc they do scripting/programming for a living in whole or part. Is the whole giving back thing also which people do as well, but credits helps them to get their name out there which helps them get paid work and feed themself and family. So just do it ok + ETA: changes to credit texts in the script to reflect contributiions better. See convo below ++ ETA again: Have modded to this version 1b. functions enU() and deU() to make more clear which bits are being encoded to UTF. The mod to deU also shows better the symmetry between encoding and decoding. the codes produced by version 1b are compatible with 1a +++ ETA again. changes to test code examples and change the words "design contributions" to "design credits". See convo below + ok here is // example key encoder decoder// version: oranges 1b// public domain May 2014 by elizabeth (irihapeti)// a mod of works (CCby0 and CCby3) by: Adam Wozniak, Doran Zemlja, // Becky Pippen, Combined Library// design credits: All named above plus Strife Onizuka, LepreKhaun// with mentions for exacts in the codes// also with new test code examples//// encodes a key (uuid) into a string of 9 UTF16 chars. 18 bytes// str = Key2UTF(key) // key = UTF2Key(str) //// UTF16 codes produced are copypasta into scripts and notecards in // SL viewers // 3.7.3 (287491) Mar 4 2014 05:01:31 to// 3.7.7 (289405) Apr 21 2014 20:25:08// on Windows 8.1. Default USA english// dunno about earlier/later versions, LSL Editor or TPVs or other OS// just need be careful when copypasta as// - some UTF glyphs may not be visible but are in the string// - some of them may show as the same glyph. but they are decodeable// so best to Say wrapped in "" for copypasta purposes //// warninkkks !!! is no error trapping !!! if you need that then mod // important !!! codes produced by this version 1b are compatible // with version 1a. Neither version 1a or 1b are compatible with // earlier unversioned iterations of this encoder that were written by// me, due to a encoding change of the end buffer character//// also is wrote this way to show the algos. can mod to inline for own // purposes as you like // -- encoder --- integer enB;string enU(integer n){ // credit: Strife return llBase64ToString(llIntegerToBase64(0xE0808000 | ((n & 0xF000) << 12) | ((n & 0x0FC0) << 10) | ((n & 0x003F) << 8) ));} string enP(integer n){ enB = (enB << 2) | (n & 0x3); return enU(((n >> 2) & 0x7FFF) + 0x800) + enU(((n >> 17) & 0x7FFF) + 0x800); } string Key2UTF(key k){ string s = (string)k; string r = enP((integer)("0x" + llGetSubString(s, 28, 35))) + enP((integer)("0x" + llGetSubString(s, 19, 22) + llGetSubString(s, 24, 27))) + enP((integer)("0x" + llGetSubString(s, 9, 12) + llGetSubString(s, 14, 17))) + enP((integer)("0x" + llGetSubString(s, 0, 7))); return r + enU((enB & 0xFF) + 0x8800); // credit: LepreKhaun}// --- end encoder --- // --- decoder ---integer deB;list deH = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; integer deU(string s){ integer n = llBase64ToInteger(llStringToBase64(s)); return ((n >> 12) & 0xF000) | ((n >> 10) & 0x0FC0) | ((n >> 8) & 0x003F); } string deP(string s){ integer n = ((deU(llGetSubString(s, 1, 1)) - 0x800) << 17) | ((deU(llGetSubString(s, 0, 0)) - 0x800) << 2) | (deB & 0x3); deB = deB >> 2; return llList2String(deH, (n >> 28) & 0xF) + llList2String(deH, (n >> 24) & 0xF) + llList2String(deH, (n >> 20) & 0xF) + llList2String(deH, (n >> 16) & 0xF) + llList2String(deH, (n >> 12) & 0xF) + llList2String(deH, (n >> 8) & 0xF) + llList2String(deH, (n >> 4) & 0xF) + llList2String(deH, n & 0xF);} key UTF2Key(string s){ deB = deU(llGetSubString(s, 8, 8)) - 0x8800; return (key)( deP(llGetSubString(s, 6, 7)) + "-" + llInsertString(deP(llGetSubString(s, 4, 5)), 4, "-") + "-" + llInsertString(deP(llGetSubString(s, 2, 3)), 4, "-") + deP(llGetSubString(s, 0, 1)));}// --- end decoder --- // --- some test code ---list keys = [ "ffffffff-ffff-ffff-ffff-ffffffffffff", "77777777-7777-7777-8888-888888888888", "88888888-8888-8888-7777-777777777777", "88888888-8888-8888-8888-888888888888", "77777777-7777-7777-7777-777777777777", "01234567-8901-2345-6789-012345678901", "01234567-89ab-cdef-fedc-ba9876543210", "abcdeffe-dcba-abcd-effe-dcbaabcdeffe", "c9012a38-3f29-6ef3-fc21-4380aecd5927", "00000000-0000-0000-0000-000000000000", "77777777-7777-7777-7777-777777777777" // dup test ];string utft = "蟿蟿蟿蟿蟿蟿蟿蟿裿⨢䱄⨢䱄旝䎻旝䎻裰旝䎻旝䎻⨢䱄⨢䱄蠏⨢䱄⨢䱄⨢䱄⨢䱄蠀旝䎻旝䎻旝䎻旝䎻裿橀⪳䡈㯄僑䲀奙࢑裝ᒄ䌪㚦蝮筻䳕奙࢑裰菿左㼮翿㋳癝菿左袚幉彦壠蘐掼➔劎沀蠳ࠀࠀࠀࠀࠀࠀࠀࠀ蠀";string utfp = "蟿蟿蟿蟿蟿蟿蟿蟿裿|⨢䱄⨢䱄旝䎻旝䎻裰|旝䎻旝䎻⨢䱄⨢䱄蠏|⨢䱄⨢䱄⨢䱄⨢䱄蠀|旝䎻旝䎻旝䎻旝䎻裿|橀⪳䡈㯄僑䲀奙࢑裝|ᒄ䌪㚦蝮筻䳕奙࢑裰|菿左㼮翿㋳癝菿左袚|幉彦壠蘐掼➔劎沀蠳|ࠀࠀࠀࠀࠀࠀࠀࠀ蠀";default{ touch_end(integer total_number) { key k; key d; list ukeys; string s; string table; integer i; integer x; integer len; // key encode/decode check. read from list keys llOwnerSay("begin... encode/decode check"); len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); d = UTF2Key(s); llOwnerSay("key= " + (string)k + " : \"" + s + "\" : " + (string)d); } llOwnerSay("...end"); // create a string table. adding only unique keys llOwnerSay("begin... add unique keys to string table"); table = ""; len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); if (llSubStringIndex(table, s) >= 0) llOwnerSay("found= \"" + s + "\" : " + (string)k); else table += s; k = llGenerateKey(); s = Key2UTF(k); if (llSubStringIndex(table, s) >= 0) llOwnerSay("found= \"" + s + "\" : " + (string)k); else table += s; } llOwnerSay("...end"); // return position of key in table llOwnerSay("begin... return position of key in table"); len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); x = llSubStringIndex(table, s); llOwnerSay("pos= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // extract key from table by position llOwnerSay("begin... extract key by position"); len = llStringLength(table); for (x = 0; x < len; x += 9) { s = llGetSubString(table, x, x + 8); k = UTF2Key(s); llOwnerSay("pos= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // return index of key in table where index in ordinal set [0,1,2,..n] llOwnerSay("begin... return index of key in table"); len = llGetListLength(keys); for (i = 0; i < len; i++) { k = llList2Key(keys, i); s = Key2UTF(k); x = llSubStringIndex(table, s) / 9; llOwnerSay("idx= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // extract key from table by index llOwnerSay("begin... extract key by index"); len = llStringLength(table) / 9; for (x = 0; x < len; x++) { s = llGetSubString(table, x * 9, (x * 9) + 8); k = UTF2Key(s); llOwnerSay("idx= " + (string)x + " : " + (string)k); } llOwnerSay("...end"); // create table enclosed in "" from list llOwnerSay("begin... create table from list"); len = llGetListLength(keys) - 1; // skip dup test s = "\""; for (i = 0; i < len; i++) { k = llList2Key(keys, i); s += Key2UTF(k); } s += "\""; llOwnerSay(s); llOwnerSay("...end"); // decode to list a table (utft) copypasta into this script llOwnerSay("begin... decode table to list"); ukeys = []; len = llStringLength(utft); for (x = 0; x < len; x += 9) { s = llGetSubString(utft, x, x + 8); ukeys += UTF2Key(s); k = llList2Key(ukeys, -1); llOwnerSay("key= " + (string)k); } llOwnerSay("...end"); // create a pipeset from list at the cost of 1 extra char per key // for visual cue purposes if visual cue needed llOwnerSay("begin... create pipeset separated by |"); len = llGetListLength(keys) - 1; // skip dup test s = "\""; for (i = 0; i < (len - 1); i++) { k = llList2Key(keys, i); s += Key2UTF(k) + "|"; } k = llList2Key(keys, i); s += Key2UTF(k) + "\""; llOwnerSay(s); llOwnerSay("...end"); // decode to list a pipeset (utfp) copypasta into this script llOwnerSay("begin... decode pipeset separated by | to list"); ukeys = []; len = llStringLength(utfp); for (x = 0; x < len; x += 10) { s = llGetSubString(utfp, x, x + 8); ukeys += UTF2Key(s); k = llList2Key(ukeys, -1); llOwnerSay("key= " + (string)k); } llOwnerSay("...end"); }} Yeah, it's a shame Strife publishes their work under CC-by-3.0. I could never understand that, it certainly isn't recommended but it is their right. But the main problem is that you can't get automatic restoration of the license by rectifying your defect as one can under CC-by-4.0. Instead, you have to go explain to Strife what you'd done and then get their express permission before you can come under the CC umbrella. But I'm certain you won't have any problem with that, Strife's always willing to help. And, when you do correct the defects in that licensing, I ask you to remove the "// credit: LepreKhaun" from the code body since it looks too much like I actually wrote the line of code, which is entirely your own work. The "design credits" in the header I can live with though, you can leave or omit them as you wish. I'm asking this as a favor and because when I went to check into all the "publishing rules for crediting sources", I found all this, which pretty much contradicts your position. http://copyrighttoolkit.com/moralrights.html http://www.artslaw.com.au/info-sheets/info-sheet/moral-rights/ http://policy.mofcom.gov.cn/english/flaw!fetch.action?id=748b00c1-312f-489b-8d9e-cc535a50f422&pager.pageNo=73 http://niptech.wordpress.com/intellectual-property/intellectual-assets/creative-works/moral-rights/ http://www.smartcopying.edu.au/copyright-guidelines/copyright---a-general-overview/1-16-moral-rights http://scholarship.law.georgetown.edu/cgi/viewcontent.cgi?article=1415&context=facpub http://www.copyright.com.au/get-information/other-rights/moral-rights http://www.seqlegal.com/blog/false-attribution-moral-right http://www.artslaw.com.au/info-sheets/info-sheet/moral-rights-infringement-and-letter-of-demand/ http://books.google.com/books?id=smES_wO_NscC&pg=PA149&lpg=PA149&dq=false+attribution+of+authorship&source=bl&ots=YX6x-rsHbU&sig=UBbMX5gjNS6Kh0Uw8Gq148573ZQ&hl=en&sa=X&ei=Afh_U6qfCcGNyATZiYLgDA&ved=0CEYQ6AEwBDgU#v=onepage&q=false%20attribution%20of%20authorship&f=false http://policy.mofcom.gov.cn/english/flaw!fetch.action?id=748b00c1-312f-489b-8d9e-cc535a50f422&pager.pageNo=73 http://www.newmediarights.org/guide/how_to/creative_commons/best_practices_creative_commons_attributions Anyway, if you need help before your next submission to avoid these kinds of problems, just ask. Any number of us I'm certain would be glad to help, myself included.
  20. irihapeti wrote: LepreKhaun wrote: irihapeti wrote: jejejejje (: can still remember that convo + when you going to start the ethics debate in GD ?? Kant and Rawls and Locke and all that Thank you for clarifying your motivations. one day like probably never you going to get over yourself. in the meantime... oranges Oh, btw, I think it's great that you're modifying other people's code, we all had to start somewhere. But there are some requirements when you're doing a derivative work of anything CC-by-# and you might want to learn them at some point. One of them is you're required to link to the license. Here's a nice little tutorial to help you get started- http://creativecommons.org.au/materials/attribution.pdf
  21. For monitor viewing, you should have your viewer set to run full screen — Preferences > Graphics > General and not Preferences > Graphics > Display Output. This should automatically configure your resolution to 1280 x 800 but if not, you'll may have to set it that manually first.
  22. All that looks good to me. I like the way you effectively used the state change.
  23. If such precision was required, you might have a point. But since I no longer support that suggestion, regardless of the approximation, , I'll move on to more productive things and hope you do as well.
  24. Ahhh, I see what you're saying. So, if that pattern applies: 1/32768 * 1/32768 * 1/32768 * 1/32768 * 1/32768 * 1/32768 * 1/32768 * 1/256 * 1/256 = 2^(-15) * 2^(-15) * 2^(-15) * 2^(-15) * 2^(-15) * 2^(-15) * 2^(-15) * 2^(-8) * 2^(-8) = 2^(-121) ~ 3.7615819e-37 Then the formula becomes (3,300 - 2)*(3,300 - 1) * 8 * 3.7615819e-37= 87,040,816 * 3.7615819e-37 Giving us approximately 3.274e-29 instead of 8.748e-24. Mmmm, but I still agree with your original assessment- too big of a chance. Why risk it? Your design change is much better!
  25. OK, one way to look at it is anytime llSetTimerEvent(60.0); is set, a countdown of 60 seconds begins. If it is reset at any point during that countdown, it starts over again from scratch. So, if touch_end() sets the timer for 60 seconds and then the HUD chats to it before the minute is up, the listen() is triggered and the timer is being reset to stay open for a minute from that point. This will keep happening as long as the HUD chats to it before any one minute has passed. Follow? However, if a full minute ever does pass without the HUD chatting to it, then the timer() is triggered, the listen is closed and the timer is now set to 0 (which means it won't trigger again unless reset to 60.0 again by a touch_end() in the future). Does that make sense?
×
×
  • Create New...