Squad.moveTo 2
Orders the squad to hold an area at the specified position with the given radius.
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
squad.moveTo(vec3(30, 0, 25), 5.0);
--- 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