Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/bomberdisarm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function script.Create()
Turn(Rwing, z_axis, math.rad(-90))
Turn(LwingTip, z_axis, math.rad(-165))
Turn(RwingTip, z_axis, math.rad(165))
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
end

Expand All @@ -39,7 +39,7 @@ function script.Deactivate()
Turn(Rwing, z_axis, math.rad(-10), 2)
Turn(LwingTip, z_axis, math.rad(-30), 2) -- -30
Turn(RwingTip, z_axis, math.rad(30), 2) --30
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end

function script.FireWeapon(checkHeight)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bomberheavy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ end

function script.StopMoving()
StartThread(Stopping)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end

local function ShowBallWhenConstructionFinished()
Expand Down Expand Up @@ -203,7 +203,7 @@ function script.Create()
Hide(radiator_R)

SetInitialBomberSettings()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)

StartThread(ShowBallWhenConstructionFinished)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bomberheavyold.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ end

function script.StopMoving()
StartThread(Stopping)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end

function script.Create()
SetInitialBomberSettings()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
Hide(rearthrust)
Hide(wingthrust1)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bomberprec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function script.StopMoving()
Move(wingr2, x_axis, 5, 30)
Move(wingl1, x_axis, -5, 30)
Move(wingl2, x_axis, -5, 30)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end

local function Lights()
Expand All @@ -68,7 +68,7 @@ end

function script.Create()
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
GG.FakeUpright.FakeUprightInit(xp, zp, drop)
--StartThread(Lights)
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/bomberriot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ local function Lights()
end

function script.StopMoving()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end

function script.Create()
SetInitialBomberSettings()
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
--StartThread(Lights)
end

Expand Down
4 changes: 2 additions & 2 deletions scripts/bomberstrike.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ end

function script.Create()
SetInitialBomberSettings()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.Script.SmokeUnit, unitID, {wingtipl, wingtipr, head})
Turn(turret, y_axis, math.pi)
Move(wingl, x_axis, -5, 7)
Expand All @@ -64,7 +64,7 @@ end
function script.StopMoving()
Move(wingl, x_axis, -5, 7)
Move(wingr, x_axis, 5, 7)
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end

function script.AimWeapon(num, heading, pitch)
Expand Down
6 changes: 3 additions & 3 deletions scripts/fixedwingTakeOff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ if GG.TakeOffFuncs then
end
GG.TakeOffFuncs = {}

function GG.TakeOffFuncs.NotTakingOff()
function GG.TakeOffFuncs.NotTakingOff(unitID)
local state = Spring.GetUnitMoveTypeData(unitID)
return state and (state.aircraftState ~= "takeoff")
end

function GG.TakeOffFuncs.TakeOffThread(height, signal)
function GG.TakeOffFuncs.TakeOffThread(unitID, height, signal)
local FUDGE_FACTOR = 1.5

Signal(signal)
SetSignalMask(signal)
while GG.TakeOffFuncs.NotTakingOff() do
while GG.TakeOffFuncs.NotTakingOff(unitID) do
Sleep(1000)
end
for i = 1, 5 do
Expand Down
4 changes: 2 additions & 2 deletions scripts/planelightscout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ function SprintDetonate()
end

function script.StopMoving()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end

function script.Create()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
end

Expand Down
4 changes: 2 additions & 2 deletions scripts/planescout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ function Cloak()
end

function script.StopMoving()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
end


function script.Create()
StartThread(GG.TakeOffFuncs.TakeOffThread, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.TakeOffFuncs.TakeOffThread, unitID, takeoffHeight, SIG_TAKEOFF)
StartThread(GG.Script.SmokeUnit, unitID, smokePiece)
end

Expand Down