Jump to content

IsabellaRose Fallen

Resident
  • Posts

    12
  • Joined

  • Last visited

Everything posted by IsabellaRose Fallen

  1. I did it!!! It took a lot of attempts and a lot of reading, a lot of re-writing and discovering what I was leaving out or what shouldn't be there, but I finally got it working perfectly...would it be sad to say I actually squealed in RL when I realized it was finally done? LOL Thank you again so VERY much for all the help!!
  2. I got the name part to work! YAY!! Now to figure out getting the main script to communicate with the animation script to turn it on and off...like I said, I tried combining the two scripts but it ended up breaking the whole thing, but I was tired and frustrated so I might have done it wrong. I'll try that again first, I think...saving a copy of the working script, of course! In the real possibility that I can't get this to work, how exactly do I create a link_message event in the animation script to make it listen to the main one?
  3. Well, I couldn't figure out where to put the name stuff, and trying to combine the two scripts ended in simply breaking the main script altogether (glad I saved a copy of the bottle with the original script work in it!)...I'm tired and getting frustrated with it, so it's time to put it up for the night and come back to it tomorrow. I'll try to figure out how to link the two scripts since that will probably work better (I don't wanna break it again, that was really discouraging). It would probably really help if I actually understood scripting language, huh? It's like trying to hold a conversation in Greek when all you know is a few key words...LOL At least for every scripting trick I learn, it's another that I will know how to use in the future! Thank you for the help!
  4. Okay, it's giving me a Syntax Error on integer idx = llSubStringIndex(name," "); I put it at the top with the rest of the integer list, is there something I should be adding? And yeah, I think legacy name is better, for the simple fact that not everyone's display name is so easy to understand...LOL
  5. Let me pop those in and see if it works (which I'm sure it will, your tips haven't failed me yet...LOL)! I was thinking of combining the scripts, figured it would be easier and probably a bit smoother, but I couldn't figure out how. It kept giving me syntax or argument errors...
  6. So, because of how much more I wanted my newest cups and bottles to do, I've rewritten the script, and so far, it works beautifully! There's just two details I'd like to add/change, but can't figure them out... The first one is easy -- how do I get it so that the messages posted in local chat will only say the avatar(s)'s FIRST name(s), instead of their full names? This is purely cosmetic for me, not really necessary, but I'd love to fix it if I can! Second problem is a bit more complicated, I think, but only because I don't really know what I'm doing...LOL I have a second script in the bottle that contains the two animations inside (one is for the hold, the other is for the drink -- I have them as separate animations on a timer because I have a sound that plays specifically when the drinking animation plays). What I would like is for that script to be turned OFF when the 'cap' is on the bottle/cup, and turned ON when the 'cap' is taken off. Is there a way to work this out? Here is the main script -- like I said, it works beautifully, save for those two little kinks I'm hoping I can work out -- hard to take a drink when the cap is in the way! (I took out most of the drink menu to shorten it, since other than the color params it's the same as the Apple Juice option) key USER_KEY; integer LISTEN; integer DLN; integer gCap; integer gBottle; integer CHANNEL; list MENU_MAIN = ["UNCAP","CAP","FILL"]; list MENU_OWNER = ["CAP ON","CAP OFF","FILL","GENDER"]; string MENU_TEXT = "\nPlease Choose Menu Option"; list MENU_GENDER = ["BOY","GIRL"]; list MENU_FILL = ["APPLE JUICE","GRAPE JUICE","ORANGE JUICE","MILK","CHOC MILK","SBERRY MILK"]; string LASTCOMMAND; string gender = "She"; string gender2 = "her"; default { state_entry() { integer i; while (i < llGetNumberOfPrims() ) { ++i; if (llGetLinkName(i) == "Cap") { gCap = i; } if (llGetLinkName(i) == "Bottle") { gBottle = i; } } } touch_start(integer total_number) { DLN = llDetectedLinkNumber(0); USER_KEY = llDetectedKey(0); CHANNEL = (integer)(llFrand(-1000000000.0) - 1000000000.0); LISTEN = llListen(CHANNEL, "", NULL_KEY, ""); if (USER_KEY == llGetOwner()) { llDialog(USER_KEY, MENU_TEXT, MENU_OWNER, CHANNEL); llSetTimerEvent(60.0); } else { llDialog(USER_KEY, MENU_TEXT, MENU_MAIN, CHANNEL); llSetTimerEvent(60.0); } } timer() { if (LASTCOMMAND == "UNCAP") { llDialog(USER_KEY, MENU_TEXT, MENU_MAIN, CHANNEL); LASTCOMMAND = ""; } if (LASTCOMMAND == "TAUNT") { llDialog(USER_KEY, MENU_TEXT, MENU_MAIN, CHANNEL); LASTCOMMAND = ""; } else { llSetTimerEvent(0); LASTCOMMAND = ""; } } listen(integer channel, string name, key id, string message) { if(message == "GENDER") { llDialog(USER_KEY, MENU_TEXT, MENU_GENDER, CHANNEL); } if(message == "BOY") { gender = "he"; gender2 = "his"; llOwnerSay("Gender set to boy."); } if(message == "GIRL") { gender = "she"; gender2 = "her"; llOwnerSay("Gender set to girl."); } if (message == "CAP OFF") { LASTCOMMAND = message; llSetTimerEvent(5); llSay(0, name + " takes the cap off of " + (string)gender2 + " bottle."); llSetLinkAlpha(gCap, 0, ALL_SIDES); llSetLinkAlpha(gCap,0,ALL_SIDES); } { LASTCOMMAND = message; } if (message == "CAP") { LASTCOMMAND = message; llSetTimerEvent(0); llSay(0, llKey2Name(id) + " places the cap on " + llKey2Name(llGetOwner()) + " 's bottle."); llSetLinkAlpha(gCap, 1, ALL_SIDES); } if (message == "CAP ON") { LASTCOMMAND = message; { llSay(0, name + " replaces the cap on " + (string)gender2 + " bottle."); llSetLinkAlpha(gCap, 1, ALL_SIDES); } { LASTCOMMAND = message; } } if (message == "UNCAP") { LASTCOMMAND = message; llSay(0, llKey2Name(id) + " removes the cap from " + llKey2Name(llGetOwner()) + "'s bottle."); llSetLinkAlpha(gCap, 0, ALL_SIDES); } { LASTCOMMAND = message; } { if(message == "FILL") { llDialog(USER_KEY, MENU_TEXT, MENU_FILL, CHANNEL); } if (message =="APPLE JUICE"){ llSay(0, llKey2Name(id) +" goes to fill "+ llKey2Name(llGetOwner()) +"'s bottle with apple juice. "+ (string)gender + " takes a big sip and smiles. "); llSetLinkColor(gBottle,<0.922, 0.784, 0.376>,3);} } } }And just in case it's needed, here's quick-and-easy animation timer I use: string anim ="[:B.K:] Bottle Hold"; string anim2 ="[:B.K:] Bottle Drink"; default { attach(key victim) { if(victim == NULL_KEY) { llStopAnimation(anim); llStopAnimation(anim2); llSetTimerEvent(0); } else { llRequestPermissions(victim,PERMISSION_TRIGGER_ANIMATION); } } run_time_permissions(integer permissions) { if(PERMISSION_TRIGGER_ANIMATION & permissions) { llStartAnimation(anim); llStartAnimation(anim2); llSetTimerEvent(30); } } timer() { llStartAnimation(anim2); llStartAnimation(anim); } } // END //
  7. You were right, all I had to do was reset the scripts! I can't believe that was what was causing it...I was driving myself nuts over this! Thank you both so much for your help! Chalk this up to one of those times I just plain did a stupid...LOL
  8. Ah, okay! How do I do that? I'm sorry, I know it's probably really easy, but I'm still learning scripts...
  9. I do believe that channel settings are my problem, I just don't know how to fix it... The script I have (a sippy cup menu) works beautifully -- the person who clicks on the cup chooses a drink, and it posts a short message in local chat ('so-and-so has filled so-and-so's cup with yummy milk', for example). The problem is that if anyone ELSE nearby is holding ANOTHER cup with the same script inside, it will also change THEIR drink, with the same message. Since I'm wanting to release a new line of cups where the 'liquid' inside is actually visible and will change depending on the drink, I would really like to figure out this problem...like I said, I'm fairly certain it's something to do with channels? Here is the script in question, for reference: integer channel; string FirstName( string name ) { list name_part = llParseString2List( name, [" "], [] ); return llList2String( name_part, 0 ); } integer listen_handle; default { state_entry() { channel = 65536 + (integer)llFrand( 10000000 ); listen_handle = llListen(channel,"",NULL_KEY,""); } touch_start(integer total_number) { string my_name = llKey2Name( llGetOwner() ); string my_first_name = FirstName( my_name ); llDialog(llDetectedKey(0),"What would you like to fill "+ my_first_name +"'s cup with? There is:" ,["Grape Juice","Apple Juice","Orange Juice","Lemonade","Milk", "Choc Milk","Soda","Ask Mommy","Ask Daddy"],channel); } listen(integer channel,string name, key id, string msg) { string my_name = llKey2Name( llGetOwner() ); string my_first_name = FirstName( my_name ); string toucher_name = name; string toucher_first_name = FirstName( toucher_name ); string old_object_name = llGetObjectName(); llSetObjectName( toucher_first_name ); if (msg=="Apple Juice"){ llSay(0, "/me goes to fill "+my_first_name+"'s sippy cup with apple juice. "+my_first_name+" looks excited and thanks you. ");} if (msg=="Grape Juice"){ llSay(0, "/me pulls off the top and pours in some grape juice for "+my_first_name+". Once finished they place the lid back on and smile ");} if (msg=="Orange Juice"){ llSay(0, "/me gets fresh orange juice for "+my_first_name+". "+my_first_name+" thanks you. ");} if (msg=="Lemonade"){ llSay(0, "/me nods and fills "+my_first_name+"'s cup up to the brim with lemonade. Then asks, 'Do you want anything more?' ");} if (msg=="Soda"){ llSay(0, "/me takes "+my_first_name+"'s cup and fills it with soda. "+my_first_name+"'s smiles in gratitude. ");} if (msg=="Milk"){ llSay(0, "/me filles "+my_first_name+"'s with just the right amount of milk. "+my_first_name+" takes a sip and thanks you with a sweet smile. ");} if (msg=="Choc Milk"){ llSay(0, "/me mixes up some chocolate milk and fills "+my_first_name+"'s cup...yummy! ");} if (msg=="Ask Mommy"){ llSay(0, ""+my_first_name+" holds up their sippy cup, asking Mommy if she would please fill it up with something yummy! ");} if (msg=="Ask Daddy"){ llSay(0, ""+my_first_name+" holds up their sippy cup, asking Daddy if he would please fill it up with something yummy! ");} llSetObjectName( old_object_name ); } }I'll be making quite a few simple little additions with the new line that I have coming out, and I can handle them on my own. But that one little issue is probably the most important, in my opinion, and I'd REALLY appreciate any help with figuring it out! Thank you all in advance =)
  10. I did it!! I finally got it to work just the way I wanted to! Miss Rolig, thank you SO much for your help...you're amazing, I couldn't have done it without you!
  11. Rolig Loon wrote: If you use llSetLinkPrimitiveParams, you can also adjust transparency in the same statement, which can make the difference between apple juice and orange juice, perhaps. if (msg=="Apple Juice"){ llSay(0, "/me goes to fill "+my_first_name+"'s sippy cup with apple juice. "+my_first_name+" looks excited and thanks you. "); llSetLinkPrimitiveParams(gLiquidLink,[PRIM_COLOR,ALL_SIDES,<1.000, 0.522, 0.000>,0.2);} When the cup is meant to be empty, just set the alpha to 0.0. This looks like the one I want to use, because the alpha would make it perfect...the only problem I'm running into now is the 'Name not defined within scope' error, regarding gLiquidLink? The 'liquid' prim is named Liquid, and it's number 2 in the linkset (there's only two prims, altogether)...how do I define that properly? I'm sorry, I said I'm not very script-savvy...but I really do appreciate all the help, and once I get it all figured out, I'll never forget it!
  12. I'm not very script-savvy, most of my work is figured out in a hit-or-miss way -- I usually just keep fiddling and piecing codes together until I get it right -- but this one has me stumped. I already have a basic script for a drink menu that I used in my Super Sippy Cups, and it works beautifully; very simple, lets whoever clicks on the cup choose what 'drink' to 'fill' it with, and gives a little rp-style blurb in local chat describing it. For example, clicking on my own cup and choosing 'Apple Juice' from the menu gives you the message: "IsabellaRose goes to fill IsabellaRose's sippy cup with apple juice. IsabellaRose looks excited and thanks you." Simple enough. Now, I'm working on a new cup that has an open top, and I plan to add a prim to the inside to look like it's actually got a drink in it (right now, it's just an empty cup). What I'm wondering/hoping is...is there some way to adjust the menu so that when a drink option is chosen from the menu, not only do you get the chat message, but that added prim (which would be a child prim) would be tinted a different color to represent said drink? Here's a shortened version of the script I already use (I took out all but a couple of the drink options for repetition's sake): integer channel; string FirstName( string name ) { list name_part = llParseString2List( name, [" "], [] ); return llList2String( name_part, 0 ); } integer listen_handle; default { state_entry() { channel = 65536 + (integer)llFrand( 10000000 ); listen_handle = llListen(channel,"",NULL_KEY,""); } touch_start(integer total_number) { string my_name = llKey2Name( llGetOwner() ); string my_first_name = FirstName( my_name ); llDialog(llDetectedKey(0),"What would you like to fill "+ my_first_name +"'s cup with? There is:" ,["Apple Juice","Orange Juice","Milk", "Choc Milk"],channel); } listen(integer channel,string name, key id, string msg) { string my_name = llKey2Name( llGetOwner() ); string my_first_name = FirstName( my_name ); string toucher_name = name; string toucher_first_name = FirstName( toucher_name ); string old_object_name = llGetObjectName(); llSetObjectName( toucher_first_name ); if (msg=="Apple Juice"){ llSay(0, "/me goes to fill "+my_first_name+"'s sippy cup with apple juice. "+my_first_name+" looks excited and thanks you. ");} if (msg=="Orange Juice"){ llSay(0, "/me gets fresh orange juice for "+my_first_name+". "+my_first_name+" thanks you. ");} if (msg=="Milk"){ llSay(0, "/me filles "+my_first_name+"'s with just the right amount of milk. "+my_first_name+" takes a sip and thanks you with a sweet smile. ");} if (msg=="Choc Milk"){ llSay(0, "/me mixes up some chocolate milk and fills "+my_first_name+"'s cup...yummy! ");} llSetObjectName( old_object_name ); } }
×
×
  • Create New...