I am not a scripter. However, I've tried to create one to change a black and White image to a color image when any avatar comes within 3 meters of the image. So, far, I've had little luck and I'm not quite sure where I'm screwing it up.
The script and the two images are in the object, "BW Image" and "Color Image." The BW image is the default the color comes "alive" as someone approaches. Naming them didn't work so I went back to a generic "Inventory_Texture" calling llGetInventoryName for the choice and then setting it with llSetTexture But still erroring out. Here is what I have so far.
integer number;
string name;
integer choice = 0;
default
{
touch_start(integer total_number)
{
llSensor("", NULL_KEY, AGENT, 3.0, PI/2);
}
sensor( integer detected )
{
while(detected--)
{
number = llGetInventoryNumber(INVENTORY_TEXTURE);
}
{
if (choice < number)
{
name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != "")
llSetTexture(name, ALL_SIDES);
choice = choice + 1;
}
else
{
name = llGetInventoryName
(INVENTORY_TEXTURE, choice);
if (name != "")
llSetTexture(name, ALL_SIDES);
choice = 0;
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY)
{
llResetScript();
}
}
}
Currently this results in a syntax error at line 35 where the image is "changed." Not sure if this should just be "changed inventory" or not.
Any suggestions welcome.
Scripting errors (not Kitely's, mine)
- Michael Timeless
- Posts: 113
- Joined: Thu Sep 24, 2015 5:13 am
- Location: Crestwood, Illinois
- Has thanked: 393 times
- Been thanked: 153 times
- Contact:
Scripting errors (not Kitely's, mine)
- These users thanked the author Michael Timeless for the post:
- Ilan Tochner
- Ilan Tochner
- Posts: 6726
- Joined: Sun Dec 23, 2012 8:44 am
- Has thanked: 5248 times
- Been thanked: 4674 times
- Contact:
Re: Scripting errors (not Kitely's, mine)
Hi Michael,
The lack of indentation in your code makes it very hard to read it. Please use the "</>" button I. The forums editor and.copy.paste your code I to the code block with its original indentation. Also, as we can't tell what line 35 is without counting please quote the exact error message you're getting.
The lack of indentation in your code makes it very hard to read it. Please use the "</>" button I. The forums editor and.copy.paste your code I to the code block with its original indentation. Also, as we can't tell what line 35 is without counting please quote the exact error message you're getting.
- These users thanked the author Ilan Tochner for the post:
- Michael Timeless
- Michael Timeless
- Posts: 113
- Joined: Thu Sep 24, 2015 5:13 am
- Location: Crestwood, Illinois
- Has thanked: 393 times
- Been thanked: 153 times
- Contact:
Re: Scripting errors (not Kitely's, mine)
Ilan
Thanks for the quick response to my mess. Tess Juel came to the rescue and was able to sort it all out. She is going to post the entire script because it may be helpful to others as well. I always enjoy the helpful hands that everyone here extends when help is needed. Thanks Tess and Ilan.
Mike
Thanks for the quick response to my mess. Tess Juel came to the rescue and was able to sort it all out. She is going to post the entire script because it may be helpful to others as well. I always enjoy the helpful hands that everyone here extends when help is needed. Thanks Tess and Ilan.
Mike
- Tess Juel
- Posts: 406
- Joined: Sun Sep 11, 2016 4:24 pm
- Has thanked: 324 times
- Been thanked: 515 times
Re: Scripting errors (not Kitely's, mine)
And here it isMichael Timeless wrote: ↑Thu Aug 19, 2021 4:08 pmShe is going to post the entire script because it may be helpful to others as well.
- These users thanked the author Tess Juel for the post (total 2):
- Ilan Tochner • Michael Timeless