UserFunction; SobGroup_ExitHyperSpaceDirection - HWRM/KarosGraveyard Wiki

SobGroup_ExitHyperSpaceDirection(<sSobGroupName>, <fRotation>)

Description

Here is a script to trigger a sobgroup to exit from hyperspace at a specific rotation on the z plane ( hw2 y plane). So 90 will point east.
Same process as SobGroup_ExitHyperSpace.

Example

SobGroup_ExitHyperSpaceDirection("sg_Fighter", 90)

Arguments

<sSobGroupName>: the name of the sobgroup.
<fRotation>: direction to point in degrees.

Definition

li_Gindex = 0
function SobGroup_ExitHyperSpaceDirection(Sobgroup, Angle)
   
   local iNumberHyper = SobGroup_SplitGroupReference("sg_Hsplit", Sobgroup, Sobgroup, SobGroup_Count(Sobgroup))
   
    if iNumberHyper >0 then
        for i = 1, iNumberHyper do
            local hyp_table = SobGroup_GetPosition("sg_Hsplit"..i)
            hyp_table[1] = 10 * sin(Angle) + hyp_table[1]
            hyp_table[3] = 10 * cos(Angle) + hyp_table[3]
 
            Volume_AddSphere("vol_exit"..li_Gindex, hyp_table, 10)
            SobGroup_ExitHyperSpace("sg_Hsplit"..i, "vol_exit"..li_Gindex)
            li_Gindex = li_Gindex + 1
        end
    end
end

Note needs Apollyon470 SobGroup_SplitGroupReference to work

Comments

Page Status

Updated Formatting? Initial
Updated for HWRM? Initial