建築に役立つスクリプトを紹介していくコーナーです。
今回はタッチで色をチェンジするスクリプトです。ダイヤログ形式にしてみました。
list colors = ["Pink", "OrangePink","pealOrenge","babyPink", "babyOrangePink","babyyellow","Tarcoiz","Orenge", "Purple","Crimson","Bisque","black"];list rgb = [<1.0,0.6,0.8>, <1.0,0.6,0.6>, <1.0,0.6,0.4>,<1.0,0.8,0.8>, <1.0,0.8,0.6>, <1.0,0.8,0.4>,<0.2,0.6,0.8>, <1.0,0.5,0.0>, <0.4,0.4,0.8>,<0.86,0.078,0.235>, <1.0,0.89,0.76>, ZERO_VECTOR];integer handle;integer channel=7;integer counter=0;default{touch_start(integer detected){if (llDetectedKey(0) == llGetOwner()){counter=0;}}touch(integer detected){if (llDetectedKey(0) == llGetOwner()){if (counter <>counter ++;}else if (counter == 20){counter ++;handle=llListen(channel, "", llGetOwner(), "");llDialog(llGetOwner(),"Select Color",colors,channel);llSetTimerEvent(60.0);}}}timer(){llSetTimerEvent(0.0);llWhisper(0,"Time out! Touch again for change color.");llListenRemove(handle);}listen(integer ch, string name, key id, string msg){llSetTimerEvent(0.0);llListenRemove(handle);integer i = llListFindList(colors, [msg]);if (i != -1){vector c = llList2Vector(rgb,i);llSetColor(c, ALL_SIDES);llMessageLinked(LINK_SET, 0, (string)c, NULL_KEY);}}}
スクリプトを写すのが面倒な人は、こちらでも配布しています。ムービーに出てくるのと同じ箱をBuyしてね。0L$です。
人魚神殿 きょうた書房
0 コメント:
コメントを投稿