Have no experience with friendly AI myself, but i think you need some scripts for their behaviour/movement. Not sure if you could simply do it with nodes in radiant only. At least here's some info on the types of nodes, and prob some more info about AI on that site as well:
For starters they don't like to move with the command of
Code Snippet
Plaintext
SetGoalPos(mg.pos)
instead try to use
Code Snippet
Plaintext
SetGoalNode(node)
. Also unlike enemy AI friendlies can't be sent to the same node or goal position like you can with enemies. If you send friendlies to the same goal node only one of them will move and the rest will stay, so be sure to make use of
Code Snippet
Plaintext
IsNodeOccupied(node)
.
PS: for enemy AI the function IsNodeOccupied() is always false
Last Edit: August 28, 2017, 07:36:16 pm by buttkicker845
For starters they don't like to move with the command of
Code Snippet
Plaintext
SetGoalPos(mg.pos)
instead try to use
Code Snippet
Plaintext
SetGoalNode(node)
. Also unlike enemy AI friendlies can't be sent to the same node or goal position like you can with enemies. If you send friendlies to the same goal node only one of them will move and the rest will stay, so be sure to make use of
Code Snippet
Plaintext
IsNodeOccupied(node)
.
PS: for enemy AI the function IsNodeOccupied() is always false
tbh im not experienced when using those lines of code that you sent me m8..can you explain to me how i add them in?
also i know what the nodes do and all and ive managed to get enemy AI to work fine! just friendly ai im having problems with
It would be hard to just tell you where to place these functions since all used for deciding where you want AI to navigate to. The SetGoalNode(node) is for sending the AI to a location after you've decided which node you want to send them to.
If you want to send an AI to an objective you do so by
Code Snippet
Plaintext
//Note: this simply moves an AI to the objective position, doesn't account for the fact that there may already be someone there nodes = level GetAllNodes(); moveToNode = getClosest(objective.origin, nodes); ai SetGoalNode(moveToNode);
Need to use to ensure that the AI is able to move to the node, if the node is occupied the AI will not move
Code Snippet
Plaintext
nodes = level GetAllNodes(); moveToNode = getClosest(objective.origin, nodes); //this will move the AI to node only if it isnt being occupied by another friendly AI If(!IsNodeOccupied(moveToNode)) { ai SetGoalNode(moveToNode); }
I hope that helps you under stand how to use these functions together to allow your AI to move
It would be hard to just tell you where to place these functions since all used for deciding where you want AI to navigate to. The SetGoalNode(node) is for sending the AI to a location after you've decided which node you want to send them to.
If you want to send an AI to an objective you do so by
Code Snippet
Plaintext
//Note: this simply moves an AI to the objective position, doesn't account for the fact that there may already be someone there nodes = level GetAllNodes(); moveToNode = getClosest(objective.origin, nodes); ai SetGoalNode(moveToNode);
Need to use to ensure that the AI is able to move to the node, if the node is occupied the AI will not move
Code Snippet
Plaintext
nodes = level GetAllNodes(); moveToNode = getClosest(objective.origin, nodes); //this will move the AI to node only if it isnt being occupied by another friendly AI If(!IsNodeOccupied(moveToNode)) { ai SetGoalNode(moveToNode); }
I hope that helps you under stand how to use these functions together to allow your AI to move