Jump to content

Pedlar Decosta

Resident
  • Posts

    99
  • Joined

  • Last visited

Everything posted by Pedlar Decosta

  1. I thought it was about time I figured out why the RegionSay would give the error I explained above. I identified it as one in a listen event. What the real question is though is why a global variable integer "CHANNEL", that is declared as a specific negative number at the top of a script (eg. integer CHANNEL = - 9488473;), would sometimes not be represented correctly further down in the script ? There are no other mentions of CHANNEL except as a llRegionSay(CHANNEL,"something"). So why would you need to reiterate the channel ? Anyone able to shed some light on this ?
  2. Thanks Lucia. Yes I have verified it is my own object. The problem I had was actually feedback through llOwnerSay() that said the channel it was heard on was 0. However it was impossible as firstly I didn't have a llListen() operating on 0 and secondly, when I used a separate object to listen, it was actually on the correct channel. Also it still happened even when I put the number directly in the RegionSay function. I assume It is a problem caused by my own coding. However the question I belatedly posed was one which I encounter now and at other times, when the debug box (?) would show an error that llRegionSay() couldn't use the public channel, even though I set the channel as a global integer and/or in the actual RegionSay(). I am at a loss why this would happen, I have looked at the function in lsl portal and it doesn't mention it. It only happens when I manually reset the scripts, or sometimes when rezzing the object.
  3. Nevermind lol. I figured out it wasn't being sent on the public channel at all. It was my feedback, which isn't in the code above. Duh. But it still leaves me with a question. Why do you sometimes get a debug error about RegionSay on channel 0 when you reset a script, when it is clearly given another channel than 0 ?
  4. Hi, I'm doing a script at the moment and I'm trying to design code that allows 2 unlinked prims that are some distance away, but in the same sim to pair off for intra sim TPs. Basically I guess I'm making them 'handshake' and confirm their pairing. I'm using llRegionSay() on a big negative number and the problem I am having is during the handshake llRegionSay() is reverting to channel 0. I thought perhaps it was because it was throttled and I tried putting a llSleep() in to fix it. But it doesn't. The channel is a global integer and even when I change it to say llRegionSay(-9563426,"communicate"); it continues to be heard by the other object on the public channel. I am saving the details for reference, but have removed them for this post. I'm hoping someone can explain what is going on ? Thanks in advance Oh, and interestingly there is no error in the debug window, so it may not actually be being sent on 0 (?), although (and I don't think this is related) sometimes when I reset the scripts it does have an debug error about regionsay on 0. integer CHANNEL = -9678543; key mssg2; default { state_entry() { llListen( CHANNEL, "",NULL_KEY , ""); llRegionSay(CHANNEL,"hello"); } listen(integer channel,string name,key id, string message) // event triggered by above listens { list list1 = llParseString2List(message, [","],[]); string mssg = llList2String(list1,0); mssg2 = llList2Key(list1,1); if(channel == CHANNEL) { if(message == "hello") { llRegionSay(CHANNEL,"pair,"+(string)id); // THIS IS HEARD ON CORRECT CHANNEL } if(mssg == "pair" && mssg2 == llGetKey()) { llOwnerSay("accepting"); llRegionSay(CHANNEL,"accept,"+ (string)id); // THIS IS HEARD ON CORRECT CHANNEL } if(mssg == "accept" && (key)mssg2 == llGetKey()) { list info = llGetObjectDetails(id, [OBJECT_NAME,OBJECT_POS]); // Saving the above details llRegionSay(CHANNEL,"confirmed,"+(string)id); // THIS SEEMS TO BE SENT ON CHANNEL 0 } if(mssg == "confirmed" && (key)mssg2 == llGetKey()) //THIS IS WHERE IT IS HEARD ON PUBLIC CHANNEL { list info = llGetObjectDetails(id, [OBJECT_NAME,OBJECT_POS]); // Saving the above details } } } }
  5. Ok, I have worked out where the problem was. I could not make the hidden element reveal itself though, but at least I know what caused it. I had this - string accesslist3; //and- if ( name == "name" ) { name = (string)value; accesslist2 += [llToLower(value)]; accesslist3 = llList2CSV(accesslist2); } //and then this - accesslist = llCSV2List(accesslist3); So I had incorrectly referred to accesslist3 as a list when it was actually a string. All I had to do to fix it was parse the string and then the accesslist received the correct info and my list was then empty as it should have been. I hope this helps someone else with similar problems.
  6. I didn't have any luck with the llEscapeURL function. But it stands to reason you are bothj right. There is a hidden element in the list, so I'll go over it bit by bit and try to get rid of it. Thank you both
  7. but I added spaces in the feedback to separate the words. Are you sure this is extra after those MollyMews? i.e llOwnerSay("list is (space here)"+llList2CSV(accesslist)+" (and here)and length is "+(string)llGetListLength(accesslist)); thanks Rolig, I am always grateful for better ways to write it, but also am curious to why there is a hidden element in the first place.
  8. Hi all, I am getting a strange/unexpected result when calling for a list length in one of my scripts. Basically I am testing it using - llOwnerSay("list is "+llList2CSV(accesslist)+" and length is "+(string)llGetListLength(accesslist)); and this is the reply - [19:44] TV - Scripted: list is and length is 1 so my question is, if it says the list is empty, why is the length saying 1 ? I thought it was possibly a space but I tested for that with this - llOwnerSay("list is this |"+llList2String(accesslist,0)+"|"); llOwnerSay("2list is this |"+llList2String(accesslist,1)+"|"); and got this - [20:02] TV - Scripted: list is this || [20:02] TV - Scripted: 2list is this || All I wanted to do was eliminate the comma after the owner name (not on the list but added first in the feedback) if no one was on the list... I have other scripts where I have succeeded in changing the output if the answer was singular or multiple, however again... I am trying to identify why there's a problem in the first place. In case it is relevant, this is how the list is formed - string message2 = llToLower(message); accesslistfilter3 = []; accesslistfilter3 += llCSV2List(message2); accesslistfilter2 = ListItemDelete(accesslistfilter3, "ac"); accesslistfilter = ListXorY(accesslistfilter, accesslistfilter2); accesslist = ListXorY(accesslist, accesslistfilter); accesslist = ListItemDelete(accesslist, ""); (This is probably ugly coding to you guys, but it seems to work nicely for me).
  9. I thought I'd add this in case it helps someone else later on. Something had been bugging me about why I was unable to see the logic behind what was discussed above until several people drilled it into me. And then the reason hit me. If the conditionals had been == (does equal) instead of != (does not equal), the code would have worked perfectly. Which is why I believed the problem to be intermittent. This doesn't work as I intended - if((msg !="Name1") ||(msg != "Name2")) { //THEN ADD TO A LIST } But this DOES - if((msg =="Name1") ||(msg == "Name2")) { //THEN ADD TO A LIST } ...which is obviously where my head was at. And of course that means the solution for the != code - if(msg != "Name1" && msg != "Name2") wont work for the other. if(msg == "Name1" && msg == "Name2") which is an obvious impossibility unless both name1 and name2 are the same. It kind of reminds me of the 'double negative' where " I didn't do nothing" (something you hear all the time) means that you actually did something.
  10. Actually Rolig, that does help. It actually makes sense to me now. Everyone was saying virtually the same thing as you, but finally I see the light. Thanks everyone. Thanks Rolig. Really appreciated
  11. Ok. That is a little confusing. So even though what I want is to add the msg to the list if it "1 OR the other name", the solution is "1 AND the other name" ? I had assumed the msg would have to be BOTH 1 and 2 for && to work (which is impossible if the names are different). Qie said: "||" is a logical disjunction, so if either side is true, the conditional is true. And if msg is "Name1" it won't be "Name2" and vice versa, so the disjunction will always be true". A: Except the msg could be one of many names. Name1 and Name2 are just names I want to leave off the list. Prof, yes that is a good solution as it is possible I may want to add other names to ignore later. Thank you. Nova - Thanks mate, I didn't know I could use only one set of brackets for it. I assumed they'd have to be separate. (and the && is still playing with my logical thoughts i.e. when AND is actually OR...Even though your explanation is a good one) animats - I had looked at DeMorgans Laws, but because I was thinking OR instead of AND I couldn't resolve it to work how I wanted. This ignorance on my part is one of the many shortfalls (for me at least) of being completely self taught.
  12. It is all a very interesting subject and I thank everyone for their input. I respect the views offered and have decided to tackle the problem differently. It is a work in progress but involves a script with all the bells and whistles that is non transferable but copyable and another script that is geared for just the end user which is copy and transferable. The situation only affects the commercial version which i9s designed for creators who might want to script the products, who have no interest or time to script the items themselves. I do realize almost everyone is honest to a certain degree. But it doesn't take many abusers for your items to end up in free script packages made by people who don't know where the scripts come from, rendering the scripts worthless or of little value. I see that Steph suggested this or something similar, which I only just realized. So thanks Steph, but I had the same idea
  13. Can someone please tell me why the following code sometimes has a problem- The linked message is received and this code filters out specific words and adds the msg to a list if it isn't one of those words. if((msg !="Name1") ||(msg != "Name2")) { //THEN ADD TO A LIST } However this always works - if(msg != "Name1") { if(msg != "Name2") { //then add to a list } } Obviously I have a simple work around, but I am trying to understand why there is a problem in the first place. Thanks for any help in advance. P.S. Perhaps I should add that what happens is the words in the first example get added to the list even though the filter says not to.
  14. Yes, thanks Qie. I was going to take a look at AVSitter, but I have a feeling they will be similar to the scripting I already use and have been using for several years.I'm just trying to make the scripts as close to the 'out of the box' condition as is possible as well as ensuring only one user gets to copy AND transfer the scripts.
  15. I'm trying to share copy/trans scripts with creators. Making it 'error' as you say is easy. However that would mean anyone that gets the scripts will have the limited permissions and will not be able make use of it, because either they can't copy it, or can't transfer it. So I'm essentially trying to give more creators, who can't write code, a chance to be able to sell scripted items that they created with scripts that suit their purpose and value add their products. I can understand why people may be wary. However the idea allows more people to take advantage of scripts they didn't write to enhance their creations. Not less. Which in turn means they can produce better products and offer their friends and customers more. Considering the fiasco that abounds now with user licenses, that render many products unusable for commercial purposes, even though they are sold as such, I thought this could actually deliver what creators needed for their builds, without them having written the scripts that bring their creations to life. I do appreciate it could be misused, but in reality, the horse has bolted and many gullible people are being shafted already. Regardless, I have my own ideas on how to achieve it, and I know my goal is completely moral, ethical and being done to help people, not rip them off. And I brought the idea here, in case anyone else was thinking about how to help creators with no scripting skill, but plenty of amazing works. Considering so many creators have been so severely limited and run out of business because of all the mesh being imported en masse (which they cannot compete with in LI or in detail), I think Second Life is already becoming less and less a world conceived and created by it's own users and more of a world where 3D professionals are making a killing. Which is a real shame. But anyway, thanks for the replies everyone. I appreciate the feed back.
  16. A user license is a form of DRM. Albeit just a voluntary one. However if someone ignores or forgets to change the scripts and the new owner doesn't have the user license (because there is no need to give it to them), they might just hand it out to everyone, completely unaware of the license requirements.
  17. how so bigmoe ? You can already make scripts die for whatever reason you wish on the first new owner. So it isn't any different except a way to be sure the new owner sets the right permissions. The first owner would still have the working scripts.
  18. Hi, I have my own code that makes a script inoperative and/or die when transferred with the incorrect (too many) permissions and I have seen the anti trans script Roolig did. But I keep thinking there must be a better way for a creator to sell scripts as copy/trans (so the buyers can build and sell creations with the scripts fitted). The difficulty as I see it is being able to hardwire the new owners key, so that if the owner changes again with the wrong permissions, the script will die. I have been thinking that the answer might be using an updater script. Say that the new owner key is somehow added to a script and that script updates the other script. Then if the ownership changes it is easy to check perms and kill the scripts if needed. The important factors are that the scripts need to be unuseable until the new owner is updated, and the process can't be voluntary (because otherwise people will work around it). Has anyone else given this subject any thought ? The other way it would work is if the scripts could store the 2nd owners key (the buyers key) and be able to tell it is the 2nd transfer. But as far as I know, there is no way to get a script to remember the previous owner. If this problem could be solved, it would make it easier for copy/trans scripts to be sold on marketplace confident that people won't just use work-arounds to distribute the scripts willy nilly. I'm currently playing with the update scripts, but I thought it couldn't hurt to ask the experts here what they thought ?
  19. Rolig said " Right. I am sorry not to have made that clear in my initial response to your question. " That is quite alright Rolig. The question was about touches AND collisions, for a couple of different projects. So the touch commands were very relevant. The archery target is just one of those projects. I have a working target already, but I was hoping to save prims by using mesh or even just a flattened cylinder or sphere. But thanks to everyone for clarifying that. I'll have a look at llCastRay for future reference at the very least.
  20. Ok. Much as I appreciate the help so far, I have realized the functions llDetectedTouchST or llDetectedTouchUV aren't going to work with projectile collisions. So I tried to use face detection to get the desired result, however using the example on the llDetectTouchFace() page, I get a -1 result. I tried using a couple of different viewers, which didn't help. I'm trying to make a low prim target using a mesh object. can anyone offer advice or point me in the right direction ?
  21. Hi, I was wondering if there is any way to detect what area on a face was touched or collided with ? Rather than using several smaller prims to achieve the same result ?
  22. The get params option is a great idea and worth thinking about. I already have a standalone script that cuts it and then deletes itself, but it is still a good idea too. Thanks Innula
  23. I was thinking about adding the above code into a swing door script. However you wouldn't want to do it automatically every time the script is reset. So a dialogue panel would give the user the choice whether to cut the prims path or not. But it would be best if it only showed the dialog the first time the script was put into a prim. So that is my question; what is the best way to get a script to present a dialogue panel the first time only the script is put into the prim ? I thought of using either the description box or the name box to see if it was a newly created prim, and if so to run the routine/code, but that wouldn't always be the case. Some builders might be using prims that have already been named. By parsing the name or description boxes I could add a label to get around that - list list1 = llParseString2List(llGetObjectDesc(), ["."],[]); string 1stHalf = llList2String(list1,0); string 2ndHalf = llList2String(list1,1); if(2ndHalf =="label") { // don't show dialog } However the builder may not want to have their names or descriptions changed. So are there any other methods to tell if it is the first time a script has been inserted into a prim ?
  24. In case anyone wants a script to make a single prim swing door (probably nobody because it is easy to do it manually). Drop it in a prim and afterward it deletes itself. vector cut = <0.3750,0.8750,0.0000>; float hollow = 0.0000; vector twist = <0,0,0>; vector top_size = <1.0000,1.0000,0.0000>; vector top_shear = <0,0,0>; default { state_entry() { llSay(0, "Making a single prim swing door shape!"); vector pos = llGetLocalPos(); llSetPrimitiveParams([9,PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, cut, hollow, twist, top_size, top_shear ]); llSetScale(<0.10000, 3.00000, 3.00000>); llSetPos(<pos.x, pos.y, pos.z+1.5>); llSleep(2.0); llSay(0,"Finished ! Door is ready for swing script ! Deleting this script now."); llRemoveInventory(llGetScriptName()); } }
  25. Ah yes. Thank you very much. I knew it had to be somewhere
×
×
  • Create New...