Jump to content

Carbon Philter

Resident
  • Posts

    212
  • Joined

  • Last visited

Everything posted by Carbon Philter

  1. Sorry, not sure about Maya, but it's definitely possible in Blender. Add an identical size cube to each of the sculpts to generate a bounding box with identical centre then when rezzed in SL each sculpt will have the same overall bb size and centre. I haven't moved from the old Blender/Primstar set-up so can't say what the current keystrokes or commands may be using JASS but the principle should remain true. Here's a link to an old thread where Domino Marama answered one of my queries and explained how to add a cube to generate a bounding box. http://www.dominodesigns.info/node/144#comment-334 The relevant section is the one titled Megaprim sculptie baking. Hope that helps.
  2. Try this one, at least as a starting point: http://wiki.secondlife.com/wiki/User:Fred_Gandt/Scripts#Floating_on_Water_.28very_beta.29_.28_V2_.29 Alternatively, search in world for a Sea Mine created by Aley - all her Arcadia Asylum stuff is free and open source. It contains a script created by Guaca Mole - one of the Linden Moles (and great name,too!), entitled Random Floating Script - kinematic version - v2.0, which you can take apart and mess with.
  3. Sounds as if something like an Orrery is intended. If things haven't changed over the last few years - as I understand it, hierarchical linking isn't possible in LSL. Here's a link to the archived forum that relates: http://forums-archive.secondlife.com/54/39/301270/1.html
  4. Thanks, Xiija. That's certainly a lot closer to the solution I'm after. The child prim stays horizontal as required, but unfortunately it also seems to want to rotate to face 0,0,0 all the time, regardless of which direction the boat is facing. I'm hoping to get it to stay pointing towards the boat's bow but it's certainly a large advance on any of my previous attempts, so I'll go wrestle some more with the variables. And yes, I've been at the Wiki page on rotations for what seems like an eternity now trying to understand it all. Carbon
  5. Thanks Innula. I'm afraid those suggestions don't do what I'm after. I guess my description isn't clear. When I tried it on a test boat the first option turned the boat to face east and using the l/r keys wouldn't move it in any other direction, and the second option allowed only slight l/r movement and made the child prim rotate around its z axis in steps. What I'm trying for is whatever the rotation around the x axis of the root prim (boat hull) as it heels, I want the child prim to rotate an equivalent amount around its x axis in the opposite direction so that its z axis remains pointing vertically - just like an artificial horizon guage in an aircraft. You have however drawn my attention to other functions that I hadn't got around to considering so I will soldier on and pull some more hair out trying to get a solution. Carbon
  6. Hi all. Rotations are still doing my head in and more help is needed. I'm trying to create an artificial horizon prim which stays horizontal for a boat which heels from side to side. I've read through the rotations page on the wiki and from that and help given here previously I had thought I could get it worked out but no such luck so far. My thought is to use a timer script in the child prim, which has its orientation identical to the root prim, firstly to determine the global rotation using llGetRootRotation() and then pull out the rotation between the root prim at any angle of heel and its vertical equivalent using: llRotBetween( llRot2Up( llGetRootRotation()), < 0.0, 0.0, 1.0> ) then apply that to the child prim with llSetRot to offset the root prim's heel angle. So far, with the linkset orientated to 0,0,0, the child prim takes the root's angle but adds to it instead of subtracting - so if the root heels 10deg the child rotates a further 10 deg instead of -10 deg. How to I combine the quaternion values to achieve a negative rotation rather than add to it? I've gone through trying division instead of multiplication and also changing the order of vectors to be calculated. I've also swapped minus signs in and out. What's worse is when I rotate the linkset in the horizontal plane without any heel the childprim also rotates in the horizontal plane but by a different factor. I am obviously not understanding something fundamental. Help! Here's what I've been playing with to test it. There are lots of OwnerSays to try seeing if I can understand from the reported values what I need to do but a solution still eludes me. vector eulbow = <0.0, 0.0, 0.0>; default { state_entry() { llSay(0, "Hello, Avatar!"); llSetTimerEvent(5.0); } touch_start(integer total_number) { // llOwnerSay("Local Rot2Up is: " + (string)llRot2Up(llGetLocalRot())); // llOwnerSay("Rot2Up is: " + (string)llRot2Up(llGetRot())); } timer() { rotation quat = llEuler2Rot(eulbow); rotation RR = llGetRootRotation()*llRotBetween( llRot2Up( llGetRootRotation()), < 0.0, 0.0, 1.0> ); llOwnerSay ("RR: "+(string)RR); llOwnerSay ("RotBetween: "+(string)llRotBetween( <0.0, 0.0, 1.0>, llRot2Up(llGetRootRotation()))); llOwnerSay ("llGetRootRotation(): "+(string)llGetRootRotation()); llOwnerSay("GetRot: " + (string)llGetRot()); llSetRot(RR); } } Thanks for any assistance. Carbon
  7. Many thanks for help, people. I had meant the perms rather than the anims was giving me the problem. I confess I looked and tried both examples on the wiki and had vague suspicions about the loss/change of perms but couldn't quite get my head around it. Innula - your script did just what I wanted and also looked a lot more tidy than my protracted logic. Assistance is much appreciated - as always. Carbon
  8. Hi all. A new year and yet another scripting problem.............. I'm trying to have an object rezzed for a fixed period and, if action is taken within that timeframe, then have it attached and animate the wearer without it belonging to whoever rezzes it, but am falling down at the last bit - at least I think it's just the last bit! The rez event is triggered by sitting on a prim and the script is as follows: string anim; integer on; string onstr; default { state_entry() { llSitTarget(<-1.3, 0.100, 0.24804>, ZERO_ROTATION); } changed(integer change) { if (llAvatarOnSitTarget() != NULL_KEY) { // llOwnerSay(llAvatarOnSitTarget()); onstr = llAvatarOnSitTarget(); llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION); llRezObject( "Prim1", llGetPos()+<1,1,1>, ZERO_VECTOR, ZERO_ROTATION, on ); } } run_time_permissions(integer perm) { anim = "stand_1"; llStopAnimation("sit"); llStartAnimation(anim); } } The object being rezzed has a 10 second slot in which the av sitting can touch it and wear it using the temp attach function. I've got that bit working. Once worn I've cancelled the timer which deletes it if not touched within the 10 sec and tried to set up a new timer to switch randomly between two animations. I've got the perms and temp attach working but I can't get the if conditional in the timer to work correctly. I used an 'attach' event to get the key of the av and tried to port that into the timer event as a cast string but I guess I'm not fully understanding the process as it simply doesn't appear to trigger the timer if/else action. Here's the second script which works when the choice is made to attach it, but throws up a script error about not finding the anim if not triggered by a touch event instead of dying. integer gTimeout = 5; key on; key attached; default { on_rez(integer start_param) { llSetTimerEvent(10.0); } touch_start(integer A) { on = llDetectedKey(0); if (on != NULL_KEY) { llRequestPermissions(on, PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH); } } run_time_permissions (integer perm) { if (perm & PERMISSION_ATTACH) { llAttachToAvatarTemp( 5 ); llSetTimerEvent(0.0); } else { llDie(); } } attach(key attached) { if (attached != NULL_KEY) { llSetTimerEvent(gTimeout); llOwnerSay("Timer Event is " + (string)gTimeout); llOwnerSay("attached = "+ (string)attached); } } timer() { llOwnerSay("Timer attached = "+ (string)attached); if (attached != NULL_KEY) { llOwnerSay("attached recognised = "+ (string)attached); float choice; choice = llFrand(3.0); if (choice < 2.0) { llStartAnimation("CPStand1"); } else { llStopAnimation("CPStand1"); llStartAnimation("CPStand2"); } } else llDie(); } } // END //I did manage to change the timer such that the object did die at the end of the 10 sec interval but in that case the anims didn't trigger when the object was attached. There are several OwnerSay's stuck in to try some debugging but I'm struggling to work it out. A push in the right direction would be much appreciated. Thanks Carbon
  9. Thanks for comment, Ela. It's not to do with a script disabled sim from further checks. I guess there's differences between the RC server sims as after reading your post I went off to Sandbox Exemplar and tried running the projectile across the region boundary there. Although there was a bit of rubber banding it worked as it should. To do the initial build I've been sitting in my home sim which is running on Blue Steel and firing the projectiles across into a LL ocean sim which is on Le Tigre server, and there the projectile just keeps running and hits the far edge of the water sim and just sits there - no die, even if set to temp, until I go close and try to select it to edit and then it just poofs. Maybe I should be making a comment to LL about this as an issue with their RC server developments. Anyway, thanks again, Ela.
  10. Can anyone suggest a solution for the following - I set up a scripted projectile and rezzed it with llSetImpulse to get it moving with a timer and llDie so that it would delete after travelling a set distance. Works fine as long as within one sim but if it travels across a sim boundary the timer either stops or stuffs up and the projectile just travels on indefinitely. From the wiki I believe I could set up something using llEdgeOfWorld to detect the boundary but I would then need the projectile to work out how long it has to travel in the enjoining sim before llDie activates. Is it possible or has the projectile lost all it's scripted properties when it crosses the region boundary and so won't react to any new commands to die? The only other solution I can think of would be setting it initially to temp and relying on that as the way to get rid of it - as long as that property is retained when the prim crosses the boundary. Suggestions gratefully received. C
  11. Many thanks, Dora. Sorry if my explanation wasn't clear. The second snippet worked a treat! You've also helped by pointing me towards llRotBetweenand llRot2Up which I hadn't really been aware of. I'm now off back to the wiki to read up more and try to add to my understanding of rotations. Appreciate the help. Carbon
  12. Hi All, Need a little assistance on the complexities of rotation and llRezObject, please. I trying to script an object to launch physical prims horizontally regardless of the launcher inclination on the z axis. After more wading through the wiki I've cobbled together a simple script so that it works with the prims rezzing correctly relatively to the launcher orientation in the xy plane, but it spits them out relative to the launcher's vertical rotation. I need to prevent the prims being launched in any other angle than horizontal and I'm getting bogged down. I suspect I have to use llGetRot to detect the quaternion components individually and feed them to the rotation part of the RezObject function keeping the .z bit as 0.0 but I can't work out how exactly to word it. Advice would be much appreciated. Here's what I've got working so far: vector eul = <00.0,0.0,00.0>; default { state_entry() { llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { llOwnerSay("Launch"); rotation quat = llEuler2Rot(eul); llRezObject("p1", llGetPos() + <5.150, 3.100, -0.33>*llGetRot(), <15,0.0,00>*llGetRot(), quat*llGetRot() , 43); llRezObject("p1", llGetPos() + <5.150, -3.100, -0.33>*llGetRot(), <15,0.0,00>*llGetRot(), quat*llGetRot() , 43); // llOwnerSay("GetRot is "+(string)llRot2Euler(llGetRot())); } } Carbon
  13. Just add a regular prim as the root and put the sript in that then rotate the sculpt child prims to whatever orientation looks right for the vehicle. The alternative is to go reorientate the sculpt in whetever modelling app you used to create it. If you didn't create the sculpt it's back to option one, I think.
  14. You will also need to do 'Analyse' when in the mesh upload window. I had problems a while back and got assistance on the issue here. See the following thread for more info. http://community.secondlife.com/t5/Mesh/Mesh-Physics-Query/m-p/1359221
  15. Sounds about right, though I would reckon the rotation variable would need to be in the rudder prim. Just have the sailing engine send the message left or right to the script in the rudder and have that prim do the local rotation calculation. Hope that helps.
  16. Haven't tried it myself - yet - but I would suspect that where the sailing engine detects left or right key press you could add in a message linked prim rotation instruction around each of the rudder1 and rudder 2 pivots. How the linking tiller bar would also have to be worked in with port/centre/starboard positions to suit the rudder, again based on the left/right key press. That's where I would start anyhow. It may not be the optimum solution but with a bit of work I reckon it could be made to work.
  17. The SL Frank Lloyd Wright Museum sim had to close down a few months back - I believe that was to do with infringing real World FLW Trust rights by reproducing a computer version of his Falling Water building and others.
  18. Hi Vin. On Marketplace I took a look at the ship you're planning to mod and have a couple of comments. Firstly the likelihood of the scripts being mod is to my mind fairly low - the price and complexity of the product tends to suggest you'll be presented with no-mod scripts, but I could be totally wrong. You might however be able to simply delete the scripts and start from scratch. Secondly, looking at the extent of sail on board and given your initial statement of being new to scripting, without belittling your capabilities, I think adapting the BWind sailing scripts for that number and style of sails might be a bit challenging as a first project. Cubey Terra created and made available an Creative Commons license submarine which uses a vehicle script which has a stepped motor - you can select the speed using the up/down keys and it continues to move until you step back down through the speed settings to zero. That might be a better starting point to save you keeping your finger on the keys and developing RSI. It's called the Herring 2 and last time I looked, it was available at The GNUbie Store or Stillman Bazaar. It used to be at Abbotts Aerodrome, but that's gone now so I hope it's still available at the other locations. Good luck on whichever creation route you select. Carbon Addendum: Also just realised it's got way more than the 32 prim max allowed for regular physical vehicles, so you're also outside the scope for really anything other than a partial wear vehicle setup or alternatively I believe if you accept the new Land Impact basis of prim calculating you can set some of the prims to have 0 physical presence and reduce it to the 32 limit. Thay may have serious impact on the LI value though.
  19. Head over to Tradewinds Yacht Club in the Dex sim and pick up the BWind free sailboat scripts created by Beca Mouliez along with the tutorial on how to put it all together. That way you get the proper sailing experience and feel good about having created it yourself. here's the link to the tutorial which will help: https://sites.google.com/site/tradewindsyc/boat-building
  20. Hi Miguelito. Firstly, you're really stuck with the sculptie bounding box issue. The best you can do is by orientating the sculpt mesh appropriately to align with the x,y,, and z axes, the bounding box will be no bigger than the basic dimensions on the sculpted model itself. At least, that's how Blender generates the sculpt uv mesh. Some in-world sculpt modelling tools can give you a 10x10x10 bounding box regardles of the size of the model created but in most cases that can be adjusted. I haven't experienced vehicle scripts stopping working just because some of the elements have used the phantom child script - my Clyde Puffer uses them to allow me in the wheelhouse and it seems to work fine (so far). The suggestion about setting the physical shape to None can work sometimes but, as said, the LI impact can be horrific and can make the linkset impractical. It may possibly depend on your boat script and I'd be interested to see how it works. There are several OpenSource scripts around for both sial and motor boats, noe of which I've found to have the problem that they stop working when phantom child is used - check out http://www.heatonresearch.com/articles/188/page3.html for a motor boat and for sailing pick up both the Fizz Kit - based originally on the Flying Tako, ot Becca Moulliez' excellent BWind kit.
  21. Just for info - there's a surf pose in SL internal anims so while custom anims may be worth investing inif you're going commercial with the board, you can always call the SL one if you're strapped for cash.
  22. Thank you, Rolig, for those kind words, and, as I said in my IM, my appreciation for all the assistance you and others have provided in this Forum. I sent a copy of the flag selector to Rolig for her amusement but I realise that there may be others out there who persevered in following the thread and might wish to emulate or surpass (not difficult) my effort. I put a bit too much work into the flag textures to distribute them free but given the amount of collaborative assistance in here, the least I can do is make the script available. I know it's not totally right yet - the Continents menu buttons and lists of flag textures have got out of sync and I need to mess about to correct that, aqnd I'd like the Country choice dialogue to come up automatically once the Continent is chosen but these should be relatively minor corrections by comparison with the achievement of getting the thing functioning in the first place. If/when I get the last glitches sorted, I'll post it to the Library but I don't think I should do that until it's squeaky clean. So, for those who want to potter about and use the script as a basis for something else, here it is: //Script cobbled together by Carbon Philter, March 2012, based originally on URL Chooser -- Rolig Loon -- February 2011// Reads texture information from notecards in the format Country = textureUUID1, textureUUID2// and applies result to faces of a prim// 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 = -~(~([] != gLbls) / 10); //-- (llGetListLength( gLstMnu ) - 1) / 10 + 1 list vLstRtn = llListInsertList( llList2List( gLbls, 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 gContinents = ["Africa","Asia","Europe","N America","Oceania","S America","Miscellany"];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 { gQuery = llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD,0),0); gCrdNo = 0; //Reading card #0 gCard = llGetInventoryName(INVENTORY_NOTECARD,gCrdNo); gCount = 1; //Set index for first line in dialog box text } } 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); gLine = 0; //go back and read its card now. state default; } else {// Do your country dialog based on the first ten lines of the current card string temp = ""; integer i;//Display the first 10 sites in dialog for (i=0;i<10;++i) { temp += llList2String(gDlabels,i); } llDialog(llGetOwner(),"Which country do you want to display? \n"+ temp, uDlgBtnLst(1) ,gDChan); } } 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. if (!llSubStringIndex( msg, " " )) //-- detects 2 (hidden) leading spaces { llSetTimerEvent(10.0); gDLsn = 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(gTex1,Choice),4); llSetTexture(llList2String(gTex2,Choice),2); } }}} Thanks, and rest assured - I'll be back for more assistance on other scripting problems. Carbon
  23. Back again, and a step further on. Woohoo!!!! I checked the comms channel and number of script copies running as you suggested and it wasn't that which was messing up. I finally worked out that the sequential counter '++gLine' was continuing from where it left off on the previous run, so I added another line to reset it to 0 at the same time as clearing all the lists and it looks as if that hurdle is now cleared. I suspect I'm not out of the woods yet but even curing this last problem has boosted my morale somewhat and I'm hopeful of ever more competent scripting skills. :matte-motes-big-grin:
  24. Hi again, Rolig and others. Bear with me, please - it's all coming together very gradually, but I've run up against another puzzle. I now have the initial card being read into memory ok - I used OwnerSay to report what has been defined as gSites, gTex1, gTex2, gDlabels, and gLbls, and they all report the whole notecard contents - so no memory constraint there. However, when I select a different Continent in the Dialog and the script goes back through to read the replacement notecard, it either only reads the first line, or skips a whole series of entries in the middle. I've tried substituting each notecard to be the initial read, and in each instance they are read without problem. It is only happening when the global variables are cleared and the selected new card is attempted to be read. Is there anything obvious I'm missing - a script limit or truncation of data for some reason that would be causing this? Anything to do with speed of data transfer? I just can't see what would cause the reading process to skip. Thanks once more Carbon
  25. Thanks for encouragement, R. Please bear with me as although I know it's all pure logic I don't find it straightforward with all the if/else divergences and varying states. I now know what Captain Kirk and the rest of the crew feels like when confronted by Mister Spock. OK. Firstly, the reason the gContinents list had numbers added was to ensure that the notecards, which are actually correctly titled the same as the list entries, was read in the same order. I took that from one of your earlier posts. I did some more butchering to try and determine the main flow and added lots more OwnerSay's than I already had and got a bit further.I tracked the error report down to the dataserver event. On first pass it runs through the process of building up the Sites, Tex1, and Tex2 lists - or appears to do so - until it gets to the line: gQuery = llGetNotecardLine(gCard,++gLine); So I guessed that gCard needs to be defined as whatever card is being read for that particular pass of the process. I put the line gCard = llGetInventoryName(INVENTORY_NOTECARD,gCrdNo); in the first time run section of state entry() and it seems to go motoring. Now I'll have to reintroduce the rest of the script and see where that takes me. C
×
×
  • Create New...