Jump to content

Carbon Philter

Resident
  • Posts

    212
  • Joined

  • Last visited

Everything posted by Carbon Philter

  1. Hi Rolig. Apologies to resurrect this thread - I had hoped your last advice was going to be enough to resolve my problems. After a time away to get my head round easier things such as quantum physics and diy brain surgery, I readdressed the issue but am still stumped. I made the amendment you indicated to the part script but continue to get an error - Could not find notecard ''. I did some more reading on the wiki and tracked down what I suspect might be the cause. On the page covering llGetNotecardLine I see that "If name is not a valid notecard, or if the notecard is empty, the object will print to the Script Errors/Warning window, "Couldn't find notecard NAME" where "NAME" is the name of the invalid notecard." I'm sorry, but I've stared at the script until I'm going cross eyed and can't see where it's going wrong and not finding the name of the notecard. I confess I copped out and came up with a clunky alternative using a master 'Continents' dialog to switch on/off other single continent scripts which pull up the dialog options as desired. It seems to work ok after I wait for the various bits to initialise but I reckon that to 'real' scripters it looks like the work of the devil and is something to be avoided like the plague. So........... In the increasingly unlikely case that I'll ever understand scripting properly, once again I rely on your good grace and tolerance to ask if you can help and pinpoint where the script is not seeing the notecard correctly. Many thanks. Carbon For completeness sake the script which still throws up the error is as follows: list gContinents = ["1Africa","2Asia","3Europe","4N America","5Oceania","6S America","7Miscellany"];list gSites;list gTex1;list gTex2;list gLstMnu;list gDlabels;list gLbls;integer gRunOnce;integer gCrdNo;integer gCount;integer gLine;integer gDChan;integer gDLsn;string gCard;key gQuery;default{ state_entry() { if(!gRunOnce) //This is the first time through { if (llGetInventoryNumber(INVENTORY_NOTECARD)<1) //There are no notecards present { llOwnerSay("No Flag notecard detected."); } else { llOwnerSay("Read script this far"); gQuery = llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD,0),0); gCrdNo = 0; //Reading card #0// gCard = 0; gCount = 1; //Set index for first line in dialog box text llOwnerSay( llGetInventoryName(INVENTORY_NOTECARD,0)); llOwnerSay((string)gQuery); } } else //Not the first time through. Just read the chosen card. { gCount = 1; //Set index for first line in dialog box text gQuery = llGetNotecardLine(gCard,0); } } dataserver(key qID, string data) { if (qID == gQuery) { if (data != EOF) { integer idx = llSubStringIndex(data,"="); if (~idx) { gSites += [llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM)]; //Site names from NC gTex1 += [llStringTrim(llGetSubString(data,idx+1,idx+37),STRING_TRIM)]; //Texture from NC gTex2 += [llStringTrim(llGetSubString(data,idx+39,-1),STRING_TRIM)]; //Flip texture from NC gDlabels += [(string)gCount + ". " +llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM) + " \n"]; //Dialog text gLbls += [(string)gCount]; // Button labels ++gCount; } gQuery = llGetNotecardLine(gCard,++gLine); } else { llSay(0,"Card " + gCard + " reading complete."); state running; } } }}state running{ state_entry() { gRunOnce = TRUE; //You've determined that there are notecards present. No need to do it again. } touch_start(integer num) { if(llDetectedKey(0) == llGetOwner()) { gDChan = (integer)("0xF" + llGetSubString(llGetOwner(),0,6)); gDLsn = llListen(gDChan,"","",""); llDialog(llGetOwner(),"Pick a continent.",gContinents,gDChan); //Always start with a continent dialog } } listen (integer channel, string name, key id, string msg) { if (~(channel = llListFindList(gContinents,[msg]))) //Was this a Continent question ? { if(channel != gCrdNo) //If the selected continent is not the one we read last time .... { gCrdNo = channel; //We've selected a different continent, so empty all the lists first gSites = []; gTex1 = []; gTex2 = []; gDlabels = []; gLbls = []; //Then .... gCard = llGetInventoryName(INVENTORY_NOTECARD,gCrdNo); //go back and read its card now. state default; } else { // Do your country dialog based on the first ten lines of the current card } } else //The User has not just answered a Continent dialog question, so { //Did the user hit a << or >> button? If so advance page or go back //Else //What texture did the user choose? Act on the choice. } }}
  2. Pardon my interrupting, but poor Shotgun seems to have been sidelined a bit in this thread - not that the dialogue isn't interesting to follow. Going back to basics, it looks as though the image is more akin to trying to create a surface texture to apply to the fedora rather than the sculpt map itself. Shotgun - Assuming your previous experience with sculpties and Blender to be minimal I will summarise from first principles given that you say you're using Blender 2.61 and expressed a wish not to pay for Primstar 2. To create a sculpt mesh, the easiest thing is to use the Primstar add-on scripts in Blender which make the process pretty straightforward. No way round it. There are other methods but there is either cost or considerable effort required. There are versions of Primstar available from rel 1 which works with Blender 2.49 through to the latest version – JASS 2 – which you certainly have to pay for. You can however pick up JASS2 for free at the JASS location in world. This also works with Blender 2.49 but you can have 2.49 and 2.61 installed in separate folders on your pc and they will both work happily side by side. So I would recommend getting hold of that. You then start by loading a sculptie compatible mesh and move/manipulate vertices to achieve the shape you want and then do a ‘Bake Sculptie Mesh’ to generate a 64x64pixel rainbow coloured sculpt map. Export that to some folder, upload it to SL and apply it to a prim you’ve rezzed and set as Sculptie, and you should have a self made fedora. Thereafter you then go through a second rather more tricky process to generate the surface texture which you then apply to the hat inworld exactly the same way as applying a texture to a regular prim. There’s lots of info out there on Youtube and other places if you google but I would recommend you work your way through the Machinimatrix tutorials here: http://blog.machinimatrix.org/tutorials/ There’s a whole range covering the older and newer Blender interface and if you work your way through the whole tutorial section, including the older sculptie ones which is where I and I think many others cut their teeth on sculptie creation, you should have a good grasp of the whole process. Rest assured you’ll continue to make mistakes and miss steps and probably swear a lot but it will all be worthwhile in the end and you’ll be able to follow deeper and maybe more obscure discussions on the process such as at least part of this thread.
  3. Thx Casper - that worked! Tried Analyze then Simplify and it was as before but just selecting Analyze changed it, though it added 2L$ to the upload cost while LI abd Physics costs were the same as before. I confess I'd never paid any attention to the Analyze/Simplify part of the Upload process. Guess I need to remember to do that every time.
  4. I thought I had got the hang of mesh physics shapes but seem to have misunderstood and would appreciate some assistance in explaining it. I created a handrail for an arch type stair/walkway using 5 and 3 face cylinders to form the rails and a simple box derived physics shape. Everything uploaded fine and I set the physics to prim assuming that the bounding box would follow the shape I created from the physics dae file. I find however that even though the physics shape displays as following the handrail shape I cannot pass under the arch section of the handrail and it behaves just as the lower edge of the convex hull shape. Can anyone advise whether that is correct or might I have done something incorrectly? Thanks. The pics are of the handrail, and the physics shapes of both prim and conves hull settings.
  5. Maybe a scale issue. When you rez, make sure you're in Edit first and check the dimensions of the rezzed mesh - I found for whatever reason that some mesh objects I'd made using the dae 1.4 exporter in Blender 2.49 cam in scaled down by 100. It looked as if there was nothing there before I used edit and scaled them up.
  6. To behave as a vehicle, the linkset root needs to be orientated 0,0,0. That's quite hard to do if you use a cylinder as the broom shaft because it needs to be turned on its side to look correct. Simplest thing is to rez a sphere at o,o,o rotation with the sit target/controls script in it then make that the root prim with the other bits - shaft/head/etc linked however they need to be rotated to look right. Then set the sphere invisible.
  7. Apologies if this is assuming too little of your understanding Sculpties. Firstly it may look like separate objects but it remains one sculpty, it's just that the connections are faces scaled to 0 so they don't show up. One cause of problems is when you model with subsurf switched on as you can scale the wrong set of vertices to 0. It may look ok in Blender but when you bake and the subsurf is applied you find that the level of LOD you're seeing shows the mismatch of vertices relating to that particular LOD. Sorry, I can't think of a better way to describe it. If you want an example of disjointed objects from a single sculpt, take a look at Domino MArama's example blend file - blocks.blend. You can get it in the top post on the page here: http://www.dominodesigns.info/node/89
  8. Major enough for issues which are not related specifically to avatar mesh though, such as the water surface, which is my grievance. And just out of interest - will wearing an alpha layer to hide body parts clash and cause the alpha sort shimmering glitch with any no-mod item which already contains an invisiprim to carry out the same function?
  9. Update: Thanks for replies. Rolig - brace yourself for a gradually increasing volume of wailing as people across SL upgrade to the latest viewer and set their graphics to the best their machines can achieve, and Ceera - prepare to be annoyed....... vewy vewy annoyed! As soon as you activate anything more sophisticated than basic shaders in Graphics Preferences the invisiprim effect is gone, defunct, dead, deceased, alas, no more........ So if I want to pursue the modest SL revenue stream I was anticipating, I have to tell prospective purchasers to downgrade their viewing experience in order to benefit from the effect? As if that's going to be welcomed!! Unless LL do something to remedy the issue I guess it's back to the drawing board for some other eye catching innovative idea in an effort to generate some SL cash. :smileysad:
  10. Quick and maybe stupid question - have I missed something? Do the two invisprim textures 38b86f85-2575-52a9-a531-23108d8da837 and e97cf410-8e61-7005-ec06-629eba4cd1f no longer work? I had a prim set to hide the water level in the bottom of a boat cockpit and I just noticed it doesn't seem to be working. Is this the result of alpha masks being brought in for avatars or something else - SL temporary glitch or Viewer (Firestorm) related and, if so, is there any way to regain the effect? 'Cos I found it useful. OK - just read up on Deferred Rendering which would appear to be the culprit. Bummer - that looks as if it totally screws up my water concealment for boats and dry dock.unless ppl set their viewer to no shaders. So my query still stands - any way round this LL 'improvement' that renders my use of the invisiprim feature totally redundant?
  11. Hi again everyone, and a Good New Year to all. So after a break I'm back wrestling with scripting and my dialog/notecard problem in particular. Rolig, I've read through your 'semi-schematic' example for a few times now. I believe I understand the process but I'm still falling over - no sudden flashbulb of total comprehension going off in my head - and I'm not sure why. I think I may be getting messed up with all the global variables. I reckoned that your latest example should function even in a limited fashion, and so with a bit of tweaking to rectify what I thought was stopping it running - I added global variables integer gDChan and integer gDLsn which were referred to in the script body but couldn't be found, and I changed line 'if (llGetInventoryNumber(INVENTORY_NOTECARD))' to read: 'if (llGetInventoryNumber(INVENTORY_NOTECARD)<1)'. I also added in a couple of OwnerSays to try and track progress. The script compiled ok so I dropped it in a prim with the notecards named to match the list. The script started its initial run, and I got the two OwnerSays indicating that it was at least starting ok but it then threw up a script warning/error reporting "Could not find notecard ''." I then fired it up in LSL Editor and ran debug to see if that would help me. It reported one alert - line 91: The left-hand side of an assignment must be a variable, property or indexer, which I have to admit doesn't help me any. So with much apology I have to ask for further help to get me over this mental block I'm having. Is it anything to do with you maybe having used different global variable names in the semi-schematic you put together or could it even be the result of any typo which you mention could be a possibility. Here's the script in it's current 'almost working' form. list gContinents = ["1Africa","2Asia","3Europe","4N America","5Oceania","6S America","7Miscellany"];list gSites;list gTex1;list gTex2;list gLstMnu;list gDlabels;list gLbls;integer gRunOnce;integer gCrdNo;integer gCount;integer gLine;integer gDChan;integer gDLsn;string gCard;key gQuery;default{ state_entry() { if(!gRunOnce) //This is the first time through { if (llGetInventoryNumber(INVENTORY_NOTECARD)<1) //There are no notecards present { llOwnerSay("No Flag notecard detected."); } else { llOwnerSay("Read script this far"); gQuery =llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD,0),0); gCrdNo = 0; //Reading card #0 gCount = 1; //Set index for first line in dialog box text llOwnerSay( llGetInventoryName(INVENTORY_NOTECARD,0));// llOwnerSay(gcard); } } else //Not the first time through. Just read the chosen card. { gCount = 1; //Set index for first line in dialog box text gQuery = llGetNotecardLine(gCard,0); } } dataserver(key qID, string data) { if (qID == gQuery) { if (data != EOF) { integer idx = llSubStringIndex(data,"="); if (~idx) { gSites += [llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM)]; //Site names from NC gTex1 += [llStringTrim(llGetSubString(data,idx+1,idx+37),STRING_TRIM)]; //Texture from NC gTex2 += [llStringTrim(llGetSubString(data,idx+39,-1),STRING_TRIM)]; //Flip texture from NC gDlabels += [(string)gCount + ". " +llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM) + " \n"]; //Dialog text gLbls += [(string)gCount]; // Button labels ++gCount; } gQuery = llGetNotecardLine(gCard,++gLine); } else { llSay(0,"Card " + gCard + " reading complete."); state running; } } }}state running{ state_entry() { gRunOnce = TRUE; //You've determined that there are notecards present. No need to do it again. } touch_start(integer num) { if(llDetectedKey(0) == llGetOwner()) { gDChan = (integer)("0xF" + llGetSubString(llGetOwner(),0,6)); gDLsn = llListen(gDChan,"","",""); llDialog(llGetOwner(),"Pick a continent.",gContinents,gDChan); //Always start with a continent dialog } } listen (integer channel, string name, key id, string msg) { if (~channel = llListFindList(gContinents,[msg])) //Was this a Continent question ? { if(channel != gCrdNo) //If the selected continent is not the one we read last time .... { gCrdNo = channel; //We've selected a different continent, so empty all the lists first gSites = []; gTex1 = []; gTex2 = []; gDlabels = []; gLbls = []; //Then .... gCard = llGetInventoryName(INVENTORY_NOTECARD,gCrdNo); //go back and read its card now. state default; } else { // Do your country dialog based on the first ten lines of the current card } } else //The User has not just answered a Continent dialog question, so { //Did the user hit a << or >> button? If so advance page or go back //Else //What texture did the user choose? Act on the choice. } }} Thanks once again. Carbon
  12. Thanks for the replies, everyone. Gosh! Have I triggered a flurry of activity or not? SL is suddenly full of scaffold builders. Given the remarkably impressive match to what I built, none of you were looking over my shoulder on Aditi grid Sandbox Island Extension while I was at it, were you?? :matte-motes-big-grin-wink: So firstly in a small defensive voice, can I repeat from my original post - 'I just made my first tentative steps into mesh'. Underline the 'first' and 'tentative'. I was only askin'....... sniff. I appreciate all the arguments about the other considerations - display weight, texturing, and such. However, as Drongle mentions, I suspect that for me and many others in SL with only small land holdings and prim entitlement, the principal concern will remain trying to minimise the Land Impact albeit without grinding the sim or LL servers to a halt. Maybe LL mistakenly distorted the playing field when they introduced sculpties but they can't be undone without great inconvenience, and in a virtual world where users seek ever greater verisimilitude, which sculpties help achieve while keeping prim count down, I think that to describe it as 'abusing' the sytem to achieve low prim count is a bit unfair. You are all demonstrating sensible ways to better the Impact count using mesh, all of which I am trying to absorb. I gather it involves creating different actual models for each LOD level as well as making a specific Physics model. In my admittedly rather precise world, scaffolding poles are tubular and I was trying to retain that look but so far I find that using 5 or 6 sided cylinders result in angles surfaces/ends. Maybe I have to accept reducing the appearance to achieve better values but With next to no detail in terms of texturing coming into the equation it's still a reluctant trade-off. In your various responses there's reference to Imposters and billboard as means of reducing the overall impact. Can someone explain, please - is that using a 2D image in place of the separate components at lower LOD? I can see difficulties there with alpha glitch if I have a lot close together. Thanks to all. Carbon PS Incidentally, the results of my ongoing labour are all sitting around 195,209,27 SandboX Island Extension, Aditi - until LL refresh it, if anyone wanted to take a look.
  13. Hi all. So I just made my first tentative steps into mesh and have a couple of queries. I'm building some scaffolding for a ship in dock and given the amount needed in terms of prims it will use, I put together a model of 1 section of scaffolding tubes comprising 20 prims and generated a mesh using the new Mesh Studio tool. It worked without problem and generated a dae file which I uploaded on Aditi to see how it would come out and what it would cost. Without doing any adjustment work in Blender it came in at Land Impact 41 with an upload cost of L$51 - way too expensive from all aspects. I then created a physics model using a simple cube and that dropped the LI to 14 with an upload cost of L$12. Out of interest, as a comparison I created a similar sculpt mesh model in Blender - had to drop the number of scaffold poles to 16 to suit the disjointed sculpt limits,but it's close enough, and exported that both as a straightforward sculptie and also as a dae from the sulpt mesh. The resultant mesh upload came in costing L$11 with Land Impact 5 whereas the sculpt came in at L$10 for the regular L.I. of 1. The pic shows the sculpt (LI 1 L$10) on the left and the mesh (LI5 L$11) on the right Am I misunderstanding the application of mesh? I had hoped it would give better and more economic results than sculpts but in this instance I think I will have to stick with the sculpt. My other query is about the mesh bounding box. I thought that mesh did not have the same problem as sculpts and so a mesh model with openings could be walked through without having to set it phantom. Is this correct and if so does it depend on the physics model used during upload or has it anything to do with the Physics shape set in-world in the Edit Features window? Thanks for any enlightenment.
  14. You may be best to join/ask in the Phoenix/Firestorm group inworld - many knowledgeable ppl there. Also maybe check out the Ph/F wiki: http://wiki.phoenixviewer.com/doku.php?id=phoenix_viewer_documentation
  15. Thanks, Chosen. I spent a few minutes trying to firstly decide if I was being oversensitive in taking a degree of umbrage at Josh's snappy response or not, and then a couple minutes more debating whether 'tis nobler to suffer the slings and arrows etc. etc. or respond in kind.
  16. If you mean while using Blender, they go wherever you nominate as the destination folder. If you don't select a specific path they will probably go to the default Blender directory wherever you installed that. In any case a dialog panel pops up to tell you the file path. If you mean exporting a sculpt mesh from SL, again, they go where you tell them to go. Otherwise, you need to expand/clarify your query.
  17. Many thanks once again, Rolig. I'm not going to have so much time in the immediate future and your response may well take some serious time for me to absorb, so in the meantime, have a great festive season. And re. the directional travel advice - it's going to take a shed load of pixie dust to get me off the ground scripting-wise let alone all the way to Never Never Land. I'm definitely one of the Lost Boys.
  18. Thanks for replying, Rolig. Your last comment about numbered buttons is what attracted me to your combined script with Void's - after getting to the selected continent it has the potential to present the user with a list of numbers with corresponding country names so the selection buttons just have the numbers to click - the likes of 'St Kitts & Nevis' won't fit on any button! However I'm afraid I'm still confused, maybe even more so. I think I understand the process you are explaining but states and how they work in sequence or loop round confuses the hell out of me. I get the principle of reacting to the Continent button pressed to feed in the appropriate notecard to be read, but my reading of your comment is that I would put that in state running which is after the default state entry section which has the initial check as to whether there is a card in inventory and if so to read that as the data source before stepping on to the dataserver event. If I don't define gCard first time round I get a script load error reporting Notecard could not be found and the script simply won't run as dataserver has nothing to work with. As such, I can't see how I get to state running to make the Continent choice then bounce back to state default to get the dataserver event to read the particular notecard contents. Here's the furthe hacked script in which I remmed out the gCard definition line and which compiles ok but gives me the load error: //URL Chooser -- Rolig Loon -- February 2011// Reads web site information from a notecard in the format Site name = http://www.a_great_URL.com// and presents result in a URL prompt.list Continents = [" ", "Miscellany", " ", "N America", "Oceania", "S America", "Africa", "Asia", "Europe"];integer menu; //variable to keep track of which menu is chosenstring country;// Multipage dialog function uDlgBtnLst by Void Singer ( http://community.secondlife.com/t5/LSL-Scripting-Library/Dynamic-Multi-page-Dialog-AKA-Pagination/m-... )list uDlgBtnLst( integer vIntPag ){ integer vIdxBeg = 10 * (~-vIntPag); //-- 10 * (vIntPag - 1), enclose "~-X" in parens to avoid LSL bug integer vIdxMax = -~(~([] != gLstMnu) / 10); //-- (llGetListLength( gLstMnu ) - 1) / 10 + 1 list vLstRtn = llListInsertList( llList2List( gLstMnu, vIdxBeg, vIdxBeg + 9 ), //-- grab 10 dialog buttons (list)(" <<---(" + (string)(vIntPag + (-(vIntPag > 1) | vIdxMax - vIntPag)) + ")"), //-- back button -1 ) + //-- inserts back button at index 9, pushing the last menu item to index 10 (list)(" (" + (string)(-~((vIntPag < vIdxMax) * vIntPag)) + ")--->>"); //-- add fwd button at index 11 return //-- fix the order to L2R/T2B llList2List( vLstRtn, -3, -1 ) + llList2List( vLstRtn, -6, -4 ) + llList2List( vLstRtn, -9, -7 ) + llList2List( vLstRtn, -12, -10 );}//-- Anti-License Text --//*/// Contributed Freely to the Public Domain without limitation. //*/// 2009 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ] //*/// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*///--list gLstMnu;integer gLine;string gCard;string gCard1;string gCard2;string gCard3;string gCard4;string gCard5;string gCard6;integer gDChan;integer gDLisn;key gQuery;integer gCount;list Sites;list Tex1;list Tex2;list gDlabels;default{ state_entry() { if (llGetInventoryNumber(INVENTORY_NOTECARD) > 0) {// gCard = llGetInventoryName(INVENTORY_NOTECARD,5); gQuery =llGetNotecardLine(gCard,0); gCount = 1; } else { llOwnerSay("No Flag notecard detected."); } } changed (integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } dataserver(key qID, string data) { if (qID == gQuery) { if (data != EOF) { integer idx = llSubStringIndex(data,"="); if (~idx) { Sites += [llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM)]; //Site names from NC Tex1 += [llStringTrim(llGetSubString(data,idx+1,idx+37),STRING_TRIM)]; //Texture from NC Tex2 += [llStringTrim(llGetSubString(data,idx+39,-1),STRING_TRIM)]; //Flip texture from NC gDlabels += [(string)gCount + ". " +llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM) + " \n"]; //Dialog text gLstMnu += [(string)gCount]; // Button labels ++gCount; } gQuery = llGetNotecardLine(gCard,++gLine); } else { llSay(0,"Initialized."); llSay(0,gCard); state running; } } }} state running{ changed (integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } touch_start(integer num) { if (llDetectedOwner(0) == llGetOwner()) {// menu = 0; //show main menu, called Continents gDChan = (integer)("0xF" + llGetSubString(llDetectedKey(0),0,6)); llDialog(llDetectedKey(0), "\n\nSelect the Continent for Country flags", Continents, gDChan); llSetTimerEvent(10.0); gDLisn = llListen(gDChan,"","",""); string temp = ""; integer i; //Display the first 10 sites in dialog for (i=0;i<10;++i) { temp += llList2String(gDlabels,i); }// llDialog(llDetectedKey(0),"Which country do you want to display? \n"+ temp, uDlgBtnLst(1) ,gDChan); } } listen (integer channel, string name, key id, string msg) { llSetTimerEvent(0.0); if(msg == "Africa") { gCard = llGetInventoryName(INVENTORY_NOTECARD,0); gQuery =llGetNotecardLine(gCard,0); gLine = 0; state default; } else if(msg == "Asia") { gCard = llGetInventoryName(INVENTORY_NOTECARD,1); gQuery =llGetNotecardLine(gCard,0); gLine = 0; state default; } else if(msg == "Europe") { gCard = llGetInventoryName(INVENTORY_NOTECARD,2); gQuery =llGetNotecardLine(gCard,0); gLine = 0; state default; } else if(msg == "N America") { gCard = llGetInventoryName(INVENTORY_NOTECARD,4); gQuery =llGetNotecardLine(gCard,0); gLine = 0; state default; } else if(msg == "Oceania") { gCard = llGetInventoryName(INVENTORY_NOTECARD,5); gQuery =llGetNotecardLine(gCard,0); gLine = 0; state default; } else if(msg == "S America") { gCard = llGetInventoryName(INVENTORY_NOTECARD,6); gQuery =llGetNotecardLine(gCard,0); gLine = 0; state default; } else if(msg == "Miscellany") { gCard = llGetInventoryName(INVENTORY_NOTECARD,3); gQuery =llGetNotecardLine(gCard,0); gLine = 0; state default; } llListenRemove(gDLisn); // Has the user clicked either the ">>" or "<<" button? if (!llSubStringIndex( msg, " " )) //-- detects 2 (hidden) leading spaces { llSetTimerEvent(10.0); gDLisn = llListen(gDChan,"","",""); string temp = ""; integer menu = (integer)llGetSubString( msg, -~llSubStringIndex( msg, "(" ), -1 ); integer i; for (i=(10*(menu-1)-1);i<(10*menu);++i) { temp += llList2String(gDlabels,i); } llDialog( id, "Which country do you want to visit? \n"+ temp, uDlgBtnLst(menu), gDChan ); } else // If user has clicked a numbered button { integer Choice = (integer) msg -1; llSetTexture(llList2String(Tex1,Choice),4); llSetTexture(llList2String(Tex2,Choice),2); } } timer() { llSetTimerEvent(0.0); llWhisper(0,"Timeout. Please close the dialog box on your screen."); llListenRemove(gDLisn); } } Sorry - scripting is not my natural environment, I guess. Could you please indulge/spoon feed me further and add any additional details which will help me comprehend the process.
  19. Hi all. In my continuing quest to master LSL I need some more assistance, please. I'm trying to construct an on-touch flag texture changer. I came across Rolig's URL dialog script in the Forum which I reckoned was a good starting point and so used that as the basis - my method of learning the intricacies of LSL involves cannibalising and cobbling available scripts in an attempt to understand their working. As an aside, many thanks to Rolig and Void for making their work so freely available to us lesser scripting mortals So I've managed to adapt the URL script to read a set of textures from a notecard list of countries and apply the textures to each side of a flag shaped prim on touch and selection from the dialog box list. So far so good, and it works very satisfactorily, but the last piece of logic escapes me and some help would be much appreciated. There are too many world countries to have all the flags read in as one single notecard so I have split them up to their respective continents and propose to have an initial dialog which first allows selection of the continent before going on to display the countries read from that continent's notecard. I added the list of Continents at the outset and got the dialog to read that first. What happens now is the first dialog comes up and then flick on to the second dialog, which still functions with the list of country flags. I need the Continents dialog to wait for a response and, based on that response, make the variable 'gList', which was used to read the single inventory notecard, now equal the gList sub-variable so that the script can generate the approriate country dialog from that notecard. Here's the script working for the single notecard. //URL Chooser -- Rolig Loon -- February 2011 // Reads web site information from a notecard in the format Site name = http://www.a_great_URL.com // and presents result in a URL prompt. list Continents = [" ", "Miscellany", " ", "N America", "Oceania", "S America", "Africa", "Asia", "Europe"]; integer menu; //variable to keep track of which menu is chosen string country; // Multipage dialog function uDlgBtnLst by Void Singer ( http://community.secondlife.com/t5/LSL-Scripting-Library/Dynamic-Multi-page-Dialog-AKA-Pagination/m-... ) list uDlgBtnLst( integer vIntPag ) { integer vIdxBeg = 10 * (~-vIntPag); //-- 10 * (vIntPag - 1), enclose "~-X" in parens to avoid LSL bug integer vIdxMax = -~(~([] != gLstMnu) / 10); //-- (llGetListLength( gLstMnu ) - 1) / 10 + 1 list vLstRtn = llListInsertList( llList2List( gLstMnu, vIdxBeg, vIdxBeg + 9 ), //-- grab 10 dialog buttons (list)(" <<---(" + (string)(vIntPag + (-(vIntPag > 1) | vIdxMax - vIntPag)) + ")"), //-- back button -1 ) + //-- inserts back button at index 9, pushing the last menu item to index 10 (list)(" (" + (string)(-~((vIntPag < vIdxMax) * vIntPag)) + ")--->>"); //-- add fwd button at index 11 return //-- fix the order to L2R/T2B llList2List( vLstRtn, -3, -1 ) + llList2List( vLstRtn, -6, -4 ) + llList2List( vLstRtn, -9, -7 ) + llList2List( vLstRtn, -12, -10 ); } //-- Anti-License Text --//*/ // Contributed Freely to the Public Domain without limitation. //*/ // 2009 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ] //*/ // Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/ //-- list gLstMnu; integer gLine; string gCard; string gCard1; string gCard2; string gCard3; string gCard4; string gCard5; string gCard6; integer gDChan; integer gDLisn; key gQuery; integer gCount; list Sites; list Tex1; list Tex2; list gDlabels; default { state_entry() { if (llGetInventoryNumber(INVENTORY_NOTECARD) > 0) { gCard = llGetInventoryName(INVENTORY_NOTECARD,0); gQuery =llGetNotecardLine(gCard,0); gCard1 = llGetInventoryName(INVENTORY_NOTECARD,1); gCard2 = llGetInventoryName(INVENTORY_NOTECARD,2); gCard3 = llGetInventoryName(INVENTORY_NOTECARD,3); gCard4 = llGetInventoryName(INVENTORY_NOTECARD,4); gCard5 = llGetInventoryName(INVENTORY_NOTECARD,5); gCard6 = llGetInventoryName(INVENTORY_NOTECARD,6); gCount = 1; } else { llOwnerSay("No Flag notecard detected."); } } changed (integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } dataserver(key qID, string data) { if (qID == gQuery) { if (data != EOF) { integer idx = llSubStringIndex(data,"="); if (~idx) { Sites += [llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM)]; //Site names from NC Tex1 += [llStringTrim(llGetSubString(data,idx+1,idx+37),STRING_TRIM)]; //Texture from NC Tex2 += [llStringTrim(llGetSubString(data,idx+39,-1),STRING_TRIM)]; //Flip texture from NC gDlabels += [(string)gCount + ". " +llStringTrim(llGetSubString(data,0,idx-1),STRING_TRIM) + " \n"]; //Dialog text gLstMnu += [(string)gCount]; // Button labels ++gCount; } gQuery = llGetNotecardLine(gCard,++gLine); } else { llSay(0,"Initialized."); state running; } } } } state running { changed (integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } touch_start(integer num) { if (llDetectedOwner(0) == llGetOwner()) { // menu = 0; //show main menu, called Continents gDChan = (integer)("0xF" + llGetSubString(llDetectedKey(0),0,6)); llDialog(llDetectedKey(0), "\n\nSelect the Continent for Country flags", Continents, gDChan); llSetTimerEvent(10.0); // gDChan = (integer)("0xF" + llGetSubString(llDetectedKey(0),0,6)); gDLisn = llListen(gDChan,"","",""); string temp = ""; integer i; //Display the first 10 sites in dialog for (i=0;i<10;++i) { temp += llList2String(gDlabels,i); } llDialog(llDetectedKey(0),"Which country do you want to display? \n"+ temp, uDlgBtnLst(1) ,gDChan); } } listen (integer channel, string name, key id, string msg) { llSetTimerEvent(0.0); llListenRemove(gDLisn); // Has the user clicked either the ">>" or "<<" button? if (!llSubStringIndex( msg, " " )) //-- detects 2 (hidden) leading spaces { llSetTimerEvent(10.0); gDLisn = llListen(gDChan,"","",""); string temp = ""; integer menu = (integer)llGetSubString( msg, -~llSubStringIndex( msg, "(" ), -1 ); integer i; for (i=(10*(menu-1)-1);i<(10*menu);++i) { temp += llList2String(gDlabels,i); } llDialog( id, "Which country do you want to visit? \n"+ temp, uDlgBtnLst(menu), gDChan ); } else // If user has clicked a numbered button { integer Choice = (integer) msg -1; llSetTexture(llList2String(Tex1,Choice),4); llSetTexture(llList2String(Tex2,Choice),2); } } timer() { llSetTimerEvent(0.0); llWhisper(0,"Timeout. Please close the dialog box on your screen."); llListenRemove(gDLisn); } }Apologies for any untidiness - work in progress. :) By my reckoning I need to use an if/else sequence from the Continents dialog to make the script read from the appropriate notecard list and I made several attempts failed miserably. I don't know if it's because the variable I'm trying to set is in the wrong sequence to register with the rest of the script or I'm getting my llListen set up wrong. Worst case scenario I reckon I could set up a master script to switch on/off one of a series of scripts based on the Continents dialog and pass a message to trigger the country selection dialog but that strikes me as a bit messy so I'm hoping there's just some simple step I'm missing. I hope this all makes sense. Thanks. Carbon
  20. Jasmin, sounds to me as if you imported an object file which is not a sculpt mesh as far as JASS is concerned and as such there's nothing that the Primstar plug-in can bake. You may be able to 'Sculptify' it if it's reasonably simple, but otherwise you'll need to either start again using one of the premade JASS sculpt meshes in Blender or learn the long hand unwrap process from before the Primstar plug-in was developed. Halfway house solution would be to start a new sculpt mesh and shape it over the object mesh, either using Shrinkwrap modifier or vertex by vertex using snap.
  21. Hi Jasmin. Can you say what the problem is with Blender - what format have you exported your model from Wings? Import into Blender with the Primstar/JASS plug-in works with tga, obj, or dae format files and should load up with no difficulty. Generally however, you start with an oblong sculpt mesh and that's what generates the oblong sculpt map. I don't know Wings so I'm not sure you can create a regular sculpt mesh in that programme then expect to change it to an oblong version by importing to Blender. Sorry I can't help further other than suggest you persevere and learn to do it all within Blender or one of the other major graphic apps. It gets easier with time. .
  22. Thanks Cerise and Void. I'm relieved to log back on and find the intrusions gone - a bit of relief at not having to go through a major pc clean-up exercise. I guess I have to move on in life, accept change, and use the new wiki, though for some reason I find the older one a bit easier to use as reference base. maybe I like the type colour better.
  23. Thanks Void, and oh bother!!........... I'm referring to the 'old' LSL wiki that my browser still points to - http://lslwiki.net/lslwiki/wakka.php?wakka=HomePage, not the newer one. If there's nothing untoward there that anyone else sees I guess I've got some sort of infection. I clicked on the link at the bottom of the page to the owner, CatherineOmega and that page is full of wierdness.
  24. Did I miss something recently? I know there's new functions been made active but I just looked on the Wiki. Are the additional category headings in the Functions section of the LSL Wiki, namely: droid 4, training iso, Jam Tangan, and obat wasir, which take you to external web pages, intentional, a hack into SL's wiki, or something on my machine only?
  25. Also, in Phoenix certainly - not sure about other viewers, you can do the nudging by holding down shift or control while you click the arrows. That changes whether its the centimeter or millimeter value is used for incremental change. Saves you having to change the units setting. Can't remember which is which but a bit of experimentation should set you right.
×
×
  • Create New...