LlExecCharacterCmd

来自人工智能助力教育知识百科
Mkx讨论 | 贡献2020年4月13日 (一) 03:35的版本 (创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: llExecCharacterCmd( integer command, list options ); |参…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

Template:Needs Translation/


函数名
Function: llExecCharacterCmd( integer command, list options );
参数: integer command – Command to be sent.

list options – CHARACTER_CMD_*

返回值:Send a command to the pathing system.
注意事项
If another script in the same object issues CHARACTER_CMD_STOP then pathing in all scripts is cancelled.
示例
示例1
vector patrol;
 
default
{
    state_entry()
    {
        patrol = llGetPos();
        llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
        state awake;
    }
}
 
state awake
{
    state_entry()
    {
        llSay(0, "I am guarding now");
        list points = [patrol + <5,0,0>, patrol - <5,0,0>];
        llPatrolPoints(points, []);
    }
 
    touch_start(integer total_number)
    {
        state sleep;
    }
}
 
state sleep
{
    state_entry()
    {
        llSay(0, "Going to sleep");
        llExecCharacterCmd(CHARACTER_CMD_SMOOTH_STOP, []);
    }
 
    touch_start(integer total_number)
    {
        patrol = llGetPos();
        //Jump to attention!
        llExecCharacterCmd(CHARACTER_CMD_JUMP, [0.5]);
        state awake;
    }
}
相关函数
llCreateCharacter

llDeleteCharacter

llEvade

llExecCharacterCmd

llGetClosestNavPoint

llFleeFrom

llNavigateTo

llPatrolPoints

llPursue

llUpdateCharacter

llWanderWithin

相关事件
path_update