UserFunction; SobGroup_MoveDirection - HWRM/KarosGraveyard GitHub Wiki
SobGroup_MoveDirection(<sSobGroupName>, <fRotation>, <Distance>, <iPlayerIndex>)
Here is a script to trigger a sobgroup to move a distance at a angle. Keeping the current spacing between ships.
SobGroup_MoveDirection("sg_Fighter", 90, 3000, 0)
<sSobGroupName>: the name of the sobgroup.
<fRotation>: direction to travel in degrees.
<Distance>: distance of travel
<iPlayerIndex>: the index number of the player.
function SobGroup_MoveDirection(Sobgroup, Angle, Distance, Player)
local iNumberMove = SobGroup_SplitGroupReference("sg_Msplit", Sobgroup, Sobgroup, SobGroup_Count(Sobgroup))
if iNumberMove >0 then
for i = 1, iNumberMove do
local mov_table = SobGroup_GetPosition("sg_Msplit"..i)
mov_table[1] = Distance * sin(Angle) + mov_table[1]
mov_table[3] = Distance * cos(Angle) + mov_table[3]
Volume_AddSphere("vol_move"..li_Gindex, mov_table, 10)
SobGroup_Move(Player, "sg_Msplit"..i, "vol_move"..li_Gindex)
li_Gindex = li_Gindex + 1
end
end
end
Note needs Apollyon470 SobGroup_SplitGroupReference to work
Updated Formatting? Initial
Updated for HWRM? Initial