2008年6月12日木曜日

Online Checker

共同作品なのでソースはまだ公開できませんが
(あ、わたしのだめだめなやつでもいいか・・・w( ゚∀゚)・∵. ガハッ!)

最初考えてた
流れはこんな感じです。

物を出す
rez object

オブジェクトのownerのUUIDをとる
get object owner's UUID

UUIDからオンラインだった場合、オンラインじゃない場合
セットテキストで表示。
If avater is online or offline-->use llSetText

タッチで呼鈴機能(オーナーがその場にいなくてもIMで通知する機能)
when someone is touched,objects send IM to object owner


これに、関数を肉付けしていって実際φ(`д´)カキカキしてみました。

で、作っていく過程でこんな現象が起きました。
オンラインのときは
when i was online...
「pipinpa Allen is online」
て表示されるのに、

オフラインになると
when i was offline...
「is offline」

ΩΩΩ名前抜けてるーΩΩΩ
lost my name!!!!
うーん、とあれこれ考えていて、なんとまぁってことを理解

the source of the trouble
Q: How do I get the owner's name instead?
A: If the owner is in the same sim as the object at the time it's called,
(IE, if your script is within an attachment) use llKey2Name. Otherwise,
you need to use llRequestAgentData and the dataserver event,
which takes longer and is more complicated.

LSLwikiより


To retrieve the owners name while the owner is in the region use llKey2Name,
llRequestAgentData should be used when the owner is not in the region.
LSLportalより

つまり、llGetOwnerでとってきたキーをllKey2Nameで変換するときは、アバターが同じSIMにいるかオンラインであるときでしか使えませんと。
それ以外は、llGetAgentDataで名前をとってきてくれとw
そういうオチでした。

初歩的かもしれないけど、実際自分でつくって検証してってやるとよーくわかります。
一緒にスクリプトを書いていた人もおもしろいねぇといいながらわいわい一緒に検証してました。

0 件のコメント: