Difference between revisions of "LlReplaceAgentEnvironment/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
 
Line 1: Line 1:
{{LSL_Function/ja
{{LSL_Function/ja
|func=llReplaceAgentEnvironment
|func=llReplaceAgentEnvironment
|func_desc=The llReplaceAgentEnvironment function overrides the current region and parcel environment seen by an agent. The new environment persists until the agent crosses to a new region or this function is called with the NULL_KEY or empty string in the environment parameter for the particular agent, doing so will strip all environmental settings applied to this agent as part of the experience. This function must be executed as part of an experience.
|func_desc=llReplaceAgentEnvironment関数は、エージェントが見る現在のリージョンおよびパーセル環境を上書きします。新しい環境は、エージェントが新しいリージョンに移動するか、この関数が特定のエージェントの環境パラメータにNULL_KEYまたは空の文字列を使用して呼び出されるまで持続します。この場合、エクスペリエンスの一環としてこのエージェントに適用されたすべての環境設定が剥奪されます。この関数はエクスペリエンスの一部として実行する必要があります。
|return_type=Integer
|return_type=Integer
|p1_type=key|p1_name=agent_id|p1_desc=The key for an agent in the region. The agent must be in the region and must be participating in the experience.
|p1_type=key|p1_name=agent_id|p1_desc=リージョン内のエージェントのキー。エージェントはリージョンに存在し、エクスペリエンスに参加している必要があります。
|p2_type=float|p2_name=transition|p2_desc=The number of seconds over which to transition to the new settings.
|p2_type=float|p2_name=transition|p2_desc=新しい設定に遷移する秒数。
|p3_type=string|p3_name=environment|p3_desc=The name of an environmental setting in the object's inventory or the asset ID for an environment.
|p3_type=string|p3_name=environment|p3_desc=オブジェクトのインベントリ内の環境設定の名前または環境のアセットID。
|constants=
|constants=
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}}
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}}
{{!}}+ '''Return Values'''
{{!}}+ '''戻り値'''
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}
!Value
!
!Constant
!定数
!Description
!説明
{{!}}-
{{!}}-
{{!}} {{!!}} 1 {{!!}} The agent has been instructed to change their environment.
{{!}} {{!!}} 1 {{!!}} エージェントに新しい環境への変更が指示されました。
{{!}}-
{{!}}-
{{!}} ENV_NOT_EXPERIENCE {{!!}} -1 {{!!}}The script is not running as part of an experience with a valid experience key.
{{!}} ENV_NOT_EXPERIENCE {{!!}} -1 {{!!}}スクリプトが有効なエクスペリエンスキーを持つエクスペリエンスの一部として実行されていません。
{{!}}-
{{!}}-
{{!}} ENV_NO_EXPERIENCE_PERMISSION {{!!}} -2 {{!!}} The agent has not granted permission.
{{!}} ENV_NO_EXPERIENCE_PERMISSION {{!!}} -2 {{!!}} エージェントが許可を付与していません。
{{!}}-
{{!}}-
{{!}} ENV_NO_ENVIRONMENT {{!!}} -3 {{!!}} The environment inventory object could not be found.
{{!}} ENV_NO_ENVIRONMENT {{!!}} -3 {{!!}} 環境インベントリオブジェクトが見つかりませんでした。
{{!}}-
{{!}}-
{{!}} ENV_INVALID_AGENT {{!!}} -4 {{!!}} Unable to find specified agent.
{{!}} ENV_INVALID_AGENT {{!!}} -4 {{!!}} 指定されたエージェントを見つけることができません。
{{!}}-
{{!}}-
{{!}} ENV_NO_EXPERIENCE_LAND {{!!}} -7 {{!!}} The experience has not been enabled or can not run on the land.
{{!}} ENV_NO_EXPERIENCE_LAND {{!!}} -7 {{!!}} エクスペリエンスが有効になっていないか、土地で実行できません。
{{!}}-
{{!}}-
{{!}} ENV_THROTTLE {{!!}} -8 {{!!}} The scripts have exceeded the throttle.  Wait and retry the request.
{{!}} ENV_THROTTLE {{!!}} -8 {{!!}} スクリプトがスロットルを超えました。 待機してからリクエストを再試行してください。
{{!}}}
{{!}}}
|caveats=
|caveats=
* The agent's viewer may choose to ignore this command.
* エージェントのビューアはこのコマンドを無視する可能性があります。
* An environment set locally on the viewer will override any environment set from this function.
* ビューアでローカルに設定された環境は、この関数から設定された環境を上書きします。
* If a UUID is passed as the environment parameter and that UUID does not specify an environment setting, the viewer quietly ignores the instruction.
* 環境パラメータとしてUUIDが渡され、そのUUIDが環境設定を指定していない場合、ビューアは静かに指示を無視します。
|examples=<source lang="lsl2">
|examples=<source lang="lsl2">
string gEnvironment = "A-12AM"; // Can be asset's name in object's inventory or the asset ID
string gEnvironment = "A-12AM"; // Can be asset's name in object's inventory or the asset ID
Line 71: Line 71:
</source>
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llSetAgentEnvironment]]|}}
|also_functions={{LSL DefineRow||[[llSetAgentEnvironment/ja]]|}}
{{LSL DefineRow||[[llGetEnvironment]]|}}
{{LSL DefineRow||[[llGetEnvironment/ja]]|}}
|notes
|notes
}}
}}

Latest revision as of 14:25, 22 November 2023

要約

関数: Integer llReplaceAgentEnvironment( key agent_id, float transition, string environment );

llReplaceAgentEnvironment関数は、エージェントが見る現在のリージョンおよびパーセル環境を上書きします。新しい環境は、エージェントが新しいリージョンに移動するか、この関数が特定のエージェントの環境パラメータにNULL_KEYまたは空の文字列を使用して呼び出されるまで持続します。この場合、エクスペリエンスの一環としてこのエージェントに適用されたすべての環境設定が剥奪されます。この関数はエクスペリエンスの一部として実行する必要があります。
Integer で返します。

• key agent_id リージョン内のエージェントのキー。エージェントはリージョンに存在し、エクスペリエンスに参加している必要があります。
• float transition 新しい設定に遷移する秒数。
• string environment オブジェクトのインベントリ内の環境設定の名前または環境のアセットID。

戻り値
定数 説明
1 エージェントに新しい環境への変更が指示されました。
ENV_NOT_EXPERIENCE -1 スクリプトが有効なエクスペリエンスキーを持つエクスペリエンスの一部として実行されていません。
ENV_NO_EXPERIENCE_PERMISSION -2 エージェントが許可を付与していません。
ENV_NO_ENVIRONMENT -3 環境インベントリオブジェクトが見つかりませんでした。
ENV_INVALID_AGENT -4 指定されたエージェントを見つけることができません。
ENV_NO_EXPERIENCE_LAND -7 エクスペリエンスが有効になっていないか、土地で実行できません。
ENV_THROTTLE -8 スクリプトがスロットルを超えました。 待機してからリクエストを再試行してください。

警告

  • エージェントのビューアはこのコマンドを無視する可能性があります。
  • ビューアでローカルに設定された環境は、この関数から設定された環境を上書きします。
  • 環境パラメータとしてUUIDが渡され、そのUUIDが環境設定を指定していない場合、ビューアは静かに指示を無視します。
All Issues ~ Search JIRA for related Bugs

サンプル

string gEnvironment = "A-12AM"; // Can be asset's name in object's inventory or the asset ID
float gTransitionTime = 3.0;

default
{
    touch_start(integer total_number)
    {
        key person = llDetectedKey(0);
        if (llGetAgentSize(person) != ZERO_VECTOR)
        {
            llRequestExperiencePermissions(person, "");
        }
        else
        {
            llInstantMessage(person, "You need to be in the same region to change environment");
        }
    }

    experience_permissions(key agent_id)
    {
        integer envTest = llReplaceAgentEnvironment(agent_id, gTransitionTime, gEnvironment);
        if (envTest == 1)
        {
            llRegionSayTo(agent_id, 0, "Applying environment for " + (string)agent_id);
        }
        else
        {
            llRegionSayTo(agent_id, 0, "Cannot apply environment for " + (string)agent_id + " due to reason id: " + (string)envTest);
        }
    }

    experience_permissions_denied(key agent_id, integer reason)
    {
        llRegionSayTo(agent_id, 0, "Denied experience permissions for " + (string)agent_id + " due to reason id: " + (string)reason);
    }
}

関連項目

特記事項

Search JIRA for related Issues

Signature

function Integer llReplaceAgentEnvironment( key agent_id, float transition, string environment );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。