Re: How to make allies that will follow the player and kill the enemies?

How do you want to set it up?

I just imagined a simple scenario where you have to free someone to become your ally.
You could use a switch that opens a gate where the AI (faction: Civilian) becomes your ally (faction:Player) then follows you.
Check the flowgraph below:

Code: Select all

<Graph Description="" Group="FG"> <Nodes> <Node Id="59" Class="AISequence:Start" pos="-252,659.4361,0" EntityGUID="62b176c2-1b68-3824-9bf4-0f0f60f1668f"> <Inputs entityId="0" Interruptible="1" ResumeAfterInterruption="1"/> </Node> <Node Id="60" Class="AISequence:End" pos="450,666,0" EntityGUID="62b176c2-1b68-3824-9bf4-0f0f60f1668f"> <Inputs entityId="0"/> </Node> <Node Id="61" Class="AISequence:Move" pos="72,659.4361,0" EntityGUID="62b176c2-1b68-3824-9bf4-0f0f60f1668f"> <Inputs entityId="0" Speed="1" Stance="0" DestinationEntity="0" Position="0,0,0" Direction="0,0,0" EndDistance="5"/> </Node> <Node Id="62" Class="Entity:GetPos" pos="72,864,0"> <Inputs entityId="0" CoordSys="1"/> </Node> <Node Id="63" Class="Actor:LocalPlayer" pos="72,828,0"> <Inputs /> </Node> <Node Id="65" Class="Logic:Any" pos="-666,720,0" InHideMask="1017"> <Inputs /> </Node> <Node Id="66" Name="Follow_player" Class="_commentbox" pos="-1116,593.55261,0"> <Inputs TextSize="1" Color="0.27451,0.352941,0.705882" DisplayFilled="1" DisplayBox="1" SortPriority="16"/> <ResizeBorder X="0" Y="0" Width="1764" Height="504"/> <NodeSize Width="1764" Height="550.39197"/> </Node> <Node Id="67" Name="Use_gate_to_enable/disable_following_player" Class="_comment" pos="-558,684,0"/> <Node Id="69" Class="Logic:Gate" pos="-486,720,0"> <Inputs Closed="0"/> </Node> <Node Id="70" Name="Start_following_player_for_the_first_time" Class="_comment" pos="-1098,702,0"/> <Node Id="76" Class="Logic:Any" pos="522,1026,0" InHideMask="1022"> <Inputs /> </Node> <Node Id="78" Class="Logic:Any" pos="-774,1026,0" InHideMask="1023" OutHideMask="1"> <Inputs /> </Node> <Node Id="1083" Class="Time:Delay" pos="-144,1026,0"> <Inputs delay="0.5" resetOnInput="0"/> </Node> <Node Id="1094" Class="AI:BehaviorTree" pos="-1062,936,0"> <Inputs entityId="0"/> </Node> <Node Id="1096" Class="Entity:EntityId" pos="-1062,882,0" EntityGUID="62b176c2-1b68-3824-9bf4-0f0f60f1668f"> <Inputs entityId="0"/> </Node> <Node Id="1104" Class="AI:BodyCount" pos="-1062,810,0"> <Inputs /> </Node> <Node Id="1111" Class="Time:Delay" pos="-1062,990,0"> <Inputs delay="1" resetOnInput="0"/> </Node> <Node Id="1113" Name="Reset_behaviour_tree_after_kill" Class="_comment" pos="-1062,792,0"/> <Node Id="1116" Name="(still_needs_an_extra_input_signal)" Class="_comment" pos="-522,702,0"/> <Node Id="1118" Class="Logic:Any" pos="-972,720,0" InHideMask="1023" OutHideMask="1"> <Inputs /> </Node> <Node Id="1135" Class="Entity:PropertySet" pos="-1098,1188,0" EntityGUID="62b176c2-1b68-3824-9bf4-0f0f60f1668f"> <Inputs entityId="0" entityProperties_Property="Properties2:esFaction" Value="Players" perArchetype="1"/> </Node> <Node Id="1141" Class="entity:Switch" pos="-1404,558,0" EntityGUID="bb3d7b7b-9791-ec4d-52cc-f05a4ba88088"> <Inputs entityId="0" Destroyed="0" Disable="0" Enable="0" Hide="0" Hit="0" Switch="0" TurnedOff="0" TurnedOn="0" Unhide="0"/> </Node> </Nodes> <Edges> <Edge nodeIn="61" nodeOut="59" portIn="Start" portOut="Link" enabled="1"/> <Edge nodeIn="76" nodeOut="60" portIn="in1" portOut="Done" enabled="1"/> <Edge nodeIn="60" nodeOut="61" portIn="End" portOut="Done" enabled="1"/> <Edge nodeIn="61" nodeOut="62" portIn="Position" portOut="Pos" enabled="1"/> <Edge nodeIn="62" nodeOut="63" portIn="entityId" portOut="entityId" enabled="1"/> <Edge nodeIn="69" nodeOut="65" portIn="In" portOut="out" enabled="1"/> <Edge nodeIn="59" nodeOut="69" portIn="Start" portOut="Out" enabled="1"/> <Edge nodeIn="62" nodeOut="69" portIn="Get" portOut="Out" enabled="1"/> <Edge nodeIn="1083" nodeOut="76" portIn="in" portOut="out" enabled="1"/> <Edge nodeIn="65" nodeOut="78" portIn="in2" portOut="out" enabled="1"/> <Edge nodeIn="78" nodeOut="1083" portIn="in1" portOut="out" enabled="1"/> <Edge nodeIn="1111" nodeOut="1094" portIn="in" portOut="Done" enabled="1"/> <Edge nodeIn="1094" nodeOut="1096" portIn="entityId" portOut="Id" enabled="1"/> <Edge nodeIn="1094" nodeOut="1104" portIn="Reset" portOut="Total" enabled="1"/> <Edge nodeIn="65" nodeOut="1111" portIn="in3" portOut="out" enabled="1"/> <Edge nodeIn="65" nodeOut="1118" portIn="in1" portOut="out" enabled="1"/> <Edge nodeIn="1104" nodeOut="1118" portIn="Enable" portOut="out" enabled="1"/> <Edge nodeIn="1118" nodeOut="1141" portIn="in1" portOut="UsedBy" enabled="1"/> </Edges> </Graph>
Enjoy :)

Re: How to make allies that will follow the player and kill the enemies?

You need to copy paste the code into your FG.

Then in game:
1. Create Object > Legacy Entity > Other > Switch and place it somewhere.
2. Click on the switch and then in FG right-click on the "entity:Switch" and Assign selected entity.
3. Create Object > Legacy Entity > AI > Characters > Human and place him somewhere. (change his faction to Civilian in the properties)
4. Click on the Character you have just created and assign him in the FG to all the nodes marked with a Yellow dot. (same as in step 2)
5. connect also the "Entity: Switch Used By" port to Entity: PropertySet Set same as on picture
Now when you use the switch the Human will become your ally and shoot the members of the grunt faction.

You can find very helpful Flowgraph tutorials under the following link: ... navigation

Hope this helps!

Re: How to make allies that will follow the player and kill the enemies?

The white boxes are comments rather than nodes. If you are talking about the Behavior Tree Reset node, you can find it by going to: AI -> Behavior Tree.
You can then link to the entity and activate the Reset input when desired.
CRYENGINE Community Coordinator
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Re: How to make allies that will follow the player and kill the enemies?

You could achieve this with the Modular Behavior Tree as well.
I found it easier to make the Flowgraph instead.
Also if for some reason I wanted to make an enemy out of the ally the FG could simply be interrupted with the gate provided within it and the faction changed to grunts
instead of loading another behavior tree. There are many ways of achieving many things. This is only what I came up with.
Feel free to drop your Modular behavior tree here if you got one. It will help out the ppl looking for the same topic.
As for the Flownode AI:BehaviourTree it is unfortunately not available in 5.3 but in 5.4 and above.
5.5 Preview 2 just came out.
May want to give that a go ;)

Who is online

Users browsing this forum: No registered users and 0 guests