![]() The inventory item is specified by the function llGetInventoryName (type, number) The avatar is found by the function llDetectedKey(0) – that looks for the key of the avatar that touched the box There are 3 functions used here that are nested into each other: The next 2 events that take place is giving the landmark and the notecard. If we want the box to whisper we would use llWhisper(channel,text) and if we want the box to shout we use llShout(channel,text) ![]() Than the function could have looked like this: String WText = “Thank you for requesting this this information” If we would have had a variable in the header like this: You see that the text of the message that is said in the open chat is directly typed in the function. Line 20 has the function llSay(channel, text) Text in channel 0 can be read in the chat, it could have been replaced by the constant PUBLIC_CHANNEL. From this point in the script it is going to describe what will happen after touching. When someone touches the box/landmarkgiver something will happen. Now over to the action! In line 18 you see touch_start. LlSetText(“Click for a landmark and a notecard”,1) If this script would not have listed those variables in the header of the script it should now have looked like this: The reason for using these variables gets more clear now it is much easier to change the variables in the header of a -long- script than to look for it in the script itself. In this script you see that the function calls the variables we saw in the first 12 lines of the script. This is the function that gives your landmarkgiver a hover text. When a script is compiled, reset or loaded, this is the state it enters by default. Together with state_entry() on line 14 this marks the beginning of the script. Line 12 – Most scripts sit idle until they receive some input, or detect some change in their environment. Line 6 has the variable for the alpha of the hover text. Every color has its own coordinates for instance: On line 4you see Color followed by the RGB coordinates. If you don’t want to see any text hovering, you could take away the text, but leaving the quotation marks Between the quotation marks you see the text that will later float over your box or landmarkgiver. HText in this script is short for HoverText. Line 2 starts with a string called HText. The first lines set some variables that make it easier to read and modify the script. ![]() How we can make text orange so it will be ignored by the script, I will explain later for now it is enough to recognize it. ![]() This orange text is actually not part of the script and could be taken away without changing the working of the script. This often contains the credit to the writer of this script plus some instructions on how to use or to change. You see that the first lines have some instruction in orange text. (don’t forget to save the script in your inventory!) The first 10 lines Save the script and rename the script to landmark notecard giver. Open this new script and replace the default text by the text from the notepad you have downloaded. You can download the script here. In Second Life create a box > go to the content tab > Hit the button New Script. I am going to explain this script so everybody can change this to their own use. Although this is considered to be a very simple script I know that there are people that shiver at the thought they would need to change something in it. Note: Objects using these scripts may not follow avatars across sim or parcel boundaries if land settings do not permit Object Entry or are set to a different group.In the image you see the complete script open in the script editor of the Firestorm viewer. These settings are adjusted in the script itself, near the top. You can adjust the timer between scans that update the object's placement, the offset in relation to avatar, and the range in which the object will scan for avatar. Objects will return home when a user logs out of object, teleports away, or goes offline. Three of these versions will go back to their "Home" position when finished, which is the location where they were before they started following. This set includes four versions of the Follow Script. Scripts are all: Modify / Copy / Transferīuy on Marketplace | Purchase in Second Life Please do not resell or give away scripts on their own. Scripts in this set can be used in your commercial products. These scripts use non-physical movement and do not require physics to be on in your sim, and they will work at any elevation. They float above the user's head by default but can be edited to follow in relation to the avatar in other ways as well. They can follow the owner, a group member that touches, or anyone that touches. These scripts allow an object to follow an avatar by floating above their head as they move around.
0 Comments
Leave a Reply. |