查看: 351|回复: 6

[引擎各个功能] 【13.创建 Decorator 节点 | Unreal Engine】

[复制链接]

1

主题

342

帖子

7万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
75866
发表于 2016-6-25 14:03:24 | 显示全部楼层 |阅读模式



Previous Step
Next Step



   
Quick Start Home


Decorators 即为其他行为树系统中的条件语句,附着于一个 Composite 或 Task 节点,并定义树中的一个分支或单个节点是否能被执行。

AI Pawn 接近目标时,Decorator 将停止执行行为树中的 Rapid Move To 分支。利用 Rapid Move To 或 Move To Task 节点也可执行该操作,但 decorator 可接收任何 Actor 并阻止任何分支的执行。在许多情况下均可重复利用。
步骤
在 内容浏览器 中 双击 打开 FollowerBT 行为树。

点击 New Decorator 按钮。

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

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

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

在 My Blueprint 标签下的 Functions 部分中,“覆盖” PerformConditionCheck。

【虚幻4翻译文档-13.创建 Decorator 节点 | Unreal Engine】[虚幻4中文文档]



在新功能中创建以下图表:
     p').length != 0) { copyToClipboard($('#fullgraphBTService13_snippet > p').html()); } else { copyToClipboard($('#fullgraphBTService13_snippet').html()); }Copy Example   
【虚幻4翻译文档-13.创建 Decorator 节点 | Unreal Engine】[虚幻4中文文档]



    Begin Object Class=K2Node_FunctionEntry Name="K2Node_FunctionEntry_232"   Begin Object Class=EdGraphPin Name="EdGraphPin_2024"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2025"   End Object   Begin Object Name="EdGraphPin_2024"      PinName="then"      Direction=EGPD_Output      PinType=(PinCategory="exec")      LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6389'   End Object   Begin Object Name="EdGraphPin_2025"      PinName="OwnerActor"      PinToolTip="Owner Actor\nActor Reference"      Direction=EGPD_Output      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')      LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6392'   End Object   SignatureClass=Class'/Script/AIModule.BTDecorator_BlueprintBase'   SignatureName="PerformConditionCheck"   Pins(0)=EdGraphPin'EdGraphPin_2024'   Pins(1)=EdGraphPin'EdGraphPin_2025'   NodePosX=-528   NodePosY=128   NodeGuid=0A0113274C6A45583FC0029DF5C0B42AEnd ObjectBegin Object Class=K2Node_FunctionResult Name="K2Node_FunctionResult_0"   Begin Object Class=EdGraphPin Name="EdGraphPin_2018"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2019"   End Object   Begin Object Name="EdGraphPin_2018"      PinName="execute"      PinType=(PinCategory="exec")      LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_2031'   End Object   Begin Object Name="EdGraphPin_2019"      PinName="ReturnValue"      PinToolTip="Return Value\nBoolean"      PinType=(PinCategory="bool")      DefaultValue="false"      AutogeneratedDefaultValue="false"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_39752.EdGraphPin_2117'   End Object   SignatureClass=Class'/Script/AIModule.BTDecorator_BlueprintBase'   SignatureName="PerformConditionCheck"   Pins(0)=EdGraphPin'EdGraphPin_2018'   Pins(1)=EdGraphPin'EdGraphPin_2019'   NodePosX=928   NodePosY=128   NodeGuid=DD04EA414F688EBF13F8C4AF7F135206End ObjectBegin Object Class=K2Node_DynamicCast Name="K2Node_DynamicCast_1392"   Begin Object Class=EdGraphPin Name="EdGraphPin_6389"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_6390"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_6391"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_6392"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_6393"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_6394"   End Object   Begin Object Name="EdGraphPin_6389"      PinName="execute"      PinType=(PinCategory="exec")      LinkedTo(0)=EdGraphPin'K2Node_FunctionEntry_232.EdGraphPin_2024'   End Object   Begin Object Name="EdGraphPin_6390"      PinName="then"      Direction=EGPD_Output      PinType=(PinCategory="exec")      LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_2030'   End Object   Begin Object Name="EdGraphPin_6391"      PinName="CastFailed"      Direction=EGPD_Output      PinType=(PinCategory="exec")   End Object   Begin Object Name="EdGraphPin_6392"      PinName="Object"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/CoreUObject.Object')      LinkedTo(0)=EdGraphPin'K2Node_FunctionEntry_232.EdGraphPin_2025'   End Object   Begin Object Name="EdGraphPin_6393"      PinName="AsFollower AI CON"      Direction=EGPD_Output      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')      LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_2032'   End Object   Begin Object Name="EdGraphPin_6394"      PinName="bSuccess"      Direction=EGPD_Output      PinType=(PinCategory="bool")      bHidden=True   End Object   TargetType=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C'   Pins(0)=EdGraphPin'EdGraphPin_6389'   Pins(1)=EdGraphPin'EdGraphPin_6390'   Pins(2)=EdGraphPin'EdGraphPin_6391'   Pins(3)=EdGraphPin'EdGraphPin_6392'   Pins(4)=EdGraphPin'EdGraphPin_6393'   Pins(5)=EdGraphPin'EdGraphPin_6394'   NodePosX=-192   NodePosY=144   NodeGuid=735B1F0141DBFBCA06C2CEB84A6936B4End ObjectBegin Object Class=K2Node_VariableSet Name="K2Node_VariableSet_421"   Begin Object Class=EdGraphPin Name="EdGraphPin_2030"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2031"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2032"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2033"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2034"   End Object   Begin Object Name="EdGraphPin_2030"      PinName="execute"      PinType=(PinCategory="exec")      LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6390'   End Object   Begin Object Name="EdGraphPin_2031"      PinName="then"      Direction=EGPD_Output      PinType=(PinCategory="exec")      LinkedTo(0)=EdGraphPin'K2Node_FunctionResult_0.EdGraphPin_2018'   End Object   Begin Object Name="EdGraphPin_2032"      PinName="AI_CON_Ref"      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')      LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6393'   End Object   Begin Object Name="EdGraphPin_2033"      PinName="Output_Get"      PinToolTip="Retrieves the value of the variable, can use instead of a separate Get node"      Direction=EGPD_Output      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')   End Object   Begin Object Name="EdGraphPin_2034"      PinName="self"      PinFriendlyName="Target"      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')      bHidden=True   End Object   VariableReference=(MemberName="AI_CON_Ref",bSelfContext=True)   Pins(0)=EdGraphPin'EdGraphPin_2030'   Pins(1)=EdGraphPin'EdGraphPin_2031'   Pins(2)=EdGraphPin'EdGraphPin_2032'   Pins(3)=EdGraphPin'EdGraphPin_2033'   Pins(4)=EdGraphPin'EdGraphPin_2034'   NodePosX=80   NodePosY=144   NodeGuid=38C59DC54CFF01BBAA134EA5044A5015End ObjectBegin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_123506"   Begin Object Class=EdGraphPin Name="EdGraphPin_2045"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2046"   End Object   Begin Object Name="EdGraphPin_2045"      PinName="self"      PinFriendlyName="Target"      PinToolTip="Target\nController Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Controller')      LinkedTo(0)=EdGraphPin'K2Node_VariableGet_624.EdGraphPin_2051'   End Object   Begin Object Name="EdGraphPin_2046"      PinName="ReturnValue"      PinToolTip="Return Value\nPawn Reference"      Direction=EGPD_Output      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Pawn')      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30834.EdGraphPin_2057'   End Object   bIsPureFunc=True   bIsConstFunc=True   FunctionReference=(MemberParentClass=Class'/Script/Engine.Controller',MemberName="K2_GetPawn")   Pins(0)=EdGraphPin'EdGraphPin_2045'   Pins(1)=EdGraphPin'EdGraphPin_2046'   NodePosX=-240   NodePosY=384   NodeGuid=431AF3184AEF62590716B7AFBC166188End ObjectBegin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_624"   Begin Object Class=EdGraphPin Name="EdGraphPin_2051"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2052"   End Object   Begin Object Name="EdGraphPin_2051"      PinName="AI_CON_Ref"      Direction=EGPD_Output      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_123506.EdGraphPin_2045'   End Object   Begin Object Name="EdGraphPin_2052"      PinName="self"      PinFriendlyName="Target"      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')      bHidden=True   End Object   VariableReference=(MemberName="AI_CON_Ref",bSelfContext=True)   Pins(0)=EdGraphPin'EdGraphPin_2051'   Pins(1)=EdGraphPin'EdGraphPin_2052'   NodePosX=-416   NodePosY=384   NodeGuid=D0D08EBC43D0D16966A4379430CA4038End ObjectBegin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_30834"   Begin Object Class=EdGraphPin Name="EdGraphPin_2057"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2058"   End Object   Begin Object Name="EdGraphPin_2057"      PinName="self"      PinFriendlyName="Target"      PinToolTip="Target\nActor Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_123506.EdGraphPin_2046'   End Object   Begin Object Name="EdGraphPin_2058"      PinName="ReturnValue"      PinToolTip="Return Value\nVector "      Direction=EGPD_Output      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')      DefaultValue="0, 0, 0"      AutogeneratedDefaultValue="0, 0, 0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31029.EdGraphPin_2089'   End Object   bIsPureFunc=True   bIsConstFunc=True   FunctionReference=(MemberParentClass=Class'/Script/Engine.Actor',MemberName="K2_GetActorLocation")   Pins(0)=EdGraphPin'EdGraphPin_2057'   Pins(1)=EdGraphPin'EdGraphPin_2058'   NodePosX=16   NodePosY=384   NodeGuid=07C3199047638F25D389BCB6D5AA4B65End ObjectBegin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_30917"   Begin Object Class=EdGraphPin Name="EdGraphPin_2081"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2082"   End Object   Begin Object Name="EdGraphPin_2081"      PinName="self"      PinFriendlyName="Target"      PinToolTip="Target\nActor Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_26123.EdGraphPin_2129'   End Object   Begin Object Name="EdGraphPin_2082"      PinName="ReturnValue"      PinToolTip="Return Value\nVector "      Direction=EGPD_Output      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')      DefaultValue="0, 0, 0"      AutogeneratedDefaultValue="0, 0, 0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31029.EdGraphPin_2088'   End Object   bIsPureFunc=True   bIsConstFunc=True   FunctionReference=(MemberParentClass=Class'/Script/Engine.Actor',MemberName="K2_GetActorLocation")   Pins(0)=EdGraphPin'EdGraphPin_2081'   Pins(1)=EdGraphPin'EdGraphPin_2082'   NodePosX=16   NodePosY=288   NodeGuid=895F88654C27F0C5BCA2E2A8F868C28CEnd ObjectBegin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_31029"   Begin Object Class=EdGraphPin Name="EdGraphPin_2087"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2088"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2089"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2090"   End Object   Begin Object Name="EdGraphPin_2087"      PinName="self"      PinFriendlyName="Target"      PinToolTip="Target\nKismet Math Library Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')      DefaultObject=Default__KismetMathLibrary      bHidden=True   End Object   Begin Object Name="EdGraphPin_2088"      PinName="A"      PinToolTip="A\nVector "      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')      DefaultValue="0, 0, 0"      AutogeneratedDefaultValue="0, 0, 0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30917.EdGraphPin_2082'   End Object   Begin Object Name="EdGraphPin_2089"      PinName="B"      PinToolTip="B\nVector "      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')      DefaultValue="0, 0, 0"      AutogeneratedDefaultValue="0, 0, 0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30834.EdGraphPin_2058'   End Object   Begin Object Name="EdGraphPin_2090"      PinName="ReturnValue"      PinToolTip="Return Value\nVector "      Direction=EGPD_Output      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')      DefaultValue="0, 0, 0"      AutogeneratedDefaultValue="0, 0, 0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31141.EdGraphPin_2100'   End Object   bIsPureFunc=True   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="Subtract_VectorVector")   Pins(0)=EdGraphPin'EdGraphPin_2087'   Pins(1)=EdGraphPin'EdGraphPin_2088'   Pins(2)=EdGraphPin'EdGraphPin_2089'   Pins(3)=EdGraphPin'EdGraphPin_2090'   NodePosX=240   NodePosY=352   NodeGuid=5A8D334A4D575676CD7D149EB17AFD8BEnd ObjectBegin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_31141"   Begin Object Class=EdGraphPin Name="EdGraphPin_2099"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2100"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2101"   End Object   Begin Object Name="EdGraphPin_2099"      PinName="self"      PinFriendlyName="Target"      PinToolTip="Target\nKismet Math Library Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')      DefaultObject=Default__KismetMathLibrary      bHidden=True   End Object   Begin Object Name="EdGraphPin_2100"      PinName="A"      PinToolTip="A\nVector "      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')      DefaultValue="0, 0, 0"      AutogeneratedDefaultValue="0, 0, 0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31029.EdGraphPin_2090'   End Object   Begin Object Name="EdGraphPin_2101"      PinName="ReturnValue"      PinToolTip="Return Value\nFloat"      Direction=EGPD_Output      PinType=(PinCategory="float")      DefaultValue="0.0"      AutogeneratedDefaultValue="0.0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_39752.EdGraphPin_2115'   End Object   bIsPureFunc=True   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="VSize")   Pins(0)=EdGraphPin'EdGraphPin_2099'   Pins(1)=EdGraphPin'EdGraphPin_2100'   Pins(2)=EdGraphPin'EdGraphPin_2101'   NodePosX=352   NodePosY=352   NodeGuid=82F21A114631FECA2AE22AA74D0DF02DEnd ObjectBegin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_151"   Begin Object Class=EdGraphPin Name="EdGraphPin_2108"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2109"   End Object   Begin Object Name="EdGraphPin_2108"      PinName="AcceptableDistance"      Direction=EGPD_Output      PinType=(PinCategory="float")      DefaultValue="0.0"      AutogeneratedDefaultValue="0.0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_39752.EdGraphPin_2116'   End Object   Begin Object Name="EdGraphPin_2109"      PinName="self"      PinFriendlyName="Target"      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')      bHidden=True   End Object   VariableReference=(MemberName="AcceptableDistance",bSelfContext=True)   Pins(0)=EdGraphPin'EdGraphPin_2108'   Pins(1)=EdGraphPin'EdGraphPin_2109'   NodePosX=368   NodePosY=432   NodeGuid=7CDE1FD54D772AEF57C5F693ED511A8EEnd ObjectBegin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_39752"   Begin Object Class=EdGraphPin Name="EdGraphPin_2114"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2115"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2116"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2117"   End Object   Begin Object Name="EdGraphPin_2114"      PinName="self"      PinFriendlyName="Target"      PinToolTip="Target\nKismet Math Library Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')      DefaultObject=Default__KismetMathLibrary      bHidden=True   End Object   Begin Object Name="EdGraphPin_2115"      PinName="A"      PinToolTip="A\nFloat"      PinType=(PinCategory="float")      DefaultValue="0.0"      AutogeneratedDefaultValue="0.0"      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31141.EdGraphPin_2101'   End Object   Begin Object Name="EdGraphPin_2116"      PinName="B"      PinToolTip="B\nFloat"      PinType=(PinCategory="float")      DefaultValue="0.0"      AutogeneratedDefaultValue="0.0"      LinkedTo(0)=EdGraphPin'K2Node_VariableGet_151.EdGraphPin_2108'   End Object   Begin Object Name="EdGraphPin_2117"      PinName="ReturnValue"      PinToolTip="Return Value\nBoolean"      Direction=EGPD_Output      PinType=(PinCategory="bool")      DefaultValue="false"      AutogeneratedDefaultValue="false"      LinkedTo(0)=EdGraphPin'K2Node_FunctionResult_0.EdGraphPin_2019'   End Object   bIsPureFunc=True   FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="GreaterEqual_FloatFloat")   Pins(0)=EdGraphPin'EdGraphPin_2114'   Pins(1)=EdGraphPin'EdGraphPin_2115'   Pins(2)=EdGraphPin'EdGraphPin_2116'   Pins(3)=EdGraphPin'EdGraphPin_2117'   NodePosX=544   NodePosY=384   NodeGuid=D75D724E47942AC9F4D77F987B81AD57End ObjectBegin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_26123"   Begin Object Class=EdGraphPin Name="EdGraphPin_2126"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2127"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2128"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2129"   End Object   Begin Object Name="EdGraphPin_2126"      PinName="self"      PinFriendlyName="Target"      PinToolTip="Target\nBTFunction Library Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/AIModule.BTFunctionLibrary')      DefaultObject=Default__BTFunctionLibrary      bHidden=True   End Object   Begin Object Name="EdGraphPin_2127"      PinName="NodeOwner"      PinToolTip="Node Owner\nBTNode Reference"      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/AIModule.BTNode')      bHidden=True   End Object   Begin Object Name="EdGraphPin_2128"      PinName="Key"      PinToolTip="Key\nBlackboard Key Selector Structure (by ref)"      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/AIModule.BehaviorTreeTypes:BlackboardKeySelector',bIsReference=True,bIsConst=True)      LinkedTo(0)=EdGraphPin'K2Node_VariableGet_111.EdGraphPin_2138'      bDefaultValueIsIgnored=True   End Object   Begin Object Name="EdGraphPin_2129"      PinName="ReturnValue"      PinToolTip="Return Value\nActor Reference"      Direction=EGPD_Output      PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30917.EdGraphPin_2081'   End Object   bIsPureFunc=True   FunctionReference=(MemberParentClass=Class'/Script/AIModule.BTFunctionLibrary',MemberName="GetBlackboardValueAsActor")   Pins(0)=EdGraphPin'EdGraphPin_2126'   Pins(1)=EdGraphPin'EdGraphPin_2127'   Pins(2)=EdGraphPin'EdGraphPin_2128'   Pins(3)=EdGraphPin'EdGraphPin_2129'   NodePosX=-256   NodePosY=288   ErrorType=1   ErrorMsg="Error Default value \'\' for  Key  is invalid: \'Literal values are not allowed for pass-by-reference parameters.\'"   NodeGuid=FF6A2DB4475BFE05D0CA1EB0D698BB0AEnd ObjectBegin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_111"   Begin Object Class=EdGraphPin Name="EdGraphPin_2138"   End Object   Begin Object Class=EdGraphPin Name="EdGraphPin_2139"   End Object   Begin Object Name="EdGraphPin_2138"      PinName="TargetToFollow"      Direction=EGPD_Output      PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/AIModule.BehaviorTreeTypes:BlackboardKeySelector')      LinkedTo(0)=EdGraphPin'K2Node_CallFunction_26123.EdGraphPin_2128'   End Object   Begin Object Name="EdGraphPin_2139"      PinName="self"      PinFriendlyName="Target"      PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')      bHidden=True   End Object   VariableReference=(MemberName="TargetToFollow",bSelfContext=True)   Pins(0)=EdGraphPin'EdGraphPin_2138'   Pins(1)=EdGraphPin'EdGraphPin_2139'   NodePosX=-416   NodePosY=288   NodeGuid=7E75B438413B960D40E5A68DECD346A2End Object     p').length != 0) { copyToClipboard($('#fullgraphBTService13_snippet > p').html()); } else { copyToClipboard($('#fullgraphBTService13_snippet').html()); }
点击图片将其展开,或点击 此处
在窗口中打开。

【虚幻4翻译文档-13.创建 Decorator 节点 | Unreal Engine】[虚幻4中文文档]



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



变量名
类型
数值

AI_CON_RefFollower_AI_CON_C无AcceptableDistanceFloat0.0 - 但此变量的“可编辑”标记为 True,因此可在行为树中根据实例进行变更。TargetToFollowBlackboardKeySelector无 - 但此变量的“可编辑”标记为 True,因此可在行为树中根据实例进行变更。
因其为功能图表,如使用上方图表图片中的 Code Snippet,只能获取图表的中央部分,首尾两端的节点将不会被连接。只需依据图片所示连接节点便可正常执行。

当行为树根据条件命中一个节点时,事件 Receive Condition Check 将被发送至该蓝图。

保存 AI 控制器以便日后轻松参考。

获取需要追踪的 Actor(玩家 Pawn)。

获取该 Actor 和 AI Pawn 之间的距离。

如距离大于可配置量,则条件将返回 True。如小于可配置量,则返回 False,并阻止其所在行为树部分的执行。

这可使其正常工作,避免行为树不断循环至 RapidMoveTo,导致 AI 反复行动。基本上而言,AI 抓住玩家后便会停止行动。



   
Previous Step
Next Step



   
Quick Start Home
回复

使用道具 举报

0

主题

896

帖子

2985

积分

vip会员

Rank: 1

积分
2985
发表于 2016-7-2 18:58:35 来自手机 | 显示全部楼层
谢谢楼主分享
回复 支持 反对

使用道具 举报

0

主题

905

帖子

2970

积分

vip会员

Rank: 1

积分
2970
发表于 2016-7-3 21:43:26 | 显示全部楼层
好这个应该还行,自己懒得找了
回复 支持 反对

使用道具 举报

0

主题

882

帖子

2933

积分

vip会员

Rank: 1

积分
2933
发表于 2016-7-4 11:00:15 来自手机 | 显示全部楼层
来看看......
回复 支持 反对

使用道具 举报

0

主题

859

帖子

2817

积分

vip会员

Rank: 1

积分
2817
发表于 2016-7-15 02:50:05 来自手机 | 显示全部楼层
楼主好人!
回复 支持 反对

使用道具 举报

0

主题

831

帖子

2752

积分

vip会员

Rank: 1

积分
2752
发表于 2016-7-15 10:53:36 | 显示全部楼层
恩,好资源~ 哈哈~
回复 支持 反对

使用道具 举报

0

主题

849

帖子

2751

积分

vip会员

Rank: 1

积分
2751
发表于 2016-7-19 00:51:25 来自手机 | 显示全部楼层
啊啊啊啊,好多好多好多
回复 支持 反对

使用道具 举报

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

本版积分规则

 
 



邮件留言:


 
返回顶部