查看: 327|回复: 0

[引擎的各个功能] 12.创建 Task 节点

[复制链接]

1

主题

342

帖子

7万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
75866
发表于 2017-4-8 07:16:42 | 显示全部楼层 |阅读模式

12.创建 Task 节点



       
     
     
     Unreal Engine 4.9

       
     
         



            
            
Previous Step


        
            
        
Next Step


   
            
        
Quick Start Home


   
   
Task 是真正“执行”操作的节点,如移动 AI,或调整黑板值。它们可以被 Decorators
附着。


这里的这个 Task 实际上是 Move To 节点的新形态,主要的不同点是:Task 节点将指引 AI 向玩家的 Pawn 前进,而非向其所在位置前进。此外,它有助于分解任务,并确认如未执行 Finish Execute,Task 节点将继续进行处理,AI MoveTo 节点完整地展示了这点。

步骤


在 内容浏览器 中 双击 打开 FollowerBT 行为树。


点击 New Task 按钮。


它将创建于和行为树相同的文件夹中。


在 内容浏览器 中将其重命名为 “RapidMoveTo”。


编辑器应已将其打开以便编辑。如尚未打开,在 内容浏览器 中 双击 打开。


创建如下图表:


     p').length != 0) { copyToClipboard($('#fullgraphBTService12_snippet > p').html()); } else { copyToClipboard($('#fullgraphBTService12_snippet').html()); }">Copy Example
   
       
12.创建 Task 节点
12.创建 Task 节点





   
  1. Begin Object Class=K2Node_Event Name="K2Node_Event_845"
  2.    Begin Object Class=EdGraphPin Name="EdGraphPin_4172"
  3.    End Object
  4.    Begin Object Class=EdGraphPin Name="EdGraphPin_4173"
  5.    End Object
  6.    Begin Object Class=EdGraphPin Name="EdGraphPin_4174"
  7.    End Object
  8.    Begin Object Name="EdGraphPin_4172"
  9.       PinName="OutputDelegate"
  10.       Direction=EGPD_Output
  11.       PinType=(PinCategory="delegate",PinSubCategoryMemberReference=(MemberParentClass=Class'/Script/AIModule.BTTask_BlueprintBase',MemberName="ReceiveExecute"))
  12.    End Object
  13.    Begin Object Name="EdGraphPin_4173"
  14.       PinName="then"
  15.       Direction=EGPD_Output
  16.       PinType=(PinCategory="exec")
  17.       LinkedTo(0)=EdGraphPin'K2Node_IfThenElse_100.EdGraphPin_20069'
  18.    End Object
  19.    Begin Object Name="EdGraphPin_4174"
  20.       PinName="OwnerActor"
  21.       PinToolTip="Owner Actor/nActor Reference"
  22.       Direction=EGPD_Output
  23.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')
  24.       LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6850'
  25.    End Object
  26.    EventSignatureName="ReceiveExecute"
  27.    EventSignatureClass=Class'/Script/AIModule.BTTask_BlueprintBase'
  28.    bOverrideFunction=True
  29.    Pins(0)=EdGraphPin'EdGraphPin_4172'
  30.    Pins(1)=EdGraphPin'EdGraphPin_4173'
  31.    Pins(2)=EdGraphPin'EdGraphPin_4174'
  32.    NodePosX=-352
  33.    NodePosY=64
  34.    NodeGuid=6739971B49CD20A6D2ACF6B441AF6A7A
  35. End Object
  36. Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_123126"
  37.    Begin Object Class=EdGraphPin Name="EdGraphPin_4076"
  38.    End Object
  39.    Begin Object Class=EdGraphPin Name="EdGraphPin_4077"
  40.    End Object
  41.    Begin Object Class=EdGraphPin Name="EdGraphPin_4078"
  42.    End Object
  43.    Begin Object Class=EdGraphPin Name="EdGraphPin_4079"
  44.    End Object
  45.    Begin Object Name="EdGraphPin_4076"
  46.       PinName="execute"
  47.       PinType=(PinCategory="exec")
  48.       LinkedTo(0)=EdGraphPin'K2Node_AIMoveTo_42.EdGraphPin_4112'
  49.    End Object
  50.    Begin Object Name="EdGraphPin_4077"
  51.       PinName="then"
  52.       Direction=EGPD_Output
  53.       PinType=(PinCategory="exec")
  54.    End Object
  55.    Begin Object Name="EdGraphPin_4078"
  56.       PinName="self"
  57.       PinFriendlyName="Target"
  58.       PinToolTip="Target/nBTTask Blueprint Base Reference"
  59.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/AIModule.BTTask_BlueprintBase')
  60.    End Object
  61.    Begin Object Name="EdGraphPin_4079"
  62.       PinName="bSuccess"
  63.       PinToolTip="Success/nBoolean"
  64.       PinType=(PinCategory="bool")
  65.       DefaultValue="true"
  66.       AutogeneratedDefaultValue="false"
  67.    End Object
  68.    FunctionReference=(MemberName="FinishExecute",bSelfContext=True)
  69.    Pins(0)=EdGraphPin'EdGraphPin_4076'
  70.    Pins(1)=EdGraphPin'EdGraphPin_4077'
  71.    Pins(2)=EdGraphPin'EdGraphPin_4078'
  72.    Pins(3)=EdGraphPin'EdGraphPin_4079'
  73.    NodePosX=1440
  74.    NodeGuid=81BF51914D95508F36CB2387949AA34F
  75. End Object
  76. Begin Object Class=K2Node_DynamicCast Name="K2Node_DynamicCast_1392"
  77.    Begin Object Class=EdGraphPin Name="EdGraphPin_6847"
  78.    End Object
  79.    Begin Object Class=EdGraphPin Name="EdGraphPin_6848"
  80.    End Object
  81.    Begin Object Class=EdGraphPin Name="EdGraphPin_6849"
  82.    End Object
  83.    Begin Object Class=EdGraphPin Name="EdGraphPin_6850"
  84.    End Object
  85.    Begin Object Class=EdGraphPin Name="EdGraphPin_6851"
  86.    End Object
  87.    Begin Object Class=EdGraphPin Name="EdGraphPin_6852"
  88.    End Object
  89.    Begin Object Name="EdGraphPin_6847"
  90.       PinName="execute"
  91.       PinType=(PinCategory="exec")
  92.       LinkedTo(0)=EdGraphPin'K2Node_IfThenElse_100.EdGraphPin_20072'
  93.    End Object
  94.    Begin Object Name="EdGraphPin_6848"
  95.       PinName="then"
  96.       Direction=EGPD_Output
  97.       PinType=(PinCategory="exec")
  98.       LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_4143'
  99.    End Object
  100.    Begin Object Name="EdGraphPin_6849"
  101.       PinName="CastFailed"
  102.       Direction=EGPD_Output
  103.       PinType=(PinCategory="exec")
  104.    End Object
  105.    Begin Object Name="EdGraphPin_6850"
  106.       PinName="Object"
  107.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/CoreUObject.Object')
  108.       LinkedTo(0)=EdGraphPin'K2Node_Event_845.EdGraphPin_4174'
  109.    End Object
  110.    Begin Object Name="EdGraphPin_6851"
  111.       PinName="AsFollower AI CON"
  112.       Direction=EGPD_Output
  113.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
  114.       LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_4145'
  115.    End Object
  116.    Begin Object Name="EdGraphPin_6852"
  117.       PinName="bSuccess"
  118.       Direction=EGPD_Output
  119.       PinType=(PinCategory="bool")
  120.       bHidden=True
  121.    End Object
  122.    TargetType=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C'
  123.    Pins(0)=EdGraphPin'EdGraphPin_6847'
  124.    Pins(1)=EdGraphPin'EdGraphPin_6848'
  125.    Pins(2)=EdGraphPin'EdGraphPin_6849'
  126.    Pins(3)=EdGraphPin'EdGraphPin_6850'
  127.    Pins(4)=EdGraphPin'EdGraphPin_6851'
  128.    Pins(5)=EdGraphPin'EdGraphPin_6852'
  129.    NodePosX=400
  130.    NodePosY=64
  131.    NodeGuid=7FB506C8481E3974BAB151A7A93C47BA
  132. End Object
  133. Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_123506"
  134.    Begin Object Class=EdGraphPin Name="EdGraphPin_4104"
  135.    End Object
  136.    Begin Object Class=EdGraphPin Name="EdGraphPin_4105"
  137.    End Object
  138.    Begin Object Name="EdGraphPin_4104"
  139.       PinName="self"
  140.       PinFriendlyName="Target"
  141.       PinToolTip="Target/nController Reference"
  142.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Controller')
  143.       LinkedTo(0)=EdGraphPin'K2Node_VariableGet_265.EdGraphPin_20067'
  144.    End Object
  145.    Begin Object Name="EdGraphPin_4105"
  146.       PinName="ReturnValue"
  147.       PinToolTip="Return Value/nPawn Reference"
  148.       Direction=EGPD_Output
  149.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Pawn')
  150.       LinkedTo(0)=EdGraphPin'K2Node_AIMoveTo_42.EdGraphPin_4116'
  151.    End Object
  152.    bIsPureFunc=True
  153.    bIsConstFunc=True
  154.    FunctionReference=(MemberParentClass=Class'/Script/Engine.Controller',MemberName="K2_GetPawn")
  155.    Pins(0)=EdGraphPin'EdGraphPin_4104'
  156.    Pins(1)=EdGraphPin'EdGraphPin_4105'
  157.    NodePosX=784
  158.    NodePosY=176
  159.    NodeGuid=27431F034F88EB67FFA2BF9C9F7C776D
  160. End Object
  161. Begin Object Class=K2Node_AIMoveTo Name="K2Node_AIMoveTo_42"
  162.    Begin Object Class=EdGraphPin Name="EdGraphPin_4110"
  163.    End Object
  164.    Begin Object Class=EdGraphPin Name="EdGraphPin_4111"
  165.    End Object
  166.    Begin Object Class=EdGraphPin Name="EdGraphPin_4112"
  167.    End Object
  168.    Begin Object Class=EdGraphPin Name="EdGraphPin_4113"
  169.    End Object
  170.    Begin Object Class=EdGraphPin Name="EdGraphPin_4114"
  171.    End Object
  172.    Begin Object Class=EdGraphPin Name="EdGraphPin_4115"
  173.    End Object
  174.    Begin Object Class=EdGraphPin Name="EdGraphPin_4116"
  175.    End Object
  176.    Begin Object Class=EdGraphPin Name="EdGraphPin_4117"
  177.    End Object
  178.    Begin Object Class=EdGraphPin Name="EdGraphPin_4118"
  179.    End Object
  180.    Begin Object Class=EdGraphPin Name="EdGraphPin_4119"
  181.    End Object
  182.    Begin Object Class=EdGraphPin Name="EdGraphPin_4120"
  183.    End Object
  184.    Begin Object Name="EdGraphPin_4110"
  185.       PinName="execute"
  186.       PinType=(PinCategory="exec")
  187.       LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_4144'
  188.       LinkedTo(1)=EdGraphPin'K2Node_IfThenElse_100.EdGraphPin_20071'
  189.    End Object
  190.    Begin Object Name="EdGraphPin_4111"
  191.       PinName="then"
  192.       Direction=EGPD_Output
  193.       PinType=(PinCategory="exec")
  194.    End Object
  195.    Begin Object Name="EdGraphPin_4112"
  196.       PinName="OnSuccess"
  197.       Direction=EGPD_Output
  198.       PinType=(PinCategory="exec")
  199.       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_123126.EdGraphPin_4076'
  200.    End Object
  201.    Begin Object Name="EdGraphPin_4113"
  202.       PinName="OnFail"
  203.       Direction=EGPD_Output
  204.       PinType=(PinCategory="exec")
  205.    End Object
  206.    Begin Object Name="EdGraphPin_4114"
  207.       PinName="MovementResult"
  208.       Direction=EGPD_Output
  209.       PinType=(PinCategory="byte",PinSubCategoryObject=Enum'/Script/AIModule.PathFollowingComponent:EPathFollowingResult')
  210.    End Object
  211.    Begin Object Name="EdGraphPin_4115"
  212.       PinName="WorldContextObject"
  213.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/CoreUObject.Object')
  214.       DefaultValue="0"
  215.       bHidden=True
  216.    End Object
  217.    Begin Object Name="EdGraphPin_4116"
  218.       PinName="Pawn"
  219.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Pawn')
  220.       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_123506.EdGraphPin_4105'
  221.    End Object
  222.    Begin Object Name="EdGraphPin_4117"
  223.       PinName="Destination"
  224.       PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
  225.       DefaultValue="0, 0, 0"
  226.       AutogeneratedDefaultValue="0, 0, 0"
  227.    End Object
  228.    Begin Object Name="EdGraphPin_4118"
  229.       PinName="TargetActor"
  230.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')
  231.       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_26123.EdGraphPin_4158'
  232.    End Object
  233.    Begin Object Name="EdGraphPin_4119"
  234.       PinName="AcceptanceRadius"
  235.       PinType=(PinCategory="float")
  236.       DefaultValue="50.000"
  237.       AutogeneratedDefaultValue="5.000000"
  238.    End Object
  239.    Begin Object Name="EdGraphPin_4120"
  240.       PinName="bStopOnOverlap"
  241.       PinType=(PinCategory="bool")
  242.       DefaultValue="false"
  243.       AutogeneratedDefaultValue="false"
  244.    End Object
  245.    Pins(0)=EdGraphPin'EdGraphPin_4110'
  246.    Pins(1)=EdGraphPin'EdGraphPin_4111'
  247.    Pins(2)=EdGraphPin'EdGraphPin_4112'
  248.    Pins(3)=EdGraphPin'EdGraphPin_4113'
  249.    Pins(4)=EdGraphPin'EdGraphPin_4114'
  250.    Pins(5)=EdGraphPin'EdGraphPin_4115'
  251.    Pins(6)=EdGraphPin'EdGraphPin_4116'
  252.    Pins(7)=EdGraphPin'EdGraphPin_4117'
  253.    Pins(8)=EdGraphPin'EdGraphPin_4118'
  254.    Pins(9)=EdGraphPin'EdGraphPin_4119'
  255.    Pins(10)=EdGraphPin'EdGraphPin_4120'
  256.    NodePosX=1104
  257.    ErrorType=1
  258.    ErrorMsg="Error Unexpected node type K2Node_AIMoveTo encountered at  AI MoveTo "
  259.    NodeGuid=E94A59B64BE284DD7C92E6B51454D074
  260. End Object
  261. Begin Object Class=K2Node_VariableSet Name="K2Node_VariableSet_421"
  262.    Begin Object Class=EdGraphPin Name="EdGraphPin_4143"
  263.    End Object
  264.    Begin Object Class=EdGraphPin Name="EdGraphPin_4144"
  265.    End Object
  266.    Begin Object Class=EdGraphPin Name="EdGraphPin_4145"
  267.    End Object
  268.    Begin Object Class=EdGraphPin Name="EdGraphPin_4146"
  269.    End Object
  270.    Begin Object Class=EdGraphPin Name="EdGraphPin_4147"
  271.    End Object
  272.    Begin Object Name="EdGraphPin_4143"
  273.       PinName="execute"
  274.       PinType=(PinCategory="exec")
  275.       LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6848'
  276.    End Object
  277.    Begin Object Name="EdGraphPin_4144"
  278.       PinName="then"
  279.       Direction=EGPD_Output
  280.       PinType=(PinCategory="exec")
  281.       LinkedTo(0)=EdGraphPin'K2Node_AIMoveTo_42.EdGraphPin_4110'
  282.    End Object
  283.    Begin Object Name="EdGraphPin_4145"
  284.       PinName="AI_CON_Ref"
  285.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
  286.       LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6851'
  287.    End Object
  288.    Begin Object Name="EdGraphPin_4146"
  289.       PinName="Output_Get"
  290.       PinToolTip="Retrieves the value of the variable, can use instead of a separate Get node"
  291.       Direction=EGPD_Output
  292.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
  293.    End Object
  294.    Begin Object Name="EdGraphPin_4147"
  295.       PinName="self"
  296.       PinFriendlyName="Target"
  297.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/RapidMoveTo.RapidMoveTo_C')
  298.       bHidden=True
  299.    End Object
  300.    VariableReference=(MemberName="AI_CON_Ref",bSelfContext=True)
  301.    Pins(0)=EdGraphPin'EdGraphPin_4143'
  302.    Pins(1)=EdGraphPin'EdGraphPin_4144'
  303.    Pins(2)=EdGraphPin'EdGraphPin_4145'
  304.    Pins(3)=EdGraphPin'EdGraphPin_4146'
  305.    Pins(4)=EdGraphPin'EdGraphPin_4147'
  306.    NodePosX=672
  307.    NodePosY=64
  308.    NodeGuid=D120D77248C9744E274BB8925D0FBE23
  309. End Object
  310. Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_26123"
  311.    Begin Object Class=EdGraphPin Name="EdGraphPin_4155"
  312.    End Object
  313.    Begin Object Class=EdGraphPin Name="EdGraphPin_4156"
  314.    End Object
  315.    Begin Object Class=EdGraphPin Name="EdGraphPin_4157"
  316.    End Object
  317.    Begin Object Class=EdGraphPin Name="EdGraphPin_4158"
  318.    End Object
  319.    Begin Object Name="EdGraphPin_4155"
  320.       PinName="self"
  321.       PinFriendlyName="Target"
  322.       PinToolTip="Target/nBTFunction Library Reference"
  323.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/AIModule.BTFunctionLibrary')
  324.       DefaultObject=Default__BTFunctionLibrary
  325.       bHidden=True
  326.    End Object
  327.    Begin Object Name="EdGraphPin_4156"
  328.       PinName="NodeOwner"
  329.       PinToolTip="Node Owner/nBTNode Reference"
  330.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/AIModule.BTNode')
  331.       bHidden=True
  332.    End Object
  333.    Begin Object Name="EdGraphPin_4157"
  334.       PinName="Key"
  335.       PinToolTip="Key/nBlackboard Key Selector Structure (by ref)"
  336.       PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/AIModule.BehaviorTreeTypes:BlackboardKeySelector',bIsReference=True,bIsConst=True)
  337.       LinkedTo(0)=EdGraphPin'K2Node_VariableGet_150.EdGraphPin_4167'
  338.       bDefaultValueIsIgnored=True
  339.    End Object
  340.    Begin Object Name="EdGraphPin_4158"
  341.       PinName="ReturnValue"
  342.       PinToolTip="Return Value/nActor Reference"
  343.       Direction=EGPD_Output
  344.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')
  345.       LinkedTo(0)=EdGraphPin'K2Node_AIMoveTo_42.EdGraphPin_4118'
  346.    End Object
  347.    bIsPureFunc=True
  348.    FunctionReference=(MemberParentClass=Class'/Script/AIModule.BTFunctionLibrary',MemberName="GetBlackboardValueAsActor")
  349.    Pins(0)=EdGraphPin'EdGraphPin_4155'
  350.    Pins(1)=EdGraphPin'EdGraphPin_4156'
  351.    Pins(2)=EdGraphPin'EdGraphPin_4157'
  352.    Pins(3)=EdGraphPin'EdGraphPin_4158'
  353.    NodePosX=752
  354.    NodePosY=256
  355.    ErrorType=1
  356.    ErrorMsg="Error Default value /'/' for  Key  is invalid: /'Literal values are not allowed for pass-by-reference parameters./'"
  357.    NodeGuid=98F411F940A58634CB63C1BF782C619B
  358. End Object
  359. Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_150"
  360.    Begin Object Class=EdGraphPin Name="EdGraphPin_4167"
  361.    End Object
  362.    Begin Object Class=EdGraphPin Name="EdGraphPin_4168"
  363.    End Object
  364.    Begin Object Name="EdGraphPin_4167"
  365.       PinName="TargetToFollow"
  366.       Direction=EGPD_Output
  367.       PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/AIModule.BehaviorTreeTypes:BlackboardKeySelector')
  368.       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_26123.EdGraphPin_4157'
  369.    End Object
  370.    Begin Object Name="EdGraphPin_4168"
  371.       PinName="self"
  372.       PinFriendlyName="Target"
  373.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/RapidMoveTo.RapidMoveTo_C')
  374.       bHidden=True
  375.    End Object
  376.    VariableReference=(MemberName="TargetToFollow",bSelfContext=True)
  377.    Pins(0)=EdGraphPin'EdGraphPin_4167'
  378.    Pins(1)=EdGraphPin'EdGraphPin_4168'
  379.    NodePosX=592
  380.    NodePosY=256
  381.    NodeGuid=361AB0164C7B72B6F80BD986EFD799A2
  382. End Object
  383. Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_265"
  384.    Begin Object Class=EdGraphPin Name="EdGraphPin_20067"
  385.    End Object
  386.    Begin Object Class=EdGraphPin Name="EdGraphPin_20068"
  387.    End Object
  388.    Begin Object Name="EdGraphPin_20067"
  389.       PinName="AI_CON_Ref"
  390.       Direction=EGPD_Output
  391.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
  392.       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_123506.EdGraphPin_4104'
  393.    End Object
  394.    Begin Object Name="EdGraphPin_20068"
  395.       PinName="self"
  396.       PinFriendlyName="Target"
  397.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/RapidMoveTo.RapidMoveTo_C')
  398.       bHidden=True
  399.    End Object
  400.    VariableReference=(MemberName="AI_CON_Ref",bSelfContext=True)
  401.    Pins(0)=EdGraphPin'EdGraphPin_20067'
  402.    Pins(1)=EdGraphPin'EdGraphPin_20068'
  403.    NodePosX=592
  404.    NodePosY=208
  405.    NodeGuid=A10A3F5048238FE8D6B7E9A8DFF21873
  406. End Object
  407. Begin Object Class=K2Node_IfThenElse Name="K2Node_IfThenElse_100"
  408.    Begin Object Class=EdGraphPin Name="EdGraphPin_20069"
  409.    End Object
  410.    Begin Object Class=EdGraphPin Name="EdGraphPin_20070"
  411.    End Object
  412.    Begin Object Class=EdGraphPin Name="EdGraphPin_20071"
  413.    End Object
  414.    Begin Object Class=EdGraphPin Name="EdGraphPin_20072"
  415.    End Object
  416.    Begin Object Name="EdGraphPin_20069"
  417.       PinName="execute"
  418.       PinType=(PinCategory="exec")
  419.       LinkedTo(0)=EdGraphPin'K2Node_Event_845.EdGraphPin_4173'
  420.    End Object
  421.    Begin Object Name="EdGraphPin_20070"
  422.       PinName="Condition"
  423.       PinType=(PinCategory="bool")
  424.       DefaultValue="false"
  425.       AutogeneratedDefaultValue="false"
  426.       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2670.EdGraphPin_20078'
  427.    End Object
  428.    Begin Object Name="EdGraphPin_20071"
  429.       PinName="then"
  430.       PinFriendlyName="true"
  431.       Direction=EGPD_Output
  432.       PinType=(PinCategory="exec")
  433.       LinkedTo(0)=EdGraphPin'K2Node_AIMoveTo_42.EdGraphPin_4110'
  434.    End Object
  435.    Begin Object Name="EdGraphPin_20072"
  436.       PinName="else"
  437.       PinFriendlyName="false"
  438.       Direction=EGPD_Output
  439.       PinType=(PinCategory="exec")
  440.       LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6847'
  441.    End Object
  442.    Pins(0)=EdGraphPin'EdGraphPin_20069'
  443.    Pins(1)=EdGraphPin'EdGraphPin_20070'
  444.    Pins(2)=EdGraphPin'EdGraphPin_20071'
  445.    Pins(3)=EdGraphPin'EdGraphPin_20072'
  446.    NodePosX=112
  447.    NodeGuid=5DE038EB4BDB2B34F7C21B9FA0A97743
  448. End Object
  449. Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_267"
  450.    Begin Object Class=EdGraphPin Name="EdGraphPin_20073"
  451.    End Object
  452.    Begin Object Class=EdGraphPin Name="EdGraphPin_20074"
  453.    End Object
  454.    Begin Object Name="EdGraphPin_20073"
  455.       PinName="AI_CON_Ref"
  456.       Direction=EGPD_Output
  457.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
  458.       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2670.EdGraphPin_20076'
  459.    End Object
  460.    Begin Object Name="EdGraphPin_20074"
  461.       PinName="self"
  462.       PinFriendlyName="Target"
  463.       PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/RapidMoveTo.RapidMoveTo_C')
  464.       bHidden=True
  465.    End Object
  466.    VariableReference=(MemberName="AI_CON_Ref",bSelfContext=True)
  467.    Pins(0)=EdGraphPin'EdGraphPin_20073'
  468.    Pins(1)=EdGraphPin'EdGraphPin_20074'
  469.    NodePosX=-352
  470.    NodePosY=-64
  471.    NodeGuid=DD83F3A04F10972DE201B1A9948967EF
  472. End Object
  473. Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2670"
  474.    Begin Object Class=EdGraphPin Name="EdGraphPin_20075"
  475.    End Object
  476.    Begin Object Class=EdGraphPin Name="EdGraphPin_20076"
  477.    End Object
  478.    Begin Object Class=EdGraphPin Name="EdGraphPin_20077"
  479.    End Object
  480.    Begin Object Class=EdGraphPin Name="EdGraphPin_20078"
  481.    End Object
  482.    Begin Object Name="EdGraphPin_20075"
  483.       PinName="self"
  484.       PinFriendlyName="Target"
  485.       PinToolTip="Target/nKismet Math Library Reference"
  486.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
  487.       DefaultObject=Default__KismetMathLibrary
  488.       bHidden=True
  489.    End Object
  490.    Begin Object Name="EdGraphPin_20076"
  491.       PinName="A"
  492.       PinToolTip="A/nObject Reference"
  493.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/CoreUObject.Object')
  494.       LinkedTo(0)=EdGraphPin'K2Node_VariableGet_267.EdGraphPin_20073'
  495.    End Object
  496.    Begin Object Name="EdGraphPin_20077"
  497.       PinName="B"
  498.       PinToolTip="B/nObject Reference"
  499.       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/CoreUObject.Object')
  500.    End Object
  501.    Begin Object Name="EdGraphPin_20078"
  502.       PinName="ReturnValue"
  503.       PinToolTip="Return Value/nBoolean"
  504.       Direction=EGPD_Output
  505.       PinType=(PinCategory="bool")
  506.       DefaultValue="false"
  507.       AutogeneratedDefaultValue="false"
  508.       LinkedTo(0)=EdGraphPin'K2Node_IfThenElse_100.EdGraphPin_20070'
  509.    End Object
  510.    bIsPureFunc=True
  511.    FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="NotEqual_ObjectObject")
  512.    Pins(0)=EdGraphPin'EdGraphPin_20075'
  513.    Pins(1)=EdGraphPin'EdGraphPin_20076'
  514.    Pins(2)=EdGraphPin'EdGraphPin_20077'
  515.    Pins(3)=EdGraphPin'EdGraphPin_20078'
  516.    NodePosX=-160
  517.    NodePosY=-64
  518.    NodeGuid=F90931054D514458FE3DDA997BE5C7C2
  519. End Object
复制代码

     p').length != 0) { copyToClipboard($('#fullgraphBTService12_snippet > p').html()); } else { copyToClipboard($('#fullgraphBTService12_snippet').html()); }">

点击图片将其展开,或点击 此处12.创建 Task 节点

在窗口中打开。


12.创建 Task 节点



该蓝图的变量名、类型和数值:


       


       
                AI_CON_Ref
               
               
                Follower_AI_CON_C
               
               
                无
               
       

       
                TargetToFollow
               
               
                BlackboardKeySelector
               
               
                无 - 但此变量的“可编辑”标记为 True,因此可在行为树中根据实例进行变更。
               
       



以下是该图表中将执行的操作:


Event Receive Execute 是行为树运行此任务节点时调用的事件。


按之前步骤中的方法保存 Follower_AI_CON。


Cast to Actor 节点从黑板获取 “TargetToFollow” 物体值并投射到一个 Actor 上,以便在 AI MoveTo 节点中使用。


完成后,任务将成功运行 Finish Execute 节点。


            
            
Previous Step


        
            
        
Next Step


   
            
        
Quick Start Home


   
   




                                       
                                       
完整内容索引
                                       
                               
                       
                       
            

            
            

     2004-2017, Epic Games, Inc. 版权所有。Unreal 及相关的商标是 Epic 在美国和其他国家的注册商标。


    使用条款 | 隐私政策

            
        
               
       
   
回复

使用道具 举报

*滑块验证:
您需要登录后才可以回帖 登录 | enginedx注册

本版积分规则

 
 



邮件留言:


 
返回顶部