Squad.moveTo 40
Orders the squad to hold an area at the specified position with the given radius.
Make sure that the squad can follow order, and eventually that the squad leader AI has give order feature disabled to avoid squad leader to override your orders
Return value
Return Type | Description |
---|---|
void | This function doesn't return anything |
Parameters
Parameter | Type | Description |
---|---|---|
1 | vec3 | The center position of the area to hold. |
2 | float | The radius of the area to hold. |
Examples
Example 65
squad.moveTo(vec3(30, 0, 25), 5.0);
Example 100
--- acquire myself can be done instantly as soon as a soldier is spawned
local soldier = myself()
--- immediatly disable AI giving orders so i can fully control this unit without squad leader AI overriding my orders
soldier.getAiParams().followCustomSquadOrders()
--- wait for the whole squad to be fully spawned
local condition2 = function() return (soldier.isSquadReady() == true) end
waitUntil(condition2)
local squad = soldier.getSquad();
--- make sure the soldier giving the order is the leader; Not fully mandatory, but I don't want to call this line of code for each soldier, just the leader should give an order
if soldier.isSquadLeader() then
squad.moveTo(vec3(30, 0, 25) ,5)
log("Order given!")
end