Jump to content

Gruff

Resident
  • Posts

    12
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Qie is dead right, stopping the texture anim would only make the texture stop, I think what she needs is for the fire itselfto turn off, aka go invisible. As you're not LSL literate, I took the liberty of compiling it for you, enjoy! // anim SMOOTH Script // By Doug Linden (I think) // // If you are interested in scripting, check out // the Script Help under the help menu. // The double slash means these lines are comments // and ignored by the computer. // All scripts have a default state, this will be // the first code executed. integer giOn; default { // state_entry() is an event handler, it executes // whenever a state is entered. state_entry() { // llSetTextureAnim() is a function that animates a texture on a face. llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25); // animate the script to scroll across all the faces. giOn = 1; } touch_end(integer num_detected) { if(giOn) { llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0); llSetAlpha(giOn, ALL_SIDES); } else { llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25); llSetAlpha(giOn, ALL_SIDES); } giOn = !giOn; } }
  2. I just basically need to know something. obviously you use this to filter out detection to names: llCollisionFilter("(name here)","",TRUE); But that only filters out things named exactly, how do I script it to make it detect things with the word in it? Like detect both poison arrow and fire arrow as they both have arrow in the name.
  3. ah but there is only ONE child prim. I only need to resize one prim, I'm one trying to make loads of different child prims change to different sizes. I need the root prim to remain the same size, while resizing another prim attatched. I know it's possible, I've done it before however on a very basic script, and I can't for the life of me remember how. As for the resizing to a specific scale, again it's possible, I just can't remember how to do it! I don't want someone to write me a script, I want to learn. The best way for me to learn is to play with ready made scripts and adapt it to how I want it, which is what I'm doing now.
  4. Hi there, I found this opensource script on the Second Life Wiki. It's perfect for a part of a script I'm making, modifications will be made to make the script do other things, however at the moment there are a few alterations to the actual resizing I cannot quite figure out. The first is how to get the other prims to resize and leave the root prim untouched. I don't need to worry about positioning, basically it's going to be a 'bubble' around a single prim that's used as literally a prim sensor. Resizing it would increase and decrease the range of the sensor, however the prim in the center should remain untouched. I tried changing all the i = 1 to i = 2, however all that happened when I tried to resize was the linked prim just went really small, the size wouldn't change at all. The second problem I have is specific resizing. I can't seem to work out how to make the prim change to specific params, rather than a %, ie. Instead of changing by 10% of the size, I'd want it to change to 10m2. (making the x, y and z axis all 10m). Any help would greatly be appreciated! Thanks in advance! /////////////////////////////////////////////////////////////////////////////// // Resizer // by Emma Nowhere // // Last modified: 6/1/2010 // // How to use with menu: // 1. Install this script in the root prim of a linked set of prims (aka "linkset") // 2. Type /1resizer to show the menu // 3. Hit the appropriate buttons to scale up or down the linkset // 4. Hit the "Finish" button to remove the script and finalize prim sizes // // Optionally, enter the percentage directly via chat by typing /1resizer x% // where x is the percentage of the original size you want to resize to. // // If using in a product with no other scripts, change START_ON_TOUCH below to TRUE // so user can initiate resizing by just touching the object. integer START_ON_TOUCH = FALSE; // Display status messages in chat window (to owner only) integer SAY_STATUS = TRUE; // Channel to listen for commands on integer CHAT_CHANNEL = 1; // SL constraints float MIN_SIZE = .01; float MAX_SIZE = 10; float MAX_DISTANCE = 10; float MIN_SCALE = .1; integer MENU_CHANNEL = -1001; list backupPrims = []; integer backupStored = FALSE; float scale = 1.0; init_menu_channel() { MENU_CHANNEL = ((integer)("0x" + llGetSubString((string)llGetKey(), -8, -1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; } say_status(string msg) { if (SAY_STATUS) llOwnerSay(msg); } backup() { if (!backupStored) { say_status("Backing up prim positions and sizes."); backupPrims = []; integer p = llGetNumberOfPrims(); integer i = 0; vector root_pos = <0, 0, 0>; for (i = 1; i <= p; i++) { list params = llGetLinkPrimitiveParams(i, [PRIM_POSITION, PRIM_SIZE]); vector pos = llList2Vector(params, 0); vector size = llList2Vector(params, 1); if (i == 1) { root_pos = pos; } else { pos = pos - root_pos; } backupPrims = backupPrims + pos + size; } backupStored = TRUE; say_status("Prim positions and sizes backed up."); } } float min(float a, float b) { if (a < b) return a; return b; } float max(float a, float b) { if (a > b) return a; return b; } float constrainMinMax(float value, float min, float max) { value = max(value, min); value = min(value, max); return value; } vector constrainSize(vector size) { size.x = constrainMinMax(size.x, MIN_SIZE, MAX_SIZE); size.y = constrainMinMax(size.y, MIN_SIZE, MAX_SIZE); size.z = constrainMinMax(size.z, MIN_SIZE, MAX_SIZE); return size; } vector constrainDistance(vector delta) { delta.x = min(delta.x, MAX_DISTANCE); delta.y = min(delta.y, MAX_DISTANCE); delta.z = min(delta.z, MAX_DISTANCE); return delta; } process(integer restore) { backup(); if (restore) { say_status("Restoring previously backed up positions and sizes."); scale = 1; } else { say_status("Resizing prims to " + (string)llRound(scale * 100) + "% of original size."); } integer p = llGetNumberOfPrims(); integer i = 0; for (i = 1; i <= p; i++) { vector pos = llList2Vector(backupPrims, (i - 1) * 2); vector size = llList2Vector(backupPrims, ((i - 1) * 2) + 1); if (!restore) size = constrainSize(size * scale); if (i == 1) { llSetLinkPrimitiveParamsFast(i, [PRIM_SIZE, size]); } else { if (!restore) pos = constrainDistance(pos * scale); llSetLinkPrimitiveParamsFast(i, [PRIM_POSITION, pos, PRIM_SIZE, size]); } } if (restore) { say_status("Previously backed up prim positions and sizes restored."); } else { say_status("Prims resized."); } } finish() { say_status("Deleting Resizer script."); llRemoveInventory(llGetScriptName()); } menu() { llDialog(llGetOwner(), "Resizer\n\nMake a backup of your object first.\n\nPlease choose an option:\n", ["Revert", "-", "Finish", "-1%", "-5%", "-10%", "+1%", "+5%", "+10%"], MENU_CHANNEL); } handle_message(integer channel, string name, key id, string message) { if (channel == CHAT_CHANNEL) { if (message == "resizer") { menu(); } else if (llSubStringIndex(message, "resizer") == 0) { list params = llParseString2List(message, [" "], [] ); if (llGetListLength(params) == 2) { string scale_param = llList2String(params, 1); if (llGetSubString(scale_param, -1, -1) == "%") { scale = (((float)llGetSubString(scale_param, 0, -2)) / 100); scale = max(scale, MIN_SCALE); process(FALSE); } } } } else if (channel == MENU_CHANNEL) { if (message == "Revert") { process(TRUE); menu(); } else if (message == "Finish") { finish(); } else if (llGetSubString(message, -1, -1) == "%") { scale = scale + (((float)llGetSubString(message, 0, -2)) / 100); scale = max(scale, MIN_SCALE); process(FALSE); menu(); } } } default { state_entry() { if (START_ON_TOUCH) { // we only want a touch_start handler if we're going to use it // so change state rather than just testing inside touch_start // for START_ON_TOUCH to be true. state start_on_touch; } else { llListen(CHAT_CHANNEL, "", llGetOwner(), ""); init_menu_channel(); llListen(MENU_CHANNEL, "", llGetOwner(), ""); llOwnerSay("Resizer Ready"); llOwnerSay("Type /" + (string)CHAT_CHANNEL + "resizer for menu."); } } on_rez(integer start_param) { llOwnerSay("Resizer Installed"); llOwnerSay("Type /" + (string)CHAT_CHANNEL + "resizer for menu."); } listen(integer channel, string name, key id, string message) { handle_message(channel, name, id, message); } } state start_on_touch { state_entry() { llListen(CHAT_CHANNEL, "", llGetOwner(), ""); init_menu_channel(); llListen(MENU_CHANNEL, "", llGetOwner(), ""); llOwnerSay("Resizer Ready"); llOwnerSay("Touch for resizer menu."); } on_rez(integer start_param) { llOwnerSay("Resizer Installed"); llOwnerSay("Touch for resizer menu."); } listen(integer channel, string name, key id, string message) { handle_message(channel, name, id, message); } touch_start(integer num_detected) { menu(); } }
  5. Hi there, I found an opensource resizer script driven by a menu. Now, I am LSL literate, however only at a rookie level really. The script I have is fine, however I need it to keep the root prim the same size, or at least make it so that one prim stays the same size whilst others can be enlarged or shrunk. I've tried various different things, however like I said I'm only at rookie level in scripting really! Here's the script below, any help would be greatly appreciated! /////////////////////////////////////////////////////////////////////////////// // Resizer // by Emma Nowhere // // Last modified: 6/1/2010 // // How to use with menu: // 1. Install this script in the root prim of a linked set of prims (aka "linkset") // 2. Type /1resizer to show the menu // 3. Hit the appropriate buttons to scale up or down the linkset // 4. Hit the "Finish" button to remove the script and finalize prim sizes // // Optionally, enter the percentage directly via chat by typing /1resizer x% // where x is the percentage of the original size you want to resize to. // // If using in a product with no other scripts, change START_ON_TOUCH below to TRUE // so user can initiate resizing by just touching the object. integer START_ON_TOUCH = FALSE; // Display status messages in chat window (to owner only) integer SAY_STATUS = TRUE; // Channel to listen for commands on integer CHAT_CHANNEL = 1; // SL constraints float MIN_SIZE = .01; float MAX_SIZE = 10; float MAX_DISTANCE = 10; float MIN_SCALE = .1; integer MENU_CHANNEL = -1001; list backupPrims = []; integer backupStored = FALSE; float scale = 1.0; init_menu_channel() { MENU_CHANNEL = ((integer)("0x" + llGetSubString((string)llGetKey(), -8, -1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; } say_status(string msg) { if (SAY_STATUS) llOwnerSay(msg); } backup() { if (!backupStored) { say_status("Backing up prim positions and sizes."); backupPrims = []; integer p = llGetNumberOfPrims(); integer i = 0; vector root_pos = <0, 0, 0>; for (i = 1; i <= p; i++) { list params = llGetLinkPrimitiveParams(i, [PRIM_POSITION, PRIM_SIZE]); vector pos = llList2Vector(params, 0); vector size = llList2Vector(params, 1); if (i == 1) { root_pos = pos; } else { pos = pos - root_pos; } backupPrims = backupPrims + pos + size; } backupStored = TRUE; say_status("Prim positions and sizes backed up."); } } float min(float a, float b) { if (a < b) return a; return b; } float max(float a, float b) { if (a > b) return a; return b; } float constrainMinMax(float value, float min, float max) { value = max(value, min); value = min(value, max); return value; } vector constrainSize(vector size) { size.x = constrainMinMax(size.x, MIN_SIZE, MAX_SIZE); size.y = constrainMinMax(size.y, MIN_SIZE, MAX_SIZE); size.z = constrainMinMax(size.z, MIN_SIZE, MAX_SIZE); return size; } vector constrainDistance(vector delta) { delta.x = min(delta.x, MAX_DISTANCE); delta.y = min(delta.y, MAX_DISTANCE); delta.z = min(delta.z, MAX_DISTANCE); return delta; } process(integer restore) { backup(); if (restore) { say_status("Restoring previously backed up positions and sizes."); scale = 1; } else { say_status("Resizing prims to " + (string)llRound(scale * 100) + "% of original size."); } integer p = llGetNumberOfPrims(); integer i = 0; for (i = 1; i <= p; i++) { vector pos = llList2Vector(backupPrims, (i - 1) * 2); vector size = llList2Vector(backupPrims, ((i - 1) * 2) + 1); if (!restore) size = constrainSize(size * scale); if (i == 1) { llSetLinkPrimitiveParamsFast(i, [PRIM_SIZE, size]); } else { if (!restore) pos = constrainDistance(pos * scale); llSetLinkPrimitiveParamsFast(i, [PRIM_POSITION, pos, PRIM_SIZE, size]); } } if (restore) { say_status("Previously backed up prim positions and sizes restored."); } else { say_status("Prims resized."); } } finish() { say_status("Deleting Resizer script."); llRemoveInventory(llGetScriptName()); } menu() { llDialog(llGetOwner(), "Resizer\n\nMake a backup of your object first.\n\nPlease choose an option:\n", ["Revert", "-", "Finish", "-1%", "-5%", "-10%", "+1%", "+5%", "+10%"], MENU_CHANNEL); } handle_message(integer channel, string name, key id, string message) { if (channel == CHAT_CHANNEL) { if (message == "resizer") { menu(); } else if (llSubStringIndex(message, "resizer") == 0) { list params = llParseString2List(message, [" "], [] ); if (llGetListLength(params) == 2) { string scale_param = llList2String(params, 1); if (llGetSubString(scale_param, -1, -1) == "%") { scale = (((float)llGetSubString(scale_param, 0, -2)) / 100); scale = max(scale, MIN_SCALE); process(FALSE); } } } } else if (channel == MENU_CHANNEL) { if (message == "Revert") { process(TRUE); menu(); } else if (message == "Finish") { finish(); } else if (llGetSubString(message, -1, -1) == "%") { scale = scale + (((float)llGetSubString(message, 0, -2)) / 100); scale = max(scale, MIN_SCALE); process(FALSE); menu(); } } } default { state_entry() { if (START_ON_TOUCH) { // we only want a touch_start handler if we're going to use it // so change state rather than just testing inside touch_start // for START_ON_TOUCH to be true. state start_on_touch; } else { llListen(CHAT_CHANNEL, "", llGetOwner(), ""); init_menu_channel(); llListen(MENU_CHANNEL, "", llGetOwner(), ""); llOwnerSay("Resizer Ready"); llOwnerSay("Type /" + (string)CHAT_CHANNEL + "resizer for menu."); } } on_rez(integer start_param) { llOwnerSay("Resizer Installed"); llOwnerSay("Type /" + (string)CHAT_CHANNEL + "resizer for menu."); } listen(integer channel, string name, key id, string message) { handle_message(channel, name, id, message); } } state start_on_touch { state_entry() { llListen(CHAT_CHANNEL, "", llGetOwner(), ""); init_menu_channel(); llListen(MENU_CHANNEL, "", llGetOwner(), ""); llOwnerSay("Resizer Ready"); llOwnerSay("Touch for resizer menu."); } on_rez(integer start_param) { llOwnerSay("Resizer Installed"); llOwnerSay("Touch for resizer menu."); } listen(integer channel, string name, key id, string message) { handle_message(channel, name, id, message); } touch_start(integer num_detected) { menu(); } }
  6. Thank you, although it's the long process this is exactly what I was looking for! I was able to easily adapt it into what I already had, play with variables and get it to work exactly how I wanted it! Feel free to contact me in game to see the finished result!
  7. Do you think you could refer any to me?
  8. Hey guys, I'm building a bell, and I'm no good with rotation atall. I'm looking for a pivot rotation script like this one: http://www.free-lsl-scripts.com/freescripts.plx?ID=1180 This one id great, other then you have to click it in order for it to stop rocking. Does anybody know how to stop it rocking? Maybe put it on a timer or a certain amount of rotations? Thanks, Gruff
  9. Haha, well basically what I'm TYRING to do, is this. If i say /44 name (message), it changes the object name to the (message) Make sence?
  10. Update, let me show you what i have so far: string ObjectName; string ShoutMessage; default { state_entry() { ////////////////////////////////////////////////////////////////////// ObjectName = "*>gG<* Raid'N'Trade Alarm Bell"; ShoutMessage = "The Amarm Has Been Rung!"; //Leave these, these will be used when the script is reset to defaults. ////////////////////////////////////////////////////////////////////// llListen(44,"",llGetOwner(),""); } listen(integer channel, string name, key id, string message) { if (message==name + "") { llSetObjectName(""); } } }
  11. Hey guys, basically I'm a really basic scripter, but learning! Let me tell you a little about what i'm making, it's an alarm that when clicked, makes a sound, shouts a messege ect. Now i was looking for a way to give this out copy only, so the item would be no mod. The only problem with this is I intended this to be a personal item, like for a specific company our group. Say a group named 'Warscar Outlaws' had the alarm, I'd want them to have the option to customise it a little. Instead of the standard name and message, let's for this instance say it's name is 'Alarm' and it's message is 'The alarm has been rung!', I'd want them to have their own thing, like 'Warscar Alarm' for the name and 'Somebody has rung the dreaded Warscar alarm!'. The way around this, I thought, would be to include an llSetObjectName and have it so that the listener detected the message on a certain channel. I thought about having the channels for the message and the name different, however it would be more professional if it was say /44 name (object name here) for the name, and /44 message (message here) for the message. I've done this before on an unaccessable account (with help), so i know it IS possible. I seem to be struggling with taking the message from what's said, as I'm also having problems with a simple thing such as resetting. (I want the script to pick up when /44 reset is said, then it will reset the script and return it to it's default name and message, i already have this part, i just can't get it to reset on command!) Mostly I'm having trouble with the listener, any help would be great! Thanks in advance!
×
×
  • Create New...