| General SL Discussion Discuss topics related to Second Life |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |
| | #277 (permalink) |
| The Purple ![]() ![]() ![]() ![]() ![]() ![]()
HEYOO!
Join Date: Dec 2007 Location: Somewhere purple, Germany
Posts: 7,672
My Mood: SL Join Date: 20. January 2007 Client: NaCl | Nah, not overly. I use that at times and haven't noticed anything. I might do some synthetic loop timing to see just how much overhead there might be from the additional casting.
__________________ "Have you ever noticed that anybody driving slower than you is an idiot, and anyone going faster than you is a maniac?" - George Carlin Last edited by Chalice Yao; 07-24-2012 at 08:21 AM. |
| | |
| 1 User Said Thanks: |
| | #278 (permalink) | |
| Senior Member ![]() ![]() ![]()
Mayan Time Lord
Join Date: Apr 2008 Location: Cali
Posts: 2,003
My Mood: SL Join Date: 10/12/2006
Business: [H]arsh Styles
Client: Always changing, and too lazy to edit. | Quote:
If you think about it, that's exactly what you're doing when you do key k = "b1d453b2-5c70-421e-9621-98f26fe4713e"; Assigning a string to a key. Keys and strings are *nearly* interchangeable, except in the case of comparisons. | |
| | |
| 1 User Said Thanks: |
| | #279 (permalink) |
| Senior Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() *SLU Supporter* ![]() ![]() ![]()
post_count++;
Join Date: Sep 2007 Location: Austin, TX
Posts: 1,031
My Mood: SL Join Date: 11/01/2005
Business: The Wastelands Client: Official Newest | There was a little bit of conversation earlier as to how there should be an option to reset a script for the end user. As a guy who's made quite a few successful games, I think that's a terrible idea. Allowing anyone to reset a script would break a lot of content. I however am not opposed to a scripted flag such as llAllowScriptReset(). That way it's up to the creator of the script whether or not the end user can reset it.
__________________ Tin Man Rant - Blog Alright, I've been thinking. When life gives you lemons, don't make lemonade - make life take the lemons back! Get mad! I don't want your damn lemons, what am I supposed to do with these? Demand to see life's manager. Make life rue the day it thought it could give Cave Johnson lemons. Do you know who I am? I'm the man who's gonna burn your house down! With the lemons. I'm going to to get my engineers to invent a combustible lemon that burns your house down! -- Cave Johnson |
| | |
| | #280 (permalink) | |
| Moo. ![]() ![]() ![]() ![]() Join Date: Dec 2007 Location: Here and there. Kinda inbetween places now.
Posts: 3,700
My Mood: SL Join Date: 11/30/2005
Business: Happy Bivouac/Milk&Cream | Quote:
People often make demands, request changes, or bring up suggestions based on limited perceptions of how a certain goal can be achieved. An SL user will make a suggestion that they think leads to an end goal, and a good company would recognize that it is the end goal, not the stated suggestion/demand that is the critically important part. I know I agreed with the comment earlier about wanting the ability to reset scripts in no-mod content. The thing is, the ability to reset scripts wasn't the end goal that caused me to agree with the suggestion. The end goal is being able to fix no-mod scripted content when it breaks. In fact, I'd argue this distinction between a suggestion/request is present in the majority of posts where someone is presenting an idea. It's certainly been a point of contention for a number of suggestions made in this very thread. I suspect there'd be a lot fewer back and forth arguments if people, before disagreeing with a suggestion, asked themselves, "why was this suggestion made? What is the end goal they hope to achieve?"
__________________ The Digital Pasture - SL from a cow's point of view. When the cow is also a designer. | |
| | |
| 1 User Said Thanks: |
| 2 Users Agreed: |
| | #281 (permalink) | ||
| That Bitch ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() *SLU Supporter* ![]() ![]() ![]() ![]() ![]()
Innocent as far as you know
Join Date: Nov 2011 Location: Online
Posts: 6,219
My Mood: SL Join Date: late 04... that account is deleted now | I think, though, that without knowing the end goal you really can't do much other than to agree with useful ideas, and point out the flaws in bad ones. if there's an end goal you can suggest alternatives, or even improvements.
__________________ - These eyes can do more than see Quote:
Quote:
| ||
| | |
| 2 Users Agreed: |
| | #283 (permalink) |
| Your cutest PITA ![]() ![]()
Don't look yet !
Join Date: Jan 2008 Location: Europe
Posts: 157
My Mood: SL Join Date: 10/28/06
Business: RealRestraint Client: My own RLV | Well as Strife pointed out, although it was true back then, it is apparently not the case anymore, thankfully.
__________________ 90% of Sturgeon's law is crap. Last edited by Marine Kelley; 07-25-2012 at 03:40 AM. |
| | |
| | #284 (permalink) | |
| tkInc and DEM tech ![]() Join Date: Aug 2009
Posts: 26
Client: Catznip | Quote:
I'm pretty sure that in either LSO or MONO you *can* do llList2Key even though the element in the list is a string and it works out the way you want! | |
| | |
| 1 User Disagreed: |
| | #285 (permalink) | |
| Your cutest PITA ![]() ![]()
Don't look yet !
Join Date: Jan 2008 Location: Europe
Posts: 157
My Mood: SL Join Date: 10/28/06
Business: RealRestraint Client: My own RLV | Quote:
ETA : You CAN cast a random string to a key and back to a string just fine, regardless of its size. I do that all the time in my linked messages, that's the main way I use to pass information between my scripts. However I don't know how it looks while it is a key, but that's not my concern. All I know is that no information is lost, and also that casting a string that looks like a key, to a key, will give you a valid key. That's also something I do all the time, both in LSO and in Mono. Last edited by Marine Kelley; 07-25-2012 at 09:21 AM. Reason: ETA | |
| | |
| | #286 (permalink) | |
| Your cutest PITA ![]() ![]()
Don't look yet !
Join Date: Jan 2008 Location: Europe
Posts: 157
My Mood: SL Join Date: 10/28/06
Business: RealRestraint Client: My own RLV | Quote:
- Client : "I want feature X." - Contractor : "Oh I see, but then it means you want to achieve goal Y ?" - Client : "Come to think of it, yes, exactly." - Contractor : "Ok then we'll do feature Y." - Client : ".. for the price of X." And that's when things go well. Usually it is more like : - Client : "I want feature X." - Contractor : "Oh I see, but then it means you want to achieve goal Y ?" - Client : "You're not listening." | |
| | |
| 3 Users Laughed: |
| | #287 (permalink) |
| Just call me Beth ![]() ![]() ![]() ![]() ![]()
Singing along with old music
Join Date: Mar 2011 Location: Out in the mists
Posts: 5,733
My Mood: SL Join Date: Oct 4 2009
Business: Faerycat Designs Client: Firestorm | I had someone interested in a custom project a little while back...and before I quoted the price, i had the darndest time trying to get what was actually wanted... |
| | |
| | #288 (permalink) | |
| That Bitch ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() *SLU Supporter* ![]() ![]() ![]() ![]() ![]()
Innocent as far as you know
Join Date: Nov 2011 Location: Online
Posts: 6,219
My Mood: SL Join Date: late 04... that account is deleted now | Quote:
it's almost saner to have a general policy of storing everything as strings and retrieving them that way then casting to key.... it's also a bit wasteful since you'll have extra casts all over the place. | |
| | |
| 2 Users Agreed: |
| | #289 (permalink) | |
| Senior Member ![]() ![]() ![]()
Mayan Time Lord
Join Date: Apr 2008 Location: Cali
Posts: 2,003
My Mood: SL Join Date: 10/12/2006
Business: [H]arsh Styles
Client: Always changing, and too lazy to edit. | Quote:
| |
| | |
| | #290 (permalink) | |
| Lantern By Day ![]() ![]()
We are not the JLU
Join Date: Sep 2009
Posts: 624
SL Join Date: March 2008
Business: Mystic Gems Client: Exodus, Firestorm, Viewer 3 | Quote:
- Resident: "I want feature X." - Lab: "Oh, I see. We're not going to do that." (Two years later) - Lab: "You said you wanted feature X, so we put a hedgehog in your pants. Aren't you happy?" | |
| | |
| 7 Users Laughed: |
| 3 Users Agreed: |
| | #291 (permalink) |
| Just call me Beth ![]() ![]() ![]() ![]() ![]()
Singing along with old music
Join Date: Mar 2011 Location: Out in the mists
Posts: 5,733
My Mood: SL Join Date: Oct 4 2009
Business: Faerycat Designs Client: Firestorm | I want a hedgehog....just not in my pants. |
| | |
| | #292 (permalink) | |
| Emergency Mustelid ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2009
Posts: 15,379
| Quote:
llTeleportAgent
__________________ Argent Stonecutter -- Skyhook Station -- Coonspiracy Store "And now I'm going to show you something really cool." ![]() The previous is a cybernetic datum published - in direct contravention of DoD Regulation #229RR3X3 - as being conducive to the physical, psychological and/or social well-being of the population. | |
| | |
| | #293 (permalink) | |
| tkInc and DEM tech ![]() Join Date: Aug 2009
Posts: 26
Client: Catznip | Quote:
Code: key k1 = "valid key"; key k2 = "valid key"; list l1 = [k1, k2]; Code: llListFindList(l1, [llGetOwner()]) The safe response is, of course, to define k1 and k2 as strings and then cast the result of llGetOwner to string | |
| | |
| | #294 (permalink) | |
| That Bitch ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() *SLU Supporter* ![]() ![]() ![]() ![]() ![]()
Innocent as far as you know
Join Date: Nov 2011 Location: Online
Posts: 6,219
My Mood: SL Join Date: late 04... that account is deleted now | Quote:
| |
| | |
| 1 User Said Thanks: |
| 1 User Agreed: |
| | #295 (permalink) | |
| Junior Member ![]() Join Date: Jan 2008
Posts: 22
My Mood: SL Join Date: 1 Sep 2006 Client: Cool VL Viewer 1.26.2 | Quote:
| |
| | |
| | #297 (permalink) | |
| Nasty Brit ![]() ![]() ![]() ![]() ![]()
Wants *things*
| Quote:
It's my normal practice, in both LSO and Mono, to avoid checking if a key is NULL_KEY if at all possible. That is, I will normally test Code: if (id){
// do something
}
else{
// do something different
} But in circumstances when I might otherwise use NULL_KEY, I use "" instead, so llListen(5,"","","") or llMessageLinked(LINK_SET,0,"",""). Are there circumstances in which I would do better to declare a global variable, key null = NULL_KEY, and use nul instead of "" ? | |
| | |
| | #298 (permalink) | |
| The Purple ![]() ![]() ![]() ![]() ![]() ![]()
HEYOO!
Join Date: Dec 2007 Location: Somewhere purple, Germany
Posts: 7,672
My Mood: SL Join Date: 20. January 2007 Client: NaCl | Quote:
I just tested it with a script that I slapped a large pile of NULL_KEYs into. 55004 free with "", 54492 with NULL_KEY (512byte difference). Remember that Mono only allocates in 512byte steps, so granted, you won't notice the difference when measuring with only a few usages of NULL_KEY due to that, but under the hood it still has an overhead per NULL_KEY. Under LSL you will notice an immediate difference even with a few instances, as LSL shows even small memory changes. | |
| | |
| 1 User Agreed: |
| | #299 (permalink) | |
| That Bitch ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() *SLU Supporter* ![]() ![]() ![]() ![]() ![]()
Innocent as far as you know
Join Date: Nov 2011 Location: Online
Posts: 6,219
My Mood: SL Join Date: late 04... that account is deleted now | Quote:
the real reason is that redefining it means you can use the friendly name in your code so that the intent is better understood. so your listen would still be effectively the same, but it's clear that you are using a key and that it's non-op one. ETA: never replace explicit integers or floats with constants... in lsl, the pointer for them is the same byte size as the variable itself. (ok it can make code more readable, but the literal cost is the byte size of the constant you've declared. vectors, rotations, and strings >6 characters are fine though. | |
| | |
| 2 Users Said Thanks : |
| 1 User Agreed: |
| | #300 (permalink) | |
| Senior Member ![]() ![]() ![]()
Mayan Time Lord
Join Date: Apr 2008 Location: Cali
Posts: 2,003
My Mood: SL Join Date: 10/12/2006
Business: [H]arsh Styles
Client: Always changing, and too lazy to edit. | Quote:
It's not uncommon in a typical script (at least my typical scripts ) to need to compare to NULL_KEY 20 or 30 times, so using a variable defined once is much more efficient than putting NULL_KEY at every comparison. You can't compare NULL_KEY to "" as you rightly pointed out. using "" for llListen() and such is perfectly fine. It may just be a style thing, but I never use raw comparisons for anything but Integers. (where you did a check with id without comparing it to anything). I don't trust it will always eval true when you infer it should. Last edited by Darien Caldwell; 07-27-2012 at 08:10 PM. | |
| | |
| 1 User Said Thanks: |
![]() |
| Thread Tools | |
| Display Modes | |
| |
| |