Difference between revisions of "LSL Protocol/RestrainedLoveAPI/ja"
Mako Nozaki (talk | contribs) (→コマンド一覧) |
Mako Nozaki (talk | contribs) (→コマンド一覧) |
||
Line 789: | Line 789: | ||
* ''''' | * '''''環境の設定の設定値を取得する''''' : @getenv_<setting>=<channel_number> | ||
'' | ''実装 v1.15'' | ||
ビューアに環境の設定の設定値を自動的に回答させ、<channel_number> で指定したチャネルにすぐに載せてスクリプトが拾えるようにします。常に正の値を使用してください。普通のビューアは何も回答しないことを念頭に、タイムアウトの後でリスナーを削除するようにしてください。復帰値は 対応する @setenv コマンドで <setting> パートにセットされた値か、手動で設定した値です。上述の設定内容一覧表を参照してください。<br /> | |||
注意: @getenv_daytime だけが RestrainedLove v1.15 以上が実装されている v1.19.0 までの (もしくはより古い、 例えば Windlight でない) ビューアでサポートされています。 | |||
==sendchat などのグローバルな挙動に関する重要な注意点== | ==sendchat などのグローバルな挙動に関する重要な注意点== |
Revision as of 03:22, 9 April 2010
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Restrained Love viewer v1.23 の仕様
みなさまへ
このドキュメントは、RestrainedLove viewerの機能を使用して独自のLSLスクリプトを作成したい方へ向けて書かれたものです。メッセージやイベントといったLSLの概念については説明していません。また、UUIDなどの普遍的な概念についても説明していません。
はじめに
RestrainedLove viewerは、インワールドのスクリプトから特定のメッセージを受け取ったときに、対応した動作をするものです。これらのメッセージは、ほとんどがllOwnerSay()と呼ばれるLSLの関数の呼び出しによって作成されます。
仕組み
RestrainedLove viewerは、ビューアに送信された全てのllOwnerSay メッセージを傍受します。アットマーク('@')で始まる行は、RLV のコマンドとして解釈されます。他の行は、通常通り、ローカルチャットに転送され、ユーザが見ることができます。例えば、llOwnerSay ("@detach=n") と呼び出すと、スクリプトを実行するオブジェクトが引数 n の detach コマンドをビューアに送信することと同じことになります。
メッセージの書式は次のようになります。
@<command1>[:option1]=<param1>,<command2>[:option2]=<param2>,...,<commandN>[:optionN]=<paramN>
'@'は、メッセージの先頭にただ一つだけ存在するようにしてください。ビューアはこれを「この llOwnerSay() メッセージの全文が、1つ以上の実行命令を含んでいる」と解釈します。記載上の都合により、コマンドは常に先頭に'@'がついた形で示されています。しかし、複数のコマンドを含むメッセージのそれぞれのコマンドの先頭に'@'をつけるのは誤りで、2個目以降のコマンドは正常に実行されません。
歴史的な注釈: 1.10 より前のバージョンでは、RLV は1つのメッセージにつきただ1つのコマンドだけを書くことができました。1.10 のバージョンで、RLV に対応していないビューアを使用しているユーザにメッセージをスパムすることにならないように、1つのメッセージに複数のコマンドを書くことができるようになりました。
少なくとも1つのコマンドの実行に失敗すると(例えばタイプミス)、ビューアは"... fails command : ... "というメッセージを出力し、全てのメッセージを表示します。しかし、正しいコマンドは解析と実行が行われ、誤っているものだけが無視されます。
コマンドの多くが、オブジェクトやアバターの次の「挙動」を規定します。例えば、@detach=n というコマンドは特定のオブジェクトにロックをかけ、取り外しできないようにします。コマンドの送信元オブジェクトに限定しない「グローバルな挙動」を規定するコマンドもあります。例えば、@sendchat=n というコマンドは、ユーザがローカルチャットで発言できないようにします。
注意 例外があるコマンド、例えば @sendim や @sendchannel などですが…。 @(rule):(exception)=n は正確には(かつ、単刀直入に言うと)既にあるルールに 例外を追加します 。例えば、@sendchannel:1=n はチャネル1での発言を 許可します。これは、スクリプターが陥る少なくとも2つの混乱の元となっていました。 =add (=n と同義) と =rem (=y と同義) は、それぞれ、例外の追加と削除のために存在します。こちらを使ってください。
Warning! | |
これらの挙動はセション間で引き継がれることは ありません 。オブジェクトの UUID は rez のたびに変わるため、オブジェクトの状態(取り外し不能、IM禁止など...)が変化したときにそうするように、オブジェクトは on_rez() イベントの中で状態を再送信 しなければなりません 。 |
コマンド一覧
注意: これらのコマンドは大文字小文字を区別しませんが、スペースは区別します。言い換えると、"@detach = n" は動作 しません 。
- Automated version checking : "@version=<channel_number>"
Implemented in v1.0b Makes the viewer automatically say its version immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout.
Warning : when logging in, the on_rez event of all the attachments occurs way before the avatar can actually send chat messages (about half the way through the login progress bar). This means the timeout should be long enough, like 30 seconds to one minute in order to receive the automatic reply from the viewer.
Warning 2 : On 02/22/2010, Linden Lab has released their Third Party Viewer policy which forbids using the term "Life" in the name of Third Party Viewers. Therefore "Restrained Life" had to be renamed to "Restrained Love". However, for compatibility purposes, this @version command still works and will keep working, however you are encouraged to not use it in new scripts, and to not show the terms "Restrained Life" to the user anywhere. For new scripts, please use @versionnew below instead.
- Automated version checking : "@versionnew=<channel_number>"
Implemented in v1.23 Makes the viewer automatically say its version immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout.
This command is the successor of @version and replaces it, although @version is kept for ascending compatibility purposes. It returns "RestrainedLove viewer v... (SL ...)" ("RestrainedLove" is in one word).
Warning : when logging in, the on_rez event of all the attachments occurs way before the avatar can actually send chat messages (about half the way through the login progress bar). This means the timeout should be long enough, like 30 seconds to one minute in order to receive the automatic reply from the viewer.
- Automated version number checking : "@versionnum=<channel_number>"
Implemented in v1.21 Makes the viewer automatically say its version number immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout. This command is less cumbersome than @version, since the script does not have to parse the response, it gets the version number immediately.
The version number is a mere integer that represents the version of the viewer. If the version is X.Y.Z.P, then the number will be X.10^6 + Y.10^4 + Z.10^2 + P. For example, 1.21.1 would be 1210100.
- Automated version checking, second way : llGetAgentLanguage (key id) DEPRECATED: DO NOT USE !
Implemented in v1.16 When calling this LSL function, the result is obtained immediately (no need to use a listener and a timer), is exactly equal to the one given by "@version" and cannot be hidden by the user. This string takes the place of the language returned by the regular SL viewer, which could answer values like "en-us", "fr", "ko" etc. Or nothing at all, if the user chose to hide their language setting. Being optional in the regular viewer, it cannot be trusted by a script, so "hijacking" this feature for the much more useful synchronous version checking in the RLV makes sense. IMPORTANT NOTE: this feature cannot be implemented in viewers prior to v1.21, even when they do implement RestrainedLove v1.16, so make sure you do fall back to the @version method whenever llGetAgentLanguage() returns an empty string. ALSO NOTE: In RestrainedLove 1.16, llGetAgentLanguage() will return an empty string when called by on_rez during login unless the call is delayed by several seconds (how many seconds may vary). FINAL NOTE: This feature was removed from v1.16.1 (and v1.16b, for the Cool SL Viewer).
- Manual version checking : "@version"
Implemented in v1.0a This command must be sent in IM from an avatar to the user (will not work from objects). The viewer automatically answers its version to the sender in IM, but neither the message nor the answer appears in the user's IM window, so it's totally stealthy.
- オブジェクトを取り外し可能/不可能にする : "@detach=<y/n>"
実装 v1.0a "n" オプションで呼ばれると、メッセージを送信したオブジェクト (アタッチメントである必要があります) は取り外し不可能となります。"y" オプションで呼ばれると、取り外し可能に戻ります。
- 装着ポイントをロック解除/ロックする : "@detach:<attach_point_name>=<y/n>"
実装 v1.20 "n" オプションで呼ばれると、<attach_point_name> で示された装着ポイントは、full (その時点でオブジェクトが装着されている) でも empty (装着されていない) でもロックされます。制約がかかった時点でそのポイントに装着されているオブジェクトは、取り外し不能とされます。これは、"@detach=n" コマンド自体が発行されたのとちょうど同じような感じです。装着ポイントが空であればその状態のままとなり、いかなるアイテムもそこに装着することができなくなり、llAttachToAvatar() が呼び出されると失敗するようになります (オブジェクトは装着されますが、すぐに取り外されます) 。
- 装着ポイントを empty でロック解除/ロックする : "@addattach[:<attach_point_name>]=<y/n>"
実装 v1.22 "n" オプションで呼ばれると、<attach_point_name> で示された装着ポイントは empty でロックされます。制約がかかった時点で装着ポイントに装着されているオブジェクトは取り外し可能ですが、そこに何も装着することができません。装着ポイントが空であればその状態のままとなり、いかなるアイテムもそこに装着することができなくなり、llAttachToAvatar() が呼び出されると失敗するようになります (オブジェクトは装着されますが、すぐに取り外されます) 。<attach_point_name> の指定がない場合、全ての装着ポイントに対して作用します。このコマンドは @addoutfit の片割れで、アタッチメントに対するものです。
- 装着ポイントを full でロック解除/ロックする : "@remattach[:<attach_point_name>]=<y/n>"
実装 v1.22 "n" オプションで呼ばれると、<attach_point_name> で示された装着ポイントは full でロックされます。制約がかかった時点でそのポイントに装着されているオブジェクトは、取り外し不能とされます。装着ポイントが空であればユーザは何かを装着することができますが、そのオブジェクトは取り外し不能となり、いかなるアイテムに取り替えることもできなくなり、llAttachToAvatar() が呼び出されると失敗するようになります (オブジェクトは装着されますが、すぐに取り外されます) 。<attach_point_name> の指定がない場合、全ての装着ポイントに対して作用します。このコマンドは @remoutfit の片割れで、アタッチメントに対するものです。
- Allow/deny the "Wear" contextual menu : "@defaultwear=<y/n>
Implemented in v1.21 When allowed, the user is always able to choose the "Wear"command on the contextual menu of the inventory, even when an object is locked on their avatar. This holds the risk of kicking that locked object, but it will be reattached automatically within 5 seconds (and successive locked objects every second until there is nothing left to reattach). However some objects may be scripted in a way that they drop their restrictions when detached, or simply not take into account the fact that even a locked object can be detached when using the RLV.
Therefore, using this command with the "n" option will suppress this comman, but it will still be available for objects that contain the target attachment point in their name or in the name of their parent folder, exactly like pre-1.21 RLV. This is a little less user-friendly but more secure when it comes to make sure no locked object may be detached accidentally.
- Start/stop notifications on a private channel : "@notify:<channel_number>[;word]=add/rem"
Implemented in v1.20 Makes the viewer automatically repeat any restriction it adds or removes on the specified channel, or only the restrictions which name contains the word specified after the semicolon (";") character. The response on the private channel <channel_number> is preceded with a slash ("/") to avoid making the avatar send commands to other scripts without knowing it, and followed by an equal sign ("=") and "n" or "y" according to whether the restriction is applied or lifted respectively. The "@clear" command will not add an equal sign. There is no way to know what object issued the restriction or lifted it, to avoid disclosing too much information about foreign scripts. It does not repeat one-shot commands either (force commands). For example, "@notify:2222;detach=add" will send "/detach=n" whenever an object is locked, and "/detach=y" whenever an object is unlocked, on channel 2222 to which the script will listen to.
- Allow/prevent sending chat messages : "@sendchat=<y/n>"
Implemented in v1.0b When prevented, everything typed on channel 0 will be discarded. However, emotes and messages beginning with a slash ('/') will go through, truncated to strings of 30 and 15 characters long respectively (likely to change later). Messages with special signs like ()"-*=_^ are prohibited, and will be discarded. When a period ('.') is present, the rest of the message is discarded.
- Remove/add an exception to the emote truncation above : "@emote=<rem/add>"
Implemented in v1.01 When adding this exception, the emotes are not truncated anymore (however, special signs will still discard the message).
- shout を許可する/しない : "@chatshout=<y/n>"
実装 v1.15 禁止されると、アバターが shout したときでも、通常の範囲のチャットとなります。メッセージを変更することは全くなく、範囲だけを変更します。
- 普通の声の大きさで話すことを許可する/しない : "@chatnormal=<y/n>"
実装 v1.15 禁止されると、アバターが普通にチャットしたときでも、whisper となります。メッセージを変更することは全くなく、範囲だけを変更します。
- whisper を許可する/しない : "@chatwhisper=<y/n>"
実装 v1.15 禁止されると、アバターが whisper したときでも、通常の範囲のチャットとなります。メッセージを変更することは全くなく、範囲だけを変更します。
- パブリックなチャットをプライベートチャネルにリダイレクトする : "@redirchat:<channel_number>=<rem/add>"
実装 v1.16 有効になると、この制約はパブリックチャネル ("/0") で話した内容を全てオプションで指定されたプライベートチャネルにリダイレクトします。複数の制約がかかると、チャットのメッセージはそれぞれのチャネルにリダイレクトされるようになります。これは emote には適用されず、話している時にアニメーション (タイプ開始、終了、うなずき) が実行されなくなります。この制約は @sendchannel に取って代わるものではありません。
- オープンな emote をプライベートチャネルにリダイレクトする : "@rediremote:<channel_number>=<rem/add>"
実装 v1.19 有効になると、この制約はブリックチャネル ("/0") で話した emote を全てオプションで指定されたプライベートチャネルにリダイレクトします。複数の制約がかかると、emote はそれぞれのチャネルにリダイレクトされるようになります。
- Allow/prevent sending instant messages : "@sendim=<y/n>"
Implemented in v1.0b When prevented, everything typed in IM will be discarded and a bogus message will be sent to the receiver instead.
- Allow/prevent sending instant messages, secure way : "@sendim_sec=<y/n>"
Implemented in v1.21 When prevented, everything typed in IM will be discarded and a bogus message will be sent to the receiver instead. This particular command accepts exceptions issued from the same object only, opposed to the non-secure way that accepts exceptions from any object.
- Remove/add exceptions to the instant message sending prevention : "@sendim:<UUID>=<rem/add>"
Implemented in v1.01 When adding an exception, the user can send IMs to the receiver whose UUID is specified in the command. This overrides the prevention for this avatar only (there is no limit to the number of exceptions), don't forget to remove it when it becomes obsolete.
- Allow/prevent receiving chat messages : "@recvchat=<y/n>"
Implemented in v1.0b When prevented, everything heard in public chat will be discarded except emotes.
- Allow/prevent receiving chat messages, secure way : "@recvchat_sec=<y/n>"
Implemented in v1.21 When prevented, everything heard in public chat will be discarded except emotes. This particular command accepts exceptions issued from the same object only, opposed to the non-secure way that accepts exceptions from any object.
- Remove/add exceptions to the chat message receiving prevention : "@recvchat:<UUID>=<rem/add>"
Implemented in v1.01 When adding an exception, the user can hear chat messages from the sender whose UUID is specified in the command. This overrides the prevention for this avatar only (there is no limit to the number of exceptions), don't forget to remove it when it becomes obsolete.
- Allow/prevent seeing emotes : "@recvemote=<y/n>"
Implemented in v1.19 When prevented, every emote seen in public chat will be discarded.
- Allow/prevent seeing emotes, secure way : "@recvemote_sec=<y/n>"
Implemented in v1.21 When prevented, every emote seen in public chat will be discarded. This particular command accepts exceptions issued from the same object only, opposed to the non-secure way that accepts exceptions from any object.
- Remove/add exceptions to the emote seeing prevention : "@recvemote:<UUID>=<rem/add>"
Implemented in v1.19 When adding an exception, the user can see emotes from the sender whose UUID is specified in the command. This overrides the prevention for this avatar only (there is no limit to the number of exceptions), don't forget to remove it when it becomes obsolete.
- Allow/prevent receiving instant messages : "@recvim=<y/n>"
Implemented in v1.0b When prevented, every incoming IM will be discarded and the sender will be notified that the user cannot read them.
- Allow/prevent receiving instant messages, secure way : "@recvim_sec=<y/n>"
Implemented in v1.21 When prevented, every incoming IM will be discarded and the sender will be notified that the user cannot read them. This particular command accepts exceptions issued from the same object only, opposed to the non-secure way that accepts exceptions from any object.
- Remove/add exceptions to the chat message receiving prevention : "@recvim:<UUID>=<rem/add>"
Implemented in v1.01 When adding an exception, the user can read instant messages from the sender whose UUID is specified in the command. This overrides the prevention for this avatar only (there is no limit to the number of exceptions), don't forget to remove it when it becomes obsolete.
- Allow/prevent teleporting to a landmark : "@tplm=<y/n>"
Implemented in v1.0 When prevented, the user cannot use a landmark, pick or any other preset location to teleport there.
- Allow/prevent teleporting to a location : "@tploc=<y/n>"
Implemented in v1.0 When prevented, the user cannot use teleport to a coordinate by using the map and such.
- Allow/prevent teleporting by a friend : "@tplure=<y/n>"
Implemented in v1.0 When prevented, the user automatically discards any teleport offer, and the avatar who initiated the offer is notified.
- Allow/prevent teleporting by a friend, secure way : "@tplure_sec=<y/n>"
Implemented in v1.21 When prevented, the user automatically discards any teleport offer, and the avatar who initiated the offer is notified. This particular command accepts exceptions issued from the same object only, opposed to the non-secure way that accepts exceptions from any object.
- Remove/add exceptions to the friend teleport prevention : "@tplure:<UUID>=<rem/add>"
Implemented in v1.0 When adding an exception, the user can be teleported by the avatar whose UUID is specified in the command. This overrides the prevention for this avatar only (there is no limit to the number of exceptions), don't forget to remove it when it becomes obsolete.
- Unlimit/limit sit-tp : "@sittp=<y/n>"
Implemented in v1.0 When limited, the avatar cannot sit on a prim unless it is closer than 1.5 m. This allows cages to be secure, preventing the avatar from warping its position through the walls (unless the prim is too close).
- Allow/deny permissive exceptions : "@permissive=<y/n>"
Implemented in v1.21 When denied, all restrictions turn into their "secure" counterparts (if any). This means an exception to a restriction will be ignored if it is not issued by the same object that issued the restriction. Using non-secure restrictions (the original ones, like @sendim, @recvim etc) and not using @permissive allow the avatar to benefit from exceptions issued by different objects.
Warning : Using this command (or any secure version of the original commands) may silently discard exceptions issued by different objects (it is even its primary purpose), hence some products may appear to cease working while this restriction is in effect. For example, a product that allows the avatar to always be able to send IMs a particular friend will not be able to overcome a @sendim_sec or a @permissive command sent by another object, and will look like it is broken. Therefore, use with caution and make the user aware of how secure your own product is !
- オブジェクトに紐づいた全てのルールを消去する : "@clear"
実装 v1.0a、ただし動作するのは v1.04a から このコマンド特定の UUID に紐づいた、全ての制約や例外を消去します。
警告 : デフォルトでデタッチの際に発動することになっていると、@defaultwear が有効の場合に自動的に再装着がされないことがあります。@clear は @detach=n 制約も解除してしまうので、そのアイテムが default-wear-action によってたまたまデタッチされてしまったとビューアが思い込み、再装着しなくなるからです。
考えられる回避方法:
- @clear=<pattern> で、追加した制約だけを解除する
- アタッチメントがロックされていないと確信できる場合にだけ、デタッチの際に @clear を発動させる
- @clear はどんな場合も発動させず、ビューアが制約を回収するまで待つ
- オブジェクトに紐づいた一部のルールを消去する : "@clear=<string>"
実装 v1.0a、ただし動作するのは v1.04a から このコマンド特定の UUID に紐づいた、<string> という名前をもつ制約や例外を消去します。良い例として、"@clear=tp" があります。これはオブジェクトに紐づいた全ての teleport 制約と例外を消去します。一方で、"@clear=tplure" は友人によるテレポートを許可しない制約のみを消去します。
- Allow/prevent editing objects : "@edit=<y/n>"
Implemented in v1.03 When prevented from editing and opening objects, the Build & Edit window will refuse to open.
- Allow/prevent rezzing inventory : "@rez=<y/n>"
Implemented in v1.03 When prevented from rezzing stuff, creating and deleting objects, drag-dropping from inventory and dropping attachments will fail.
- Allow/prevent wearing clothes : @addoutfit[:<part>]=<y/n>
Implemented in v1.10, added skin hair and eyes in v1.10.1 Where part is :
gloves|jacket|pants|shirt|shoes|skirt|socks|underpants|undershirt|skin|eyes|hair|shape
If part is not specified, prevents from wearing anything beyond what the avatar is already wearing.
- Allow/prevent removing clothes : @remoutfit[:<part>]=<y/n> (underpants and undershirt are kept for teens)
Implemented in v1.10, added skin hair and eyes in v1.10.1 Where part is :
gloves|jacket|pants|shirt|shoes|skirt|socks|underpants|undershirt|skin|eyes|hair|shape
If part is not specified, prevents from removing anything in what the avatar is wearing.
- Force removing clothes : @remoutfit[:<part>]=force (*) (teens can't be forced to remove underpants and undershirt)
Implemented in v1.10 Where part is :
gloves|jacket|pants|shirt|shoes|skirt|socks|underpants|undershirt|skin|eyes|hair|shape
If part is not specified, removes everything.
- Force removing attachments : @detach[:attachpt]=force (*)
Implemented in v1.10 Where part is :
chest|skull|left shoulder|right shoulder|left hand|right hand|left foot|right foot|spine| pelvis|mouth|chin|left ear|right ear|left eyeball|right eyeball|nose|r upper arm|r forearm| l upper arm|l forearm|right hip|r upper leg|r lower leg|left hip|l upper leg|l lower leg|stomach|left pec| right pec|center 2|top right|top|top left|center|bottom left|bottom|bottom right
If part is not specified, removes everything.
- Force removing attachments (alias) : @remattach[:attachpt]=force (*)
Implemented in v1.22 This command is an alias to @detach[:attachpt]=force (to keep things consistent).
- Get the list of worn clothes : @getoutfit[:part]=<channel_number>
Implemented in v1.10, added skin hair and eyes in v1.10.1 Makes the viewer automatically answer the current occupation of clothes layers as a list of 0s (empty) and 1s (occupied) immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout.
The list of 0s and 1s corresponds to :
gloves,jacket,pants,shirt,shoes,skirt,socks,underpants,undershirt,skin,eyes,hair,shape
in that order.
If a part is specified, answers a single 0 (empty) or 1 (occupied) corresponding to the part.
Ex 1 : @getoutfit=2222 => "0011000111" => avatar is wearing pants, shirt, underpants and undershirt, and of course a skin. Ex 2 : @getoutfit:socks=2222 => "0" => the avatar is not wearing socks.
- Get the list of worn attachments : @getattach[:attachpt]=<channel_number>
Implemented in v1.10 Makes the viewer automatically answer the current occupation of attachment points as a list of 0s (empty) and 1s (occupied) immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout.
The list of 0s and 1s corresponds to :
none,chest,skull,left shoulder,right shoulder,left hand,right hand,left foot,right foot,spine, pelvis,mouth,chin,left ear,right ear,left eyeball,right eyeball,nose,r upper arm,r forearm, l upper arm,l forearm,right hip,r upper leg,r lower leg,left hip,l upper leg,l lower leg,stomach,left pec, right pec,center 2,top right,top,top left,center,bottom left,bottom,bottom right
in that order.
If an attachment point is specified, answers a single 0 (empty) or 1 (occupied) corresponding to the point.
Ex 1 : @getattach=2222 => "011000011010000000000000100100000000101" => avatar is wearing attachments on chest, skull, left and right foot, pelvis, l and r lower leg, HUD bottom left and HUD bottom right. Ex 2 : @getattach:chest=2222 => "1" => avatar is wearing something on the chest.
Note : The first character ("none") is always '0', so the index of each attach point in the string is exactly equal to the corresponding ATTACH_* macro in LSL. For instance, the index 9 in the string is ATTACH_BACK (which means "spine"). Remember the indices start at zero.
- Force the viewer to automatically accept attach and take control permission requests : @acceptpermission=<rem/add>
Implemented in v1.16 Forces the avatar to automatically accept attach and take control permission requests. The dialog box doesn't even show up. This command does not supercede @denypermission, of course.
- Allow/prevent accepting attach and take control permissions : @denypermission=<rem/add>
Implemented in v1.16, DEPRECATED in v1.16.2 When prevented, all attach and take control permission requests are automatically declined, without even showing the dialog box. Due to the extreme annoyance it was making, and because locked objects automatically reattach themselves since v1.16.1, this command is NOW DEPRECATED, DON'T USE IT !
- Allow/prevent using inventory : @showinv=<y/n>
Implemented in v1.10 Forces the inventory windows to close and stay closed.
- Allow/prevent reading notecards : @viewnote=<y/n>
Implemented in v1.10 Prevents from opening notecards but does not close the ones already open.
- Allow/prevent opening scripts : @viewscript=<y/n>
Implemented in v1.22 Prevents from opening scripts but does not close the ones already open.
- Allow/prevent opening textures : @viewtexture=<y/n>
Implemented in v1.22 Prevents from opening textures (and snapshots) but does not close the ones already open.
- Allow/prevent standing up : @unsit=<y/n>
Implemented in v1.10, modified in v1.15 to prevent teleporting as well Hides the Stand up button. From v1.15 it also prevents teleporting, which was a way to stand up.
- Force sit on an object : @sit:<UUID>=force (*)
Implemented in v1.10 Does not work if the user is prevented from sit-tping and further than 1.5 meters away, or when prevented from unsitting.
- Force unsit : @unsit=force (*)
Implemented in v1.10 Self-explanatory but for some reason it randomly fails, so don't rely on it for now. Further testing is needed.
- Allow/prevent sitting down : @sit=<y/n>
Implemented in v1.16.2 Prevents the user from sitting on anything, including with @sit:UUID=force.
- Allow/prevent using any chat channel but certain channels : @sendchannel[:<channel>]=<y/n>
Implemented in v1.10 Complimentary of @sendchat, this command prevents the user from sending messages on non-public channels. If channel is specified, it becomes an exception to the aforementioned restriction. It does not prevent the viewer automatic replies like @version=nnnn, @getstatus=nnnn etc.
- Allow/prevent using any chat channel but certain channels, secure way : @sendchannel_sec[:<channel>]=<y/n>
Implemented in v1.10 Complimentary of @sendchat, this command prevents the user from sending messages on non-public channels. If channel is specified, it becomes an exception to the aforementioned restriction. It does not prevent the viewer automatic replies like @version=nnnn, @getstatus=nnnn etc. This particular command only accepts exceptions issued from the same object, opposed to its non-secure version which accepts exceptions from any other object.
- Get the list of restrictions the avatar is currently submitted to : @getstatus[:<part_of_rule>]=<channel>
Implemented in v1.10, slightly tweaked in v1.16 Makes the viewer automatically answer the list of rules the avatar is currently under, only for the object containing the script issuing that command, immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout. The answer is a list of rules, separated by slashes ('/'). Attention : since v1.16 a slash is prepended at the beginning of the string. This does not confuse llParseString2List() calls, but does confuse llParseStringKeepNulls() calls !
This command is useful for people who write scripts that may conflict with other scripts in the same object (for instance : third-party plugins). Conflicts do not occur in different objects, that's why this command only applies to the object calling it.
<part_of_rule> is the name of a rule, or a part of it, useful if the script only needs to know about a certain restriction.
Example : If the avatar is under tploc, tplure, tplm and sittp, here is what the script would get : @getstatus=2222 => tploc/tplure/tplm/sittp @getstatus:sittp=2222 => sittp @getstatus:tpl=2222 => tploc/tplure/tplm (because "tpl" is part of "tploc", "tplure" and "tplm" but not "sittp")
- Get the list of all the restrictions the avatar is currently submitted to : @getstatusall[:<part_of_rule>]=<channel>
Implemented in v1.15, slightly tweaked in v1.16 Makes the viewer automatically answer the list of rules the avatar is currently under, for all the objects regardless of their UUID, contrary to @getstatus, immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout. The answer is a list of rules, separated by slashes ('/'). Attention : since v1.16 a slash is prepended at the beginning of the string. This does not confuse llParseString2List() calls, but does confuse llParseStringKeepNulls() calls !
- Get the list of shared folders in the avatar's inventory : @getinv[:folder1/.../folderN]=<channel_number>
Implemented in v1.11, added sub-folders in v1.13 Makes the viewer automatically answer the list of folders contained into the folder named "#RLV" (if it exists), immediately on the chat channel number <channel_number> that the script can listen to. If folders are specified, it will give the list of sub-folders contained into the folder located at that path instead of the shared root (example : "@getinv:Restraints/Leather cuffs/Arms=2222"). Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout.
The answer is a list of names, separated by commas (","). Folders which names begin with a dot (".") will be ignored.
- Get the list of shared folders in the avatar's inventory, with information about worn items : @getinvworn[:folder1/.../folderN]=<channel_number>
Implemented in v1.15 Makes the viewer automatically answer the list of folders contained into the folder named "#RLV" (if it exists), immediately on the chat channel number <channel_number> that the script can listen to. If folders are specified, it will give the list of sub-folders contained into the folder located at that path instead of the shared root (example : "@getinvworn:Restraints/Leather cuffs/Arms=2222"). Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout.
The answer is a comma-separated list of names, each one followed with a pipe ("|") and two digits. The current folder is put in first position (as opposed to @getinv which does not show the current folder, obviously), but without a name, only the pipe and the two digits.
Object : "@getinvworn:Restraints/Leather cuffs=2222" Viewer : "|02,Arms|30,Legs|10"
Folders which names begin with a dot (".") will be ignored. The two digits are calculated as follows :
First digit : Proportion of items worn in the corresponding folder (including no-mod items). In this example, the "3" of "30" means "all the items in the "Arms" folder are currently worn, while the "1" of "10" means "no item in the Legs folder is currently worn, but there are items to wear".
Second digit : Proportion of items globally worn in all the folders contained inside the corresponding folder. In this example, the "2" of "02" means "some items are worn in some of the folders contained into "Leather cuffs".
The digits, comprised between 0 and 3 included, have the following meaning :
- 0 : No item is present in that folder
- 1 : Some items are present in that folder, but none of them is worn
- 2 : Some items are present in that folder, and some of them are worn
- 3 : Some items are present in that folder, and all of them are worn
- Get the path to a shared folder by giving a search criterion : @findfolder:part1[&&...&&partN]=<channel_number>
Implemented in v1.13.1 Makes the viewer automatically answer the path to the first shared folder which name contains <part1> and <part2> and ... and <partN>, immediately on the chat channel number <channel_number> that the script can listen to. The search is in depth first, notice the separator which is "&&" like "and". Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout. It does not take disabled folders into account (folders which name begins with a dot "."). The answer is a list of folders, separated by slashes ('/').
- Force attach items contained inside a shared folder : @attach:<folder1/.../folderN>=force (*)
Implemented in v1.11, added no-mod items in v1.12, added sub-folders in v1.13 Forces the viewer to attach every object and wear every piece of clothing contained inside the folder located at the specified path (which must be under "#RLV"). Objects names must contain the name of their target attachment point or they won't be attached. Each no-modify object must be contained inside a folder (one object per folder), which name contains the name of its target attachment point since it can't be renamed. Names cannot begin with a dot (".") since such folders are invisible to the scripts.
Attachment point names are the same as the ones contained into the "Attach To" submenu : "skull", "chest", "l forearm"...
Note : Folder names can contain slashes, and will be chosen in priority when able (for instance, if "@attach:Restraints/cuffs=force" is issued, the "Restraints/cuffs" folder will be chosen before a "cuffs" folder contained inside a "Restraints" parent folder.
- Force attach items contained inside a shared folder, and its children recursively : @attachall:<folder1/.../folderN>=force (*)
Implemented in v1.15 This command works exactly like @attach described hereabove, but also attaches whatever is contained into children folders.
- Force detach items contained inside a shared folder : @detach:<folder_name>=force (*)
Implemented in v1.11 Forces the viewer to detach every object and unwear every piece of clothing contained inside <folder_name>(which must be directly under "#RLV"). If "@detach" is used with an attachment point name (skull, pelvis... see above), it takes priority over this way of detaching since it is the same command.
- Force detach items contained inside a shared folder, and its children recursively : @detachall:<folder1/.../folderN>=force (*)
Implemented in v1.15 This command works exactly like @detach described hereabove, but also detaches whatever is contained into children folders.
- Get the path to the shared folder containing a particular object/clothing : @getpath[:<attachpt> or <clothing_layer>]=<channel_number>
Implemented in v1.16 Makes the viewer automatically answer the path to the shared folder containing the item that :
- issues this command if no option is set
- is attached on the attach point provided in the option field, ex : @getpath:spine=2222 => "Restraints/Collar"
- is worn on the clothing layer provided in the option field, ex : @getpath:pants=2222 => "Casual/Jeans/Tight"
Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout. It does not take disabled folders into account (folders which name begins with a dot "."). The answer is a list of folders, separated by slashes ('/').
- Force attach items contained into a shared folder that contains a particular object/clothing : @attachthis[:<attachpt> or <clothing_layer>]=force (*)
Implemented in v1.16 This command is a shortcut for a @getpath followed with an @attach command (this saves a listener and a timeout).
- Force attach items contained into a shared folder that contains a particular object/clothing, and its children folders : @attachallthis[:<attachpt> or <clothing_layer>]=force (*)
Implemented in v1.16 This command is a shortcut for a @getpath followed with an @attachall command (this saves a listener and a timeout).
- Force detach items contained into a shared folder that contains a particular object/clothing : @detachthis[:<attachpt> or <clothing_layer>]=force (*)
Implemented in v1.16 This command is a shortcut for a @getpath followed with a @detach command (this saves a listener and a timeout).
- Force detach items contained into a shared folder that contains a particular object/clothing, and its children folders : @detachallthis[:<attachpt> or <clothing_layer>]=force (*)
Implemented in v1.16 This command is a shortcut for a @getpath followed with a @detachall command (this saves a listener and a timeout).
- Force detach an item : @detachme=force (*)
Implemented in v1.16.2 This command forces the object that issues it to detach itself from the avatar. It is there as a convenience to avoid a race condition when calling @clear then llDetachFromAvatar(), sometimes the object could detach itself before clearing its restrictions, making it reattach automatically after a while. With this command one can issue a @clear,detachme=force to be sure @clear is executed first.
- Allow/prevent touching objects located further than 1.5 meters away from the avatar : @fartouch=<y/n>
Implemented in v1.11 When prevented, the avatar is unable to touch/grab objects from more than 1.5 m away, this command makes restraints more realistic since the avatar litterally has to press against the object in order to click on it.
- Allow/prevent viewing the world map : @showworldmap=<y/n>
Implemented in v1.11 When prevented, the avatar is unable to view the world map, and it closes if it is open when the restriction becomes active.
- Allow/prevent viewing the mini map : @showminimap=<y/n>
Implemented in v1.11 When prevented, the avatar is unable to view the mini map, and it closes if it is open when the restriction becomes active.
- Allow/prevent knowing the current location : @showloc=<y/n>
Implemented in v1.12 When prevented, the user is unable to know where they are : the world map is hidden, the parcel and region name on the top menubar are hidden, they can't create landmarks, nor buy the land, nor see what land they have just left after a teleport, nor see the location in the About box, and even system and object messages are obfuscated if they contain the name of the region and/or the name of the parcel. However, llOwnerSay calls are not obfuscated so radars will still work (and RL commands as well).
- Force-Teleport the user : @tpto:X/Y/Z=force (*)
Implemented in v1.12 This command forces the avatar to teleport to the indicated coordinates. Note that these coordinates are always global, hence the script that calls this command will not be trivial. Moreso, if the destination contains a telehub or a landing point, the user will land there instead of the desired point. This is a SL limitation. Also keep in mind that @tpto is inhibited by @tploc=n, and from v1.15 and above, by @unsit too.
Here is a sample code to call that command properly :
<lsl>
// FORCE TELEPORT EXAMPLE // Listens on channel 4 for local coordinates and a sim name // and tells your viewer to teleport you there. // // By Marine Kelley 2008-08-26 // RLV version required : 1.12 and above // // HOW TO USE : // * Create a script inside a box // * Overwrite the contents of the script with this one // * Wear the box // * Say the destination coords Region/X/Y/Z on channel 4 : // Example : /4 Help Island Public/128/128/50
key kRequestHandle; // UUID of the dataserver request vector vLocalPos; // local position extracted from the
Init () {
kRequestHandle = NULL_KEY; llListen (4, "", llGetOwner (), "");
}
default
{
state_entry () { Init (); } on_rez(integer start_param) { Init (); } listen(integer channel, string name, key id, string message) { list tokens = llParseString2List (message, ["/"], []); integer L = llGetListLength (tokens);
if (L==4) { // Extract local X, Y and Z vLocalPos.x = llList2Float (tokens, 1); vLocalPos.y = llList2Float (tokens, 2); vLocalPos.z = llList2Float (tokens, 3);
// Request info about the sim kRequestHandle=llRequestSimulatorData (llList2String (tokens, 0), DATA_SIM_POS); } } dataserver(key queryid, string data) { if (queryid == kRequestHandle) { // Parse the dataserver response (it is a vector cast to a string) list tokens = llParseString2List (data, ["<", ",", ">"], []); string pos_str = ""; vector global_pos;
// The coordinates given by the dataserver are the ones of the // South-West corner of this sim // => offset with the specified local coordinates global_pos.x = llList2Float (tokens, 0); global_pos.y = llList2Float (tokens, 1); global_pos.z = llList2Float (tokens, 2); global_pos += vLocalPos;
// Build the command pos_str = (string)((integer)global_pos.x) +"/"+(string)((integer)global_pos.y) +"/"+(string)((integer)global_pos.z); llOwnerSay ("Global position : "+(string)pos_str); // Debug purposes
// Fire ! llOwnerSay ("@tpto:"+pos_str+"=force"); } }
}
</lsl>
- Remove/add auto-accept teleport offers from a particular avatar : "@accepttp[:<UUID>]=<rem/add>"
Implemented in v1.15, slightly improved in v1.16 Adding this rule will make the user automatically accept any teleport offer from the avatar which key is <UUID>, exactly like if that avatar was a Linden (no confirmation box, no message, no Cancel button). This rule does not supercede nor deprecate @tpto because the former teleports to someone, while the latter teleports to an arbitrary location. Attention : in v1.16 the UUID becomes optional, which means that @accepttp=add will force the user to accept teleport offers from anyone ! Use with caution !
- Allow/prevent seeing the names of the people around : @shownames=<y/n>
Implemented in v1.12.2, added more dummy names in v1.16 When prevented, the user is unable to know who is around. The names don't show on the screen, the names on the chat are replaced by "dummy" names such as "Someone", "A resident", the tooltips are hidden, the pie menu is almost useless so the user can't get the profile directly etc.
- Allow/prevent seeing all the hovertexts : @showhovertextall=<y/n>
Implemented in v1.19 When prevented, the user is unable to read any hovertext (2D text floating above some prims).
- Allow/prevent seeing one hovertext in particular : @showhovertext:<UUID>=<y/n>
Implemented in v1.19 When prevented, the user is unable to read the hovertext floating above the prim which id is UUID. This is made that way so that the restriction can be issued on an object, by another one (unlike @detach which can only set this restriction on itself).
- Allow/prevent seeing the hovertexts on the HUD of the user : @showhovertexthud=<y/n>
Implemented in v1.19 When prevented, the user is unable to read any hovertext showing over their HUD objects, but will be able to see the ones in-world.
- Allow/prevent seeing the hovertexts in-world : @showhovertextworld=<y/n>
Implemented in v1.19 When prevented, the user is unable to read any hovertext showing over their in-world objects, but will be able to see the ones over their HUD.
- Allow/prevent flying : @fly=<y/n>
Implemented in v1.12.2 When prevented, the user is unable to fly.
- Get the UUID of the object the avatar is sitting on : @getsitid=<channel_number>
Implemented in v1.12.4 Makes the viewer automatically answer the UUID of the object the avatar is currently sitting on, or NULL_KEY if they are not sitting.
- Force rotate the avatar to a set direction : @setrot:<angle_in_radians>=force
Implemented in v1.17 Forces the avatar to rotate towards a direction set by an angle in radians from the north. Note that this command is not very precise, nor will do anything if the action attempts to rotate the avatar by less than 10° (experimental value, it has been mentioned somewhere that 6° was the minimum). In other words, it is best to either check with a llGetRot() first, or to make the avatar turn twice, first 180° plus the desired angle, then by the angle we need. It isn't very elegant but it works.
- Allow/prevent changing some debug settings : @setdebug=<y/n>
Implemented in v1.16 When prevented, the user is unable to change some viewer debug settings (Advanced > Debug Settings). As most debug settings are either useless or critical to the user's experience, a whitelist approach is taken : only a few debug settings are locked, the others are always available and untouched. At the time of this writing, the allowed debug settings are :
- AvatarSex (0 : Female, 1 : Male) : gender of the avatar at creation.
- RenderResolutionDivisor (1 -> ...) : "blurriness" of the screen. Combined to clever @setenv commands, can simulate nice effects. Note: renderresolutiondivisor is a Windlight only option (Basic Shaders must be enabled in graphics preferences) and as such, is not available in v1.19.0.5 or older viewers.
- Force change a debug setting : @setdebug_<setting>:<value>=force (*)
Implemented in v1.16 Forces the viewer to change a particular debug setting and set it to <value>. This command is actually a package of many sub-commands, that are regrouped under "@setdebug_...", for instance "@setdebug_avatarsex:0=force", "@setdebug_renderresolutiondivisor:64=force" etc.
See the list of allowed debug settings in the @setdebug command hereabove.
- Get the value of a debug setting : @getdebug_<setting>=<channel_number>
Implemented in v1.16 Makes the viewer automatically answer the value of a debug setting, immediately on the chat channel number <channel_number> that the script can listen to. Always use a positive integer. Remember that regular viewers do not answer anything at all so remove the listener after a timeout. The answer is the value that has been set with the <setting> part of the matching @setdebug command, or by hand.
See the list of allowed debug settings in the @setdebug command hereabove.
- Allow/prevent changing the environment settings : @setenv=<y/n>
Implemented in v1.14 When prevented, the user is unable to change the viewer environment settings (World > Environment Settings > Sunrise/Midday/Sunset/Midnight/Revert to region default/Environment editor are all locked out).
- Force change an environment setting : @setenv_<setting>:<value>=force (*)
Implemented in v1.14 Forces the viewer to change a particular environment setting (time of day or Windlight) and set it to <value>. This command is actually a package of many sub-commands, that are regrouped under "@setenv_...", for instance "@setenv_daytime:0.5=force", "@setenv_bluehorizonr:0.21=force" etc.
This command (like any other "force" command) is silently discarded if the corresponding restriction has been set, here "@setenv", but in this case the restriction is ignored if the change is issued from the object that has created it. In other words, a collar can restrict environment changes, yet force a change by itself, while another object could not do it until the collar lifts the restriction.
Although a range is specified for every value, no check is made in the viewer so a script can do what the UI can't do, for interesting effects. Use at your own risk, though. The ranges indicated here are merely the ones available on the sliders on the Environment Editor, for reference.
Each particular sub-command works as follows (the names are chosen to be as close to the Windlight panels of the viewer as possible) :
@setenv_XXX:<value>=force where XXX is... | <value> range | Sets... |
daytime | 0.0-1.0 and <0 | Time of day (sunrise:0.25, midday:0.567, sunset:0.75, midnight:0.0, set back to region default:<0). Attention, resets all other Windlight parameters |
preset | String | A Preset environment, e.g. Gelatto, Foggy. Attention, loading a Preset is heavy on the viewer and can slow it down for a short while, don't do it every second |
ambientr | 0.0-1.0 | Ambient light, Red channel |
ambientg | 0.0-1.0 | Ambient light, Green channel |
ambientb | 0.0-1.0 | Ambient light, Blue channel |
ambienti | 0.0-1.0 | Ambient light, Intensity |
bluedensityr | 0.0-1.0 | Blue Density, Red channel |
bluedensityg | 0.0-1.0 | Blue Density, Green channel |
bluedensityb | 0.0-1.0 | Blue Density, Blue channel |
bluedensityi | 0.0-1.0 | Blue Density, Intensity |
bluehorizonr | 0.0-1.0 | Blue Horizon, Red channel |
bluehorizong | 0.0-1.0 | Blue Horizon, Green channel |
bluehorizonb | 0.0-1.0 | Blue Horizon, Blue channel |
bluehorizoni | 0.0-1.0 | Blue Horizon, Intensity |
cloudcolorr | 0.0-1.0 | Cloud color, Red channel |
cloudcolorg | 0.0-1.0 | Cloud color, Green channel |
cloudcolorb | 0.0-1.0 | Cloud color, Blue channel |
cloudcolori | 0.0-1.0 | Cloud color, Intensity |
cloudcoverage | 0.0-1.0 | Cloud coverage |
cloudx | 0.0-1.0 | Cloud offset X |
cloudy | 0.0-1.0 | Cloud offset Y |
cloudd | 0.0-1.0 | Cloud density |
clouddetailx | 0.0-1.0 | Cloud detail X |
clouddetaily | 0.0-1.0 | Cloud detail Y |
clouddetaild | 0.0-1.0 | Cloud detail density |
cloudscale | 0.0-1.0 | Cloud scale |
cloudscrollx | 0.0-1.0 | Cloud scroll X |
cloudscrolly | 0.0-1.0 | Cloud scroll Y |
densitymultiplier | 0.0-0.9 | Density multiplier of the fog |
distancemultiplier | 0.0-100.0 | Distance multiplier of the fog |
eastangle | 0.0-1.0 | Position of the east, 0.0 is normal |
hazedensity | 0.0-1.0 | Density of the haze |
hazehorizon | 0.0-1.0 | Haze at the horizon |
maxaltitude | 0.0-4000.0 | Maximum altitude of the fog |
scenegamma | 0.0-10.0 | Overall gamma, 1.0 is normal |
starbrightness | 0.0-2.0 | Brightness of the stars |
sunglowfocus | 0.0-0.5 | Focus of the glow of the sun |
sunglowsize | 1.0-2.0 | Size of the glow of the sun |
sunmooncolorr | 0.0-1.0 | Sun and moon, Red channel |
sunmooncolorg | 0.0-1.0 | Sun and moon, Green channel |
sunmooncolorb | 0.0-1.0 | Sun and moon, Blue channel |
sunmooncolori | 0.0-1.0 | Sun and moon, Intensity |
sunmoonposition | 0.0-1.0 | Position of the sun/moon, different from "daytime", use this to set the apparent sunlight after loading a Preset |
Note: from the above settings, only the "daytime" one is supported by v1.19.0 (or older) viewers implementing RestrainedLove v1.14 and later. The other settings are ignored. This is because these viewers do not implement the Windlight renderer.
(*) Silently discarded if the user is prevented from doing so by the corresponding restriction. This is on purpose.
Ex : Force detach won't work if the object is undetachable. Force undress won't work if the user is prevented from undressing.
- 環境の設定の設定値を取得する : @getenv_<setting>=<channel_number>
実装 v1.15
ビューアに環境の設定の設定値を自動的に回答させ、<channel_number> で指定したチャネルにすぐに載せてスクリプトが拾えるようにします。常に正の値を使用してください。普通のビューアは何も回答しないことを念頭に、タイムアウトの後でリスナーを削除するようにしてください。復帰値は 対応する @setenv コマンドで <setting> パートにセットされた値か、手動で設定した値です。上述の設定内容一覧表を参照してください。
注意: @getenv_daytime だけが RestrainedLove v1.15 以上が実装されている v1.19.0 までの (もしくはより古い、 例えば Windlight でない) ビューアでサポートされています。
sendchat などのグローバルな挙動に関する重要な注意点
挙動がグローバルである、というのは、それが特定のオブジェクトに依存しないことを意味します。しかしながら、これらは可変の UUID が設定されているオブジェクトから引き起こされるものです。複数のオブジェクトが同じ挙動を追加することができます。これらは、UUID が異なることから、複数回にわたって格納されることになります。
これには嬉しい副作用があります。チャットを禁止する2つの装置を装着しているときは、両方の装置のロックを解除しないとチャットを再開することができません。しかしこれにはいやらしい副作用もあります。(例えばrezし直されたりして)アイテムの UUID が変更され、そのアイテムがチャットを許可する設定となっていなかった場合、ユーザは少しの間待たなければなりません。これは、ガベージ・コレクタ が回収するまでの間、そのルールは「不明」(UUID が現存しない)のまま残るからです。
注意:1.16.1 から、オブジェクトにロックをかけると、どのようにしてロックをかけたかに関わらず(例えばllAttachToAvatar)、そのオブジェクトは必ず 5 秒後にビューアによって自動的に再装着されます。つまり、デタッチの際に @clear を呼び出すと、確かにオブジェクトのロックは解除されますが、再装着後に再びロックをかける必要があります。このため、デタッチの際に @clear を呼び出すことは、1.16.1 より前のバージョンとは反対に、今では推奨されません。
共有フォルダ
バージョン 1.11 から、ビューアはインワールドのスクリプトと一部のアイテムを「共有」し、強制的に着脱させたり、共有しているものをリストで表示したりすることができるようになりました。
「共有」というのは、他の人が欲しいときにそのアイテムを持っていくという意味ではなく(譲渡不能のアイテムもあるわけですから)、単に、他の人が自由自在に、アイテムを持つ本人に対する制約が含まれたスクリプトを通じて、それらの着脱を強制させることができるという意味です。これらのアイテムはインベントリに残ります。
やり方:
- 「#RLV」という名前のフォルダを「My Inventory」直下に作成します(「My Inventory」を右クリックして「新しいフォルダ」を選択)。これを以降の手順では「共有フォルダ」と呼びます。
- 制約が含まれるフォルダや、その他装着するものを新しく作成したフォルダの直下に移動します。
- あとは、フォルダの中のものを装着するだけです!
すると、このようなフォルダ構成になります。
My Inventory |- #RLV | |- cuffs | | |- left cuff (l forearm) (no copy) | | \- right cuff (r forearm) (no copy) | \- gag | \- gag (mouth) (no copy) |- Animations |- Body Parts . . .
例:RR Straps という名前の一式を持っている場合、「Straps BOXED」フォルダを共有フォルダ直下にとりあえず移動します。
移動したフォルダ(1度に1個のフォルダです!)の中のアイテムを全部装着するか、自分で変名して、それぞれのアイテムの名前が装着ポイントの名前を含むようにします。例えば、「left cuff (l forearm)」、「right ankle cuff (r lower leg)」のようにします。編集不能なアイテムを共有するのはちょっと難しいので注意してください。人の手でもビューアでも名前を書き換えることができないからです。これについては後ほど説明します。
装着ポイント名はインベントリのメニューの中の「装着先」から調べることができます。大文字小文字は関係ありません (例:"chest", "skull", "stomach", "left ear", "r upper arm"...)。アイテムを装着したときに、変名されていなければ最初に自動的に変名されます。ただし、共有フォルダの中にあり、装着ポイント名が含まれておらず、編集可能なアイテムに限ります。もし他の装着ポイントに装着したい場合は、まず手で変名する必要があります。
服のパーツはまったく同じように扱われます(それどころか、制約フォルダに置け、同じコマンドで装着することができます)。例えば靴は、混在したアウトフィットの良い例となります。いくつかの装着パーツとレイヤ靴で構成されています。服は自動的に変名されることはありません。服のタイプと装着ポイントが対応しているからです (skirt, jacket, undershirt...)。
編集不能アイテムを共有する方法: 既に説明しましたが、編集不能アイテムは変名できないため、少し複雑な方法となります。アウトフィットのフォルダ (例えば上のフォルダ構成例だと"cuffs"という名前) にサブフォルダを作成し、そこに編集不能なアイテムを 1 つだけ入れます。そのアイテムを装着すると、フォルダが変名されていることに気づくでしょう。つまり、アウトフィットの中に複数の編集不能アイテムが入っている場合、同じ数のフォルダを作成し、1 つのフォルダに 1 個ずつ編集不能のアイテムを入れていくことになります。
例えば、編集不能の靴の場合はこうなります。
My Inventory |- #RLV | \- shoes | |- left shoe (left foot) | | \- left shoe (no modify) (no transfer) <-- no-mod object | |- right shoe (right foot) | | \- right shoe (no modify) (no transfer) <-- no-mod object | \- shoe base (no modify) (no transfer) <-- this is not an object |- Animations |- Body Parts . . .
バッドノウハウ:
- 共有フォルダの中のフォルダの名前にカンマ (',') を含めないでください。フォルダの中がめちゃくちゃになる可能性があります。
- 共有フォルダの中のアイテムは、必ず変名(するか、少なくとも一回は装着して自動的に変名されるように)してください。そうしないと、強制装着コマンドが何もしていないように見えることになります。
- 共有フォルダにたくさんのフォルダを詰め込まないようにしてください。スクリプトによっては、@getinv コマンドで一覧を取得し、それを使って処理をするものがありますが、チャットによるメッセージは最大1023文字の制限があります。賢く選んで、短い名前をつけてください。しかし、平均 9 文字の名前であれば、約 100 フォルダまでもつことができます。
- ビューアが名前を頼りにどこに装着するかを判断できるようにするために、編集不能なアイテムは必ず1つずつサブフォルダに入れてください。これらのアイテムは変名不能のため、編集可能なアイテムと同じようには共有できません。また、アウトフィットのフォルダ自体は (複数のアイテムが入っているため) 変名されません。
llGiveInventoryList() によって送られたサブフォルダの共有フォルダへの受け入れ :
RestrainedLove v1.16.2 より、あなたはターゲットのアバターにアイテム一式を送り、相手の #RLV フォルダの中のサブフォルダとして持たせることができます(それにより、後でそのアイテムを @attach させることができます)。
llGiveInventoryList(victim_id, "#RLV/~subfolder_name", list_of_stuff) コマンドを発行すると、スクリプトは相手(victim_id と同じキーをもつアバター)のビューアに通常の 受け取る/破棄/無視リスト ダイアログを表示します。
相手がオファーを受け入れると、list_of_stuff で指定されたアイテムが #RLV フォルダの中の新しいサブフォルダに格納されます。このサブフォルダの名前は ~subfolder_name で指定された名前となります(スクリプターには、一意となるようなサブフォルダの名前を指定する義務があります。既にあるサブフォルダの名前と同じであった場合、2 つの同じ名前のサブフォルダが #RLV フォルダに現れることになります)。
チルダ文字はサブフォルダの先頭に *必ず* つけるように留意してください (そうすることで、この方法で送られて来たサブフォルダを相手が見つけやすくなりますし、そのようなサブフォルダの名前は #RLV フォルダの中の最後尾に表示されます) 。
また、この機能は (Debug Setting の RestrainedLoveForbidGiveToRLV を TRUE に設定することで) ユーザが無効にできることにも注意してください。このような場合、#RLV フォルダの中には格納されず、インベントリのルート直下の"#RLV/~subfolder_name"という名前のフォルダの中に格納されます。
ユーザがインベントリのオファーを断ることも、ビューアで機能を無効にすることも、ラグのひどい日には SL がオブジェクトの実際の送信に時間がかかることもあることから、@attach コマンドを発行する前に、送信されたフォルダが存在するかどうかを (@getinv で) 確認しなければなりません。
参考情報
ここに、これが内部的にどのように動作するかを記します。あなたが遭遇するかもしれない暗黙仕様への理解を深めるのに役立つでしょう。
- それぞれのコマンドは Behaviour (例: "remoutfit")、Option (例: "shirt")、Param (例: "force") に解析され、UUID (発信しているオブジェクトのユニークなID) から届きます。
- コマンドには 2 種類あります。one-shot コマンド (Param が "force" であり、Param が "version" 呼び出しのチャネル番号のような番号であるもの) と、 rules コマンド (Param が "y"、"n"、"add"、"rem" のいずれか) 。 "clear" は特別ですが、one-shot コマンドとして捉えることができます。
- "n" と "add" は まったく同じ で、まったく同じように 扱われます。これらは単なる シノニム です。同じようなことが "y" と "rem" にも言えます。ルール ("sendchannel=n") と例外 ("sendchannel:8=add") をスクリプトの中ではっきり区別するためだけのものです。
- ルールは、発生元の UUID をルールそのものに関連付けた形でテーブルに蓄積されます。"n"/"add" の Param を受信すると 追加 され、"y"/"rem" の Param を受信すると 削除 されます。
UUID1 が首輪で UUID2 が猿ぐつわだとします。
UUID1 => detach, tploc, tplm, tplure, sittp
UUID2 => detach, sendim, sendim:(keyholder)
これらの 2 つのルールは、ユーザは keyholder 以外のアバターに IM を送信できず、どこにも TP ができないという意味になります。これらの 2 つのアイテムは取り外しできません。ここで、首輪が "@sendim=n" を送信したとすると、テーブルは以下のようになります。
UUID1 => detach, tploc, tplm, tplure, sittp, sendim
UUID2 => detach, sendim, sendim:(keyholder)
"@sendim=n" を 2 回目に送信すると何も起りません。追加する前に既に存在するかチェックがかかるからです。猿ぐつわのロックが解除され取り外されると、"@clear" が送信されるかガベージ・コレクタが開始されるかするため、UUID2 に関連づいたルールは消滅します。ところが、例外まで消滅してしまっため、アバターは keyholder にさえも IM を送信できない状態のままとなります。オブジェクトに関連付けられたルールは、他のオブジェクトに関連付けられたルールに矛盾しないからです。
- One-shot コマンドは、これとは逆に、オンザフライで実行され、蓄積されません。
- ログオンすると、プログレスバーが表示されている間、アバターはしばらく操作できない (チャットできない、移動できない) 状態となります。しかし、装着されているスクリプトの入ったオブジェクトはその間に rez して、ビューアが操作可能な状態になる前にルールとコマンドの送信を開始します。このために、ビューアはそれらを貯めておき、ユーザが操作可能な状態 (プログレスバーが消えたとき) になってはじめてそれらを実行します。