2009年09月18日
カラーとテクスチャ両方をダイアログで指定
はじめましてm(_ _)mペコリ
最近になってLSLをやり始めてるんですけども…
リンクオブジェのカラーと、テクスチャをダイアログで変えれる様に書いてみたんですが…
個々に組み込むとちゃんと変わってくれるのですが、一緒に組み込むと、テクスチャはいいのですが、カラーの方がエラーを出してしまいます><;
良い解決法が有ったら、是非教えて頂きたく、投稿させてもらいましたm(_ _)mペコリ
ちなみに、↓のScriptを使っています。宜しくお願いします。
~~Collar Change Script~~
*親プリム*
list colors = [
"red", "green","blue",
"yellow", "pink","orange", "purple",
"grey","white","black"
];
list rgb = [
<1.0,0.0,0.0>, <0.0,1.0,0.0>, <0.0,0.5,1.0>,
<1.0,1.0,0.0>,
<1.0,0.3,0.6>, <0.936,0.504,0.0586>, <0.652,0.340,0.656>,
<0.5,0.5,0.5>, <1.0,1.0,1.0>, ZERO_VECTOR
];
integer handle;
integer channel=7;
default{
touch_start(integer detected){
if (llDetectedKey(0) == llGetOwner()){
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);
}
}
}
*子プリム*
default {
link_message(integer sender_num, integer num,
string str, key id){
vector c = (vector)str;
llSetColor(c, ALL_SIDES);
}
}
~~Texture Change Script~~
*親プリム*
list Texture =
[
"BlackLeather","BrownLeather","white"
];
integer Handle;
default
{
touch_start(integer detected){
if (llDetectedKey(0) == llGetOwner()){
Handle = llListen(123, "", llGetOwner(), "");
llDialog(llGetOwner(), "Select texture", Texture, 123);}
}
listen(integer channel, string name, key id, string message)
{
llSetTexture(message,ALL_SIDES);
llSetLinkTexture(LINK_SET,message,ALL_SIDES);
llListenRemove(Handle);
}
}
*子プリム*
default
{
link_message(integer sender_num, integer num, string msg, key id)
{
llSetTexture(msg,ALL_SIDES);
}
}
Textureは、ダイアログボタンの名前と、Inventoryに入れてるファイルの名前は同じにしてます。
*エラーメッセージ*
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<0.00000, 0.50000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<0.00000, 0.50000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<0.00000, 1.00000, 0.00000>'.
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<0.65200, 0.34000, 0.65600>'.
最近になってLSLをやり始めてるんですけども…
リンクオブジェのカラーと、テクスチャをダイアログで変えれる様に書いてみたんですが…
個々に組み込むとちゃんと変わってくれるのですが、一緒に組み込むと、テクスチャはいいのですが、カラーの方がエラーを出してしまいます><;
良い解決法が有ったら、是非教えて頂きたく、投稿させてもらいましたm(_ _)mペコリ
ちなみに、↓のScriptを使っています。宜しくお願いします。
~~Collar Change Script~~
*親プリム*
list colors = [
"red", "green","blue",
"yellow", "pink","orange", "purple",
"grey","white","black"
];
list rgb = [
<1.0,0.0,0.0>, <0.0,1.0,0.0>, <0.0,0.5,1.0>,
<1.0,1.0,0.0>,
<1.0,0.3,0.6>, <0.936,0.504,0.0586>, <0.652,0.340,0.656>,
<0.5,0.5,0.5>, <1.0,1.0,1.0>, ZERO_VECTOR
];
integer handle;
integer channel=7;
default{
touch_start(integer detected){
if (llDetectedKey(0) == llGetOwner()){
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);
}
}
}
*子プリム*
default {
link_message(integer sender_num, integer num,
string str, key id){
vector c = (vector)str;
llSetColor(c, ALL_SIDES);
}
}
~~Texture Change Script~~
*親プリム*
list Texture =
[
"BlackLeather","BrownLeather","white"
];
integer Handle;
default
{
touch_start(integer detected){
if (llDetectedKey(0) == llGetOwner()){
Handle = llListen(123, "", llGetOwner(), "");
llDialog(llGetOwner(), "Select texture", Texture, 123);}
}
listen(integer channel, string name, key id, string message)
{
llSetTexture(message,ALL_SIDES);
llSetLinkTexture(LINK_SET,message,ALL_SIDES);
llListenRemove(Handle);
}
}
*子プリム*
default
{
link_message(integer sender_num, integer num, string msg, key id)
{
llSetTexture(msg,ALL_SIDES);
}
}
Textureは、ダイアログボタンの名前と、Inventoryに入れてるファイルの名前は同じにしてます。
*エラーメッセージ*
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<0.00000, 0.50000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<0.00000, 0.50000, 1.00000>'.
Object: Could not find texture '<1.00000, 1.00000, 1.00000>'.
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<0.00000, 1.00000, 0.00000>'.
Object: Could not find texture '<0.00000, 0.00000, 0.00000>'.
Object: Could not find texture '<0.65200, 0.34000, 0.65600>'.