Difference between revisions of "LlCreateCharacter/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{LSL_Function/ja
{{LSL_Function/ja
|func=llCreateCharacter
|func=llCreateCharacter
|func_desc=Creates a pathfinding entity, known as a "character", from the object containing the script.  Required to activate use of pathfinding functions.
|func_desc=オブジェクトに含まれるスクリプトから、パスファインディング エンティティ(「キャラクター」と呼ばれる)を作成します。パスファインディング関数の使用を有効にするために必要です。
|func_footnote=By default, the character's shape will be an upright capsule approximately the size of the linkset, adjustable via the options list.  The linkset must use the land impact accounting system introduced with the mesh project.
|func_footnote=デフォルトでは、キャラクターの形状は、リンクセットのサイズにほぼ一致する垂直なカプセルになります。このサイズはオプションリストを介して調整できます。リンクセットはメッシュプロジェクトで導入されたランドインパクトの計算システムを使用する必要があります。
If called on an existing character, all unspecified parameters other than character size will revert to their defaults (if not specified, character size will not change). This is STRONGLY preferred over calling [[llDeleteCharacter]]() followed by [[llCreateCharacter]]() as it is much, much less taxing on the server.
既存のキャラクターで呼び出された場合、キャラクターサイズ以外の未指定のパラメータはデフォルトに戻ります(指定されていない場合、キャラクターサイズは変更されません)。これは、[llDeleteCharacter] を呼び出してから [llCreateCharacter] を呼び出す代わりに非常に強く推奨されます。サーバーへの負荷がはるかに少ないためです。
|p1_type=list
|p1_type=list
|p1_subtype=instructions
|p1_subtype=instructions
Line 10: Line 10:
|constants={{LSL_Constants/llCreateCharacter}}
|constants={{LSL_Constants/llCreateCharacter}}
|caveats=(subject to change)
|caveats=(subject to change)
* You only need to use one llCreateCharacter call per object, calling multiple times has no effect.
*オブジェクトごとに llCreateCharacter を1回だけ使用する必要があり、複数回呼び出しても効果はありません。
* One script can contain an llCreateCharacter call and other scripts can exploit that with other path functions that require it.
*1つのスクリプトには llCreateCharacter 呼び出しが含まれ、他のスクリプトがそれを使用して他のパス関数を利用できます。
* llCreateCharacter status survives state changes, script resets, and rezzing.
*llCreateCharacter の状態は、ステートの変更、スクリプトのリセット、および再配置にも生存します。
* llCreateCharacter is always required for all pathing functions.
*llCreateCharacter は常にすべてのパス関数で必要です。
* When an object becomes a character, its [[Mesh/Mesh_physics#Physics_Resource_Cost|physics weight]] becomes fixed at 15.
*オブジェクトがキャラクターになると、その [[Mesh/Mesh_physics#Physics_Resource_Cost|物理ウェイト]] は固定され、15になります。
* If we have multiple scripts containing llCreateCharacter in the same object nothing untoward happens.
*同じオブジェクトに複数のスクリプトが含まれている場合、特に問題は発生しません。
* If multiple scripts use conflicting path functions in the same object (different prims or the same prim) one will take precedence randomly (apparently).
*複数のスクリプトが同じオブジェクト(異なるプリムまたは同じプリム)で競合するパス関数を使用する場合、ランダムに優先されます(明らかに)。
* [[CHARACTER_MAX_SPEED]] - See {{JIRA|PATHBUG-42}} - In testing, we have found a desired speed of 10m/s to be plenty fast most uses and that higher speeds may produce unexpected results (particularly when navigating tight spaces or making sharp turns). March 15, 2012
*[[CHARACTER_MAX_SPEED]] - {{JIRA|PATHBUG-42}}を参照 - テストでは、10m/sの所望の速度がほとんどの用途に十分であり、より高い速度は予期しない結果を生む可能性があります(特に狭い空間を移動したり、急なターンをしたりする場合)。 2012年3月15日
* [[CHARACTER_MAX_ANGULAR_ACCEL]] min = 1.5708
*[[CHARACTER_MAX_ANGULAR_ACCEL]] min = 1.5708
* The character's shape is a capsule (cylinder with spherical ends) with a length (from tip to tip) and a circular cross section of some radius. These two size parameters are what is controlled by the [[CHARACTER_LENGTH]] and [[CHARACTER_RADIUS]] params respectively.
*キャラクターの形状はカプセル(球形の両端がある円柱)で、長さ(先端から先端まで)と円形の断面の半径があります。これら2つのサイズパラメータはそれぞれ [[CHARACTER_LENGTH]] および [[CHARACTER_RADIUS]] で制御されます。
* Note that the character's true "length" cannot be smaller than twice the radius plus 0.1m; however, you're welcome to specify a value lower than that (but more than zero) -- the script shouldn't complain.  
*キャラクターの実際の「長さ」は、半径の2倍に0.1mを加えたものより小さくすることはできませんが、それより低い値を指定することは歓迎されます(ただし0より大きい)。 スクリプトはクレームを言うべきではありません。
* The capsule is usually oriented vertically. Use <nowiki>[</nowiki>[[CHARACTER_ORIENTATION]], [[HORIZONTAL]]] if you need your character to be horizontal.
*通常、カプセルは垂直に向けられています。キャラクターを水平にしたい場合は、<nowiki>[</nowiki>[[CHARACTER_ORIENTATION]], [[HORIZONTAL]]] を使用してください。
** Use a vertical capsule whenever possible; horizontal capsules may become stuck more easily than vertical capsules.
** 可能な限り垂直のカプセルを使用してください。水平のカプセルは垂直のカプセルよりも簡単に動かなくなることがあります。
* Removing the script from a prim will not stop pathing behavior, in the same way that particles and hover text remain. However, if the character encounters an error state, it will be unable to recover since there is no original script to get error handling from. Removing scripts from actively used characters is NOT recommended.  To stop a pathing command use <code>[[llExecCharacterCmd]]([[CHARACTER_CMD_STOP]], [])</code>.
*プリムからスクリプトを削除しても、パス動作は停止しません。ただし、キャラクターがエラー状態に遭遇すると、エラー処理を取得する元のスクリプトがないため、回復できません。アクティブに使用されているキャラクターからスクリプトを削除することはお勧めしません。 パスコ*マンドを停止するには、<code>[[llExecCharacterCmd]]([[CHARACTER_CMD_STOP]], [])</code>を使用してください。
* The root prim's position determines the characters height above the surface; if your character sinks under the surface or is too high above it adjust the relative position of the root prim to the rest of the linkset (or create a new root prim, which you might texture invisible, to control your character's apparent height).
*ルートプリムの位置は、キャラクターの表面上の高さを決定します。キャラクターが表面の下に沈んだり、表面から高すぎたりする場合は、ルートプリムの相対位置をリンクセットの残りに調整します(またはキャラクターの見かけの高さを制御するために不可視の新しいルートプリムを作成します)。
* {{Anchor|ct-caveat}} The default value of [[CHARACTER_STAY_WITHIN_PARCEL]] depends on the [[CHARACTER_TYPE]].
*{{Anchor|ct-caveat}}[[CHARACTER_STAY_WITHIN_PARCEL]] のデフォルト値は [[CHARACTER_TYPE]] に依存します。
** If [[CHARACTER_TYPE]] is set to anything other than [[CHARACTER_TYPE_NONE]], then [[CHARACTER_STAY_WITHIN_PARCEL]] will default to [[TRUE]], so always explicitly set [[CHARACTER_STAY_WITHIN_PARCEL]] to [[FALSE]] if you don't want the character to stop at parcel borders.
** [[CHARACTER_TYPE]] [[CHARACTER_TYPE_NONE]] 以外に設定されている場合、[[CHARACTER_STAY_WITHIN_PARCEL]] のデフォルト値は [[TRUE]] になります。したがって、キャラクターをパーセルの境界で停止させたくない場合は、常に明示的に [[CHARACTER_STAY_WITHIN_PARCEL]] [[FALSE]] に設定してください。
|examples=
|examples=
<source lang="lsl2">
<source lang="lsl2">

Revision as of 11:37, 22 November 2023

要約

関数: llCreateCharacter( list options );

オブジェクトに含まれるスクリプトから、パスファインディング エンティティ(「キャラクター」と呼ばれる)を作成します。パスファインディング関数の使用を有効にするために必要です。

• list options Character configuration options.

デフォルトでは、キャラクターの形状は、リンクセットのサイズにほぼ一致する垂直なカプセルになります。このサイズはオプションリストを介して調整できます。リンクセットはメッシュプロジェクトで導入されたランドインパクトの計算システムを使用する必要があります。 既存のキャラクターで呼び出された場合、キャラクターサイズ以外の未指定のパラメータはデフォルトに戻ります(指定されていない場合、キャラクターサイズは変更されません)。これは、[llDeleteCharacter] を呼び出してから [llCreateCharacter] を呼び出す代わりに非常に強く推奨されます。サーバーへの負荷がはるかに少ないためです。

Option Default Range / Values Description
CHARACTER_DESIRED_SPEED 1 6 [0.2, 40.0] Speed of pursuit in meters per second.
CHARACTER_RADIUS 2 [0.125, 5.0] Set collision capsule radius.
CHARACTER_LENGTH 3 (0.0, 10.0] Set collision capsule length

If the value is less than twice the radius plus 0.1m, it will be set to twice the radius plus 0.1m.

CHARACTER_ORIENTATION 4 VERTICAL VERTICAL, HORIZONTAL Set the character orientation.
TRAVERSAL_TYPE 7 TRAVERSAL_TYPE_SLOW TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, TRAVERSAL_TYPE_NONE Controls the speed at which characters moves on terrain that is less than 100% walkable will move faster (e.g., a cat crossing a street) or slower (e.g., a car driving in a swamp).

To use _FAST or _SLOW, you must specify a CHARACTER_TYPE.

CHARACTER_TYPE 6 CHARACTER_TYPE_NONE CHARACTER_TYPE_A, CHARACTER_TYPE_B, CHARACTER_TYPE_C, CHARACTER_TYPE_D, CHARACTER_TYPE_NONE Specifies which walkability coefficient will be used by this character.
CHARACTER_AVOIDANCE_MODE 5 AVOID_CHARACTERS | AVOID_DYNAMIC_OBSTACLES Combinable Flags: AVOID_CHARACTERS, AVOID_DYNAMIC_OBSTACLES, AVOID_NONE Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. This is framed in the positive sense ([CHARACTER_AVOIDANCE_MODE, AVOID_CHARACTERS] would create a character that avoided other characters but not agents or moving vehicles). Setting this parameter to AVOID_NONE causes the character to not avoid either category.
CHARACTER_MAX_ACCEL 8 20 [0.5, 40.0] The character's maximum acceleration rate.
CHARACTER_MAX_DECEL 9 30 [0.5, 60.0] The character's maximum deceleration rate.
CHARACTER_DESIRED_TURN_SPEED 12 6 [0.02, 40.0] The character's maximum speed while turning--note that this is only loosely enforced (i.e., a character may turn at higher speeds under certain conditions)
CHARACTER_MAX_TURN_RADIUS 10 1.25 [0.1, 10.0] The character's turn radius when traveling at CHARACTER_DESIRED_TURN_SPEED
CHARACTER_MAX_SPEED 13 20 [1, 40.0] The character's maximum speed. Affects speed when avoiding dynamic obstacles and when traversing low-walkability objects in TRAVERSAL_TYPE_FAST mode.
CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES 14 TRUE TRUE or FALSE TRUE matches pre-existing behavior. If set to FALSE, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery).
CHARACTER_STAY_WITHIN_PARCEL 15 Depends* TRUE or FALSE FALSE matches traditional behavior. If set to TRUE, treat the parcel boundaries as one-way obstacles (will re-enter but can't leave on it's own).

警告

(subject to change)

  • オブジェクトごとに llCreateCharacter を1回だけ使用する必要があり、複数回呼び出しても効果はありません。
  • 1つのスクリプトには llCreateCharacter 呼び出しが含まれ、他のスクリプトがそれを使用して他のパス関数を利用できます。
  • llCreateCharacter の状態は、ステートの変更、スクリプトのリセット、および再配置にも生存します。
  • llCreateCharacter は常にすべてのパス関数で必要です。
  • オブジェクトがキャラクターになると、その 物理ウェイト は固定され、15になります。
  • 同じオブジェクトに複数のスクリプトが含まれている場合、特に問題は発生しません。
  • 複数のスクリプトが同じオブジェクト(異なるプリムまたは同じプリム)で競合するパス関数を使用する場合、ランダムに優先されます(明らかに)。
  • CHARACTER_MAX_SPEED - PATHBUG-42を参照 - テストでは、10m/sの所望の速度がほとんどの用途に十分であり、より高い速度は予期しない結果を生む可能性があります(特に狭い空間を移動したり、急なターンをしたりする場合)。 2012年3月15日
  • CHARACTER_MAX_ANGULAR_ACCEL min = 1.5708
  • キャラクターの形状はカプセル(球形の両端がある円柱)で、長さ(先端から先端まで)と円形の断面の半径があります。これら2つのサイズパラメータはそれぞれ CHARACTER_LENGTH および CHARACTER_RADIUS で制御されます。
  • キャラクターの実際の「長さ」は、半径の2倍に0.1mを加えたものより小さくすることはできませんが、それより低い値を指定することは歓迎されます(ただし0より大きい)。 スクリプトはクレームを言うべきではありません。
  • 通常、カプセルは垂直に向けられています。キャラクターを水平にしたい場合は、[CHARACTER_ORIENTATION, HORIZONTAL] を使用してください。
    • 可能な限り垂直のカプセルを使用してください。水平のカプセルは垂直のカプセルよりも簡単に動かなくなることがあります。
  • プリムからスクリプトを削除しても、パス動作は停止しません。ただし、キャラクターがエラー状態に遭遇すると、エラー処理を取得する元のスクリプトがないため、回復できません。アクティブに使用されているキャラクターからスクリプトを削除することはお勧めしません。 パスコ*マンドを停止するには、llExecCharacterCmd(CHARACTER_CMD_STOP, [])を使用してください。
  • ルートプリムの位置は、キャラクターの表面上の高さを決定します。キャラクターが表面の下に沈んだり、表面から高すぎたりする場合は、ルートプリムの相対位置をリンクセットの残りに調整します(またはキャラクターの見かけの高さを制御するために不可視の新しいルートプリムを作成します)。
  • CHARACTER_STAY_WITHIN_PARCEL のデフォルト値は CHARACTER_TYPE に依存します。
All Issues ~ Search JIRA for related Bugs

サンプル

create_character()
{
//  Clear any previous character behaviors
    llDeleteCharacter();

//  MAX_SPEED is @ 20 by default
    llCreateCharacter([ CHARACTER_MAX_SPEED, 25,
                        CHARACTER_DESIRED_SPEED, 15.0]);
}

patrol_around(vector targetPos)
{
    list points = [targetPos + <5, 0, 0>, targetPos - <5, 0, 0>];
    llPatrolPoints(points, []);
}

default
{
    on_rez(integer start_param)
    {
        llResetScript();
    }

    state_entry()
    {
        create_character();
    }
 
    touch_start(integer num_detected)
    {
        patrol_around(llGetPos());
    }
}

特記事項

経緯

Date of Release 31/07/2012

Search JIRA for related Issues

脚注

  1. ^ 記事中の範囲は、 実数空間 に記載されているものです。

Signature

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