Jump to content

HorizontalEight

New Resident
  • Posts

    6
  • Joined

  • Last visited

Reputation

2 Neutral

Recent Profile Visitors

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

  1. I think i will just have the item say to the avatar how far you are from them. What i have got the balls to do is simple. I touch one and it sends the second ball it's object details. Then the second ball announces it's details and the first ball's details. I am working on getting the ball to turn the string to a vector then do the math and round it to the nearest meter then say it. Green Ball script named 'transmitter' // Transmitter.lsl // Channel for communication integer CHANNEL = 42; default { touch_start(integer total_number) { // Get details of the transmitter object string objectName = llGetObjectName(); key objectKey = llGetKey(); vector objectPosition = llGetPos(); rotation objectRotation = llGetRot(); // Convert the details into a string string details = "Object Name: " + objectName + "\n" + "Object Key: " + (string)objectKey + "\n" + "Object Position: " + (string)objectPosition + "\n" + "Object Rotation: " + (string)objectRotation; // Send the details to the receiver llRegionSay(CHANNEL, details); } } Red ball labeled - receiver // Receiver.lsl // Channel for communication integer CHANNEL = 42; default { state_entry() { // Listen for messages on the channel llListen(CHANNEL, "", NULL_KEY, ""); } listen(integer channel, string name, key id, string message) { // Get details of the receiver object string objectName = llGetObjectName(); key objectKey = llGetKey(); vector objectPosition = llGetPos(); rotation objectRotation = llGetRot(); // Convert the details into a string string details = "Receiver Object Name: " + objectName + "\n" + "Receiver Object Key: " + (string)objectKey + "\n" + "Receiver Object Position: " + (string)objectPosition + "\n" + "Receiver Object Rotation: " + (string)objectRotation + "\n" + "Transmitter Object Details:\n" + message; // Say both the details in chat llSay(0, details); } }
  2. This is for like small pve combat so I think the 16 items will be not enough. XD I have seen this done in objects in the game. They just did it when you dropped the items from your inventory. It is frustrating as I can't find them sold or mentioned.
  3. We see all the radars that pick up plugins. Not sure how they do it. However they don't need the UUID to do it each time.
  4. I thought the global variable would fix that. I guess it did not. thanks!
  5. I tried to make two scripts that measured the distance between the two and then announced it local chat after you touched it. I did try global variables. Now I get Red Ball not found in inventory despite the scripts being named properly. Green Ball // Green Ball Script // Constants integer CHANNEL = -12345; // Channel for communication string REQUEST_MESSAGE = "MeasureDistance"; // Message sent to red ball to request distance measurement // Variables vector redBallPos; // Position of the red ball default { state_entry() { // Set hover text llSetText("Touch me to measure the distance to the red ball", <0, 1, 0>, 1.0); } touch_start(integer total_number) { // Find red ball key redBall = llGetInventoryKey("RedBall"); if(redBall != NULL_KEY) { // Request distance measurement from red ball llRegionSayTo(redBall, CHANNEL, REQUEST_MESSAGE); } else { // Announce error if red ball not found llOwnerSay("Error: Red ball not found in inventory."); } } // Listen for responses from the red ball listen(integer channel, string name, key id, string message) { // Parse distance from message integer distance; if (llStringLength(message) > 0) { distance = llRound((float)message); // Announce distance in nearby chat llSay(0, "Distance to red ball: " + (string)distance + " meters."); } else { // Announce error if message is empty llOwnerSay("Error: Received empty message from red ball."); } } } Then the second ball is // Red Ball Script // Constants integer CHANNEL = -12345; // Channel for communication // Variables vector greenBallPos; // Position of the green ball default { state_entry() { // Initialize listen event llListen(CHANNEL, "", NULL_KEY, ""); } // Listen for messages from green ball listen(integer channel, string name, key id, string message) { // Get the position of the green ball greenBallPos = llGetPos(); // Calculate distance integer distance = llRound(llVecDist(greenBallPos, llGetPos())); // Send distance to green ball llRegionSay(channel, (string)distance); } } I don't know why my balls aren't working.
  6. So I am just wanting to create a menu for my friend as she runs some PVE combat. It takes forever for her to set it up. I wanted to have it where she can use the script touch each one and change some numbers. then when damage is taken, she can touch it and reduce the HP by the damage without having to worry much. I am note very good of a coder but i really thought this would be a nice thing for her. // Constants for menu options integer MENU_OPTION_ADD_NAME = 1; integer MENU_OPTION_ADD_HP = 2; integer MENU_OPTION_ADD_SOAK = 3; integer MENU_OPTION_ADD_CHASE_DODGE = 4; integer MENU_OPTION_ADD_PERCEPTION = 5; integer MENU_OPTION_ADD_RESISTANCE = 6; integer MENU_OPTION_ADD_WILLPOWER = 7; integer MENU_OPTION_CHANGE_COLOR = 8; integer MENU_OPTION_ADD_SOAKABLE_DAMAGE = 9; integer MENU_OPTION_ADD_NON_SOAK_DAMAGE = 10; // Default hover text string defaultHoverText = "Name: Default\nHealth: 12\nSoak: 2\nChase/Dodge: 15\nPerception: 13\nResistance: 15\nWillpower: 4"; vector defaultColor = <1.0, 1.0, 1.0>; // Default text color is white // Variables to store current values string currentName = "Default"; integer currentHP = 12; integer currentSoak = 2; integer currentChaseDodge = 15; integer currentPerception = 13; integer currentResistance = 15; integer currentWillpower = 4; vector currentColor = defaultColor; // Main script default { state_entry() { // Set initial hover text and color llSetText(defaultHoverText, defaultColor, 1.0); // Generate unique menu channel based on object UUID menuChannel = (integer)("0x" + llGetSubString((string)llGetKey(), 0, 6)); // Set up menu llListen(menuChannel, "", NULL_KEY, ""); } touch_start(integer total_number) { // Open menu when touched llDialog(llDetectedKey(0), "Select an option:", ["Add Name", "Add HP", "Add Soak", "Add Chase/Dodge", "Add Perception", "Add Resistance", "Add Willpower", "Change Color", "Add Soakable Damage", "Add Non-Soak Damage"], menuChannel); } // Listen for menu choices listen(integer channel, string name, key id, string message) { if (channel != menuChannel) return; if (message == "Add Name") { llOwnerSay("Please type the name you want to add:"); } else if (message == "Add HP") { llOwnerSay("Please type the HP value you want to add:"); } else if (message == "Add Soak") { llOwnerSay("Please type the Soak value you want to add:"); } else if (message == "Add Chase/Dodge") { llOwnerSay("Please type the Chase/Dodge value you want to add:"); } else if (message == "Add Perception") { llOwnerSay("Please type the Perception value you want to add:"); } else if (message == "Add Resistance") { llOwnerSay("Please type the Resistance value you want to add:"); } else if (message == "Add Willpower") { llOwnerSay("Please type the Willpower value you want to add:"); } else if (message == "Change Color") { llDialog(llDetectedKey(0), "Select a color:", ["Red", "Yellow", "Green"], menuChannel); } else if (message == "Add Soakable Damage") { llOwnerSay("Please type the amount of soakable damage:"); } else if (message == "Add Non-Soak Damage") { llOwnerSay("Please type the amount of non-soak damage:"); } } // Listen for typed responses changed(integer change) { if (change & CHANGED_OWNER) { string response = llGetOwnerSay(); if (llSubStringIndex(response, "Please type the name") != -1) { currentName = llStringTrim(llGetSubString(response, 7, -1), STRING_TRIM); } else if (llSubStringIndex(response, "Please type the HP") != -1) { currentHP += (integer)response; } else if (llSubStringIndex(response, "Please type the Soak") != -1) { currentSoak += (integer)response; } else if (llSubStringIndex(response, "Please type the Chase/Dodge") != -1) { currentChaseDodge += (integer)response; } else if (llSubStringIndex(response, "Please type the Perception") != -1) { currentPerception += (integer)response; } else if (llSubStringIndex(response, "Please type the Resistance") != -1) { currentResistance += (integer)response; } else if (llSubStringIndex(response, "Please type the Willpower") != -1) { currentWillpower += (integer)response; } else if (response == "Red") { currentColor = <1.0, 0.0, 0.0>; // Red color } else if (response == "Yellow") { currentColor = <1.0, 1.0, 0.0>; // Yellow color } else if (response == "Green") { currentColor = <0.0, 1.0, 0.0>; // Green color } else if (llSubStringIndex(response, "Please type the amount of soakable damage") != -1) { integer damage = (integer)response; currentHP -= llMax(0, damage - currentSoak); } else if (llSubStringIndex(response, "Please type the amount of non-soak damage") != -1) { currentHP -= llMax(0, (integer)response); } // Update hover text string hoverText = llDumpList2String([llDumpList2String(["Name: ", currentName]), llDumpList2String(["Health: ", (string)currentHP]), llDumpList2String(["Soak: ", (string)currentSoak]), llDumpList2String(["Chase/Dodge: ", (string)currentChaseDodge]), llDumpList2String(["Perception: ", (string)currentPerception]), llDumpList2String(["Resistance: ", (string)currentResistance]), llDumpList2String(["Willpower: ", (string)currentWillpower])], "\n"); llSetText(hoverText, currentColor, 1.0); } } }
×
×
  • Create New...