Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Now for the finishing touches

Mako Davidson
Registered User
Join date: 27 Jun 2006
Posts: 56
06-22-2007 08:26
Firstly thankyou to everyone who gave me the advice i needed to finish this project (almost)... :)

What i'm trying to do is have an object I'm wearing on one body part open a dialogue box when touched, that tells a separate object on another body part something. ie change alphas. is there a way to do this using a dialogue box???

i know how to change the alphas, i just don't know how to do it by a different objects dialogue box.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
06-22-2007 08:31
Have the Controller object (with the dialog menu) llWhisper on an obscure channel (something in the negative range works good), which the other object listens to.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-22-2007 08:34
Well, the dialog box could be an interface, but the scripts in the different objects will have to have llSetAlpha() and/or llSetLinkAlpha() to control transparency of the different parts of the different attachments. And whatever script is controlling it all will need to llWhisper() on some channel to the other scripts, which must be llListen()ing for the commands to change their alphas.
Mako Davidson
Registered User
Join date: 27 Jun 2006
Posts: 56
how about this one
06-22-2007 08:49
thankyou once again i'll give it a try. i don't suppose i could get the lines of script i would need please for the listen on a set channel because i'm a noob :) , also is there some kind of guide to go by to where you should have all your brackets n stuff. ie how many tabs stops they should be, i'm trying to neaten things up.
Mako Davidson
Registered User
Join date: 27 Jun 2006
Posts: 56
oh no lets go crazy
06-22-2007 09:36
he he sorry just had to throw that in. anyway got the listens set up fine so need to help with the script lines, but still is there some guide as to how to format scripts correctly ie tab stops for if statements etc.
Jake Trenchard
Registered User
Join date: 31 May 2007
Posts: 104
06-22-2007 09:55
It's in the LSL wiki somewhere, but, like this. In a really hard to read adaptation to a no-tags-available forum. Regardless of how nicely you format in-game or in your editor, the forum will flatten the results. There's a variation in style where the braces are not on the same line as the flow control statements, but I prefer compact code.

// say hello on script reset
default {
<tab>state_entry() {
<tab><tab>if(1 == 1) {
<tab><tab><tab>llSay(0,"Hello, world!";);
<tab><tab>} else {
<tab><tab><tab>llSay(0,"Error: 1 is not 1!";);
<tab><tab>}
<tab>}
}
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
06-22-2007 09:57
Basically every time you add a new beginning curly bracket {, indent one more level.

In this example, I'll be using [tab] to represent a tab since formatting isnt working correctly on the forums currently.

default {

[tab] // Everything in the default state is indented once

[tab]state_entry() {

[tab][tab]// Everything in the state_entry is indented twice
[tab][tab]integer x = true;
[tab][tab]if (x) {

[tab][tab][tab]// Everything in the if statement is indented three times
[tab][tab][tab]integer 1;
[tab][tab][tab]for (i = 0; i < 10; i++) {

[tab][tab][tab][tab]// 4 levels of indent for the for statement

[tab][tab][tab][tab]llSetAlpha(i * 10);

[tab][tab][tab]} // Matches the for loop
[tab][tab]} // Matches the if statement
[tab]}// Matches the state_entry()
} // matches the default state


//////// End code /////////
Mako Davidson
Registered User
Join date: 27 Jun 2006
Posts: 56
06-22-2007 09:58
thankyou kindly Jake
Mako Davidson
Registered User
Join date: 27 Jun 2006
Posts: 56
06-22-2007 09:59
and milambus