テキスト
ラベルを表示する llSetText(string text, vector color, float alpha)
llSetText("TEST01\nTEST02",<1.0,0.0,0.0>,1.0);
- text 表示する文字
- color 文字色
- alpha 透明度(0~1で0で見えなくなる)
「Touch」の文字を変える llSetTouchText(string text)
- text 表示する文字
結構狭いので注意。9文字まで。それ以降は切れる。
「Sit Here」の文字を変える llSetSitText(string text)
- text 表示する文字
結構狭いので注意。9文字まで。それ以降は切れる。
テクスチャ
色を変える llSetColor(vector color, integer face)
llSetColor(<1,0,0>, ALL_SIDES);
- color 色
- face 変更面
テクスチャを変える llSetTexture(string texture, integer side)
llSetTexture("MyTexture",ALL_SIDES);
- texture テクスチャ名
- face 変更面
テクスチャを動かす
llSetTextureAnim(integer mode, integer side, integer x_frames, integer y_frames, float start, float length, float rate);
複雑なので、またあとで調査。
パーティクル
パーティクルを出す llParticleSystem(list parameters)
llParticleSystem([PSYS_PART_FLAGS, PSYS_PART_WIND_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_START_COLOR, <1,0,0>]);
- parameters パラメータ
複雑なので、またあとで調査。
在庫リスト(inventory)
オブジェクトを与える llGiveInventory(key destination, string inventory)
llGiveInventory(llDetectedKey(0), "TEST");
- destination 送り先のUUID
- inventory オブジェクト名
権限に注意。
不正利用されたくなければ、①コピー可/②転送不可にしておく。
※SLの方針で①②同時に不可にはできないが、転送不可にしておけばいくらコピーされてもOK。
UI/コミュニケーション
しゃべる
llWhisper(0, "Whisper");
llSay(0, "Say");
llShout(0, "Shout");
llOwnerSay("OwnerSay");
- channel チャネル
IMを送る llInstantMessage(key user, string message)
llInstantMessage(llGetOwner(), "CALL YOU!!");
- user アバターのUUID
- message メッセージ
ダイアログを表示する llDialog(key id, string message, list buttons, integer chat_channel)
llDialog(llDetectedKey(0), "Select one color from among these.", ["White","Black"], 19780419);
- id 対象のアバターのUUID
- message 表示するメッセージ
- buttons 選択肢
- chat_channel 結果を受け取るチャネル
聞き耳をたてる integer llListen(integer channel, string name, key id, string msg)
Handle = llListen(19780419, "", NULL_KEY, "");
- channel チャネル
- name アバター/オブジェクトの名前
- id アバター/オブジェクトのUUID
- msg 発したメッセージ
実際に聞くのはlistenイベントで処理する。
チャットは0チャネル、チャットで0以外のチャネルでしゃべるには「/19780419 発言」のように打つ。
聞き耳を終了する llListenRemove(integer number)
- number ハンドルID
移動
移動する llMapDestination(string sim_name, vector position, vector lookat)
llMapDestination( "Tiny Kingdom", <83, 18, 26>, <83, 18, 26>);
- sim_name SIM名
- position 位置
- lookat 使われていない(positionと同じにしておく?)
サウンド
再生する llPlaySound(string sound, float volume)
llPlaySound("MySound",1.0);
- sound サウンド名
- volume ボリューム(0~1)
事前読み込みする llPreloadSound(string sound)
llPreloadSound("MySound");
- sound サウンド名
ループ再生する llLoopSound(string sound, float volume)
llPlaySound("MySound",1.0);
- sound サウンド名
- volume ボリューム(0~1)
ループ再生を止める llStopSound()
決定/感知
所有者のUUIDを取得する key llGetOwner()
Handle = llListen(0, "", llGetOwner(), "");
感知したアバター/オブジェクトのUUIDを取得する key llDetectedKey(integer number)
llGiveInventory(llDetectedKey(0), "TEST");
- number インデックス
同時に発生しない限り0でよい。
以下のイベントで有効。
- タッチ touch,touch_start,touch_end
- 衝突 collision,collision_start,collision_end
- 感知 sensor
力学
回転させる llTargetOmega(vector axis, float spinrate, float gain)
llTargetOmega(<0,0,1>,PI,3); //180度/秒回転する
- axis 回転方向(基本絶対値1、このベクトルの絶対値は速さに影響するので注意。絶対値2なら2倍の速度)
- spinrate 回転速度(ラジアン/秒,2*PIが360度)
- gain 強さ
その他
URLを開く llLoadURL(key avatar_id, string message, string url)
確認ダイアログがでる。
llLoadURL(llDetectedKey(0), "Flame on!", "http://www.google.com/");
- avatar_id 対象のアバターのUUID
- message ダイアログに表示するメッセージ
- url URL
参考
良いもの
一覧系
Tips集
メモ
後で整理
最終更新:2008年11月01日 23:14