|
jamieparsons Lemon
undergrad n00b
Join date: 5 Nov 2008
Posts: 36
|
12-03-2008 23:19
I posted a thread a couple of hours ago thinking it was a state that wasn't starting but it was a loop that compiles fine but goes on to do nothing.
{code} state tail { state_entry(){ // I entered a test code in here and it worked fine. for(a = 2; a < 14; a+=1) // 'a' is an integer and is used to set the prim number { llSetLinkColor(a, <255,255,255>, ALL_SIDES); llSetLinkColor(a, <247,255,0>, ALL_SIDES); llSleep(t); } state default; } }
{/code}
After fiddling around for a while I've noticed that the 2nd llSetLinkColor does not execute... all in all still completely useless. This feels like it should be really simple but It's just not happening :/
Anybody see any faults in the code above? Really getting frustrated with this now so help would be greatly appreciated.
I've tried using message link to another script containing this, I've tried executing a function that contains this script to no avail :/
|
|
jamieparsons Lemon
undergrad n00b
Join date: 5 Nov 2008
Posts: 36
|
12-04-2008 00:00
still don't know what I did wrong but I kept trying different combinations of things and it's finally working after 3 hours hehe. Thanks for everyones help in my posts  much appreciated.
|
|
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
12-04-2008 00:12
Two things. First, I am not sure the difference between the two colours is obvious enough to see the change (I couldn't when I got it working in world) but second, and more important, the delays inherent in llSetLinkColor are causing you problems; This certainly works: default { state_entry() { // llSay(0, "Hello, Avatar!"); }
touch_start(integer total_number) { integer a; for ( a==2; a<14; a++) { llSetLinkColor(a, <1,0,0>, ALL_SIDES);; llSleep(0.2); llSetLinkColor(a, <1,1,1>, ALL_SIDES); llSleep(0.2); } } }
Well, at least each prim turns red briefly and then white. You need, though, to have the first llSleep there. Hope this helps.
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
12-04-2008 02:48
From: someone for ( a==2; a<14; a++) You might want to change the initialiser to "a = 2". 
|
|
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
12-04-2008 07:14
Yikes.. in correcting one typo (in my comment) I introduced another.. yep a = 2
|