Code:
Original
=======================================================
VGR_HEAVYMISSILEFRIGATE_CodeRed_OnSet = function(ship)
setState(ship, "CodeRed", 0)
-- don't do this twice!
if(isAnimRunning(ship,"Open") == 0) then
startTime = 0
-- close already running? need to offset in to the open animation
if(isAnimRunning(ship,"Close") ~= 0) then
startTime = getAnimLength(ship, "Close") - getTime(ship, "Close")
stopAnim(ship, "Close")
endEffect(ship, "Close")
end
startAnim(ship, "Open")
startEffect(ship, "Open")
setTime(ship,"Open",startTime)
setPauseTime(ship, "Open", 1000)
end
end
VGR_HEAVYMISSILEFRIGATE_CodeRed_OnPause = function(ship)
setState(ship, "CodeRed", 1)
end
VGR_HEAVYMISSILEFRIGATE_CodeGreen_OnSet = function(ship)
-- already closing?
if(isAnimRunning(ship,"Close") == 0) then
startTime = 0
-- open already running? need to offset in to the close animation
if(isAnimRunning(ship,"Open") ~= 0) then
startTime = getAnimLength(ship, "Open") - getTime(ship, "Open")
stopAnim(ship, "Open")
endEffect(ship, "Open")
end
startAnim(ship, "Close")
startEffect(ship, "Close")
setTime(ship,"Close",startTime)
setPauseTime(ship, "Close", 1000)
end
end
Modified
=======================================================
HGN_SMT_SUPERACOLYTE_CodeRed_OnSet = function(ship)
if(isAnimRunning(ship,"Open") == 0) then
startTime = 0
-- close already running? need to offset in to the open animation
if(isAnimRunning(ship,"Close") ~= 0) then
startTime = getAnimLength(ship, "Close") - getTime(ship, "Close")
stopAnim(ship, "Close")
-- endEffect(ship, "Close")
end
startAnim(ship, "Open")
-- startEffect(ship, "Open")
setTime(ship,"Open",startTime)
setPauseTime(ship, "Open", 3)
end
end
HGN_SMT_SUPERACOLYTE_CodeGreen_OnSet = function(ship)
-- already closing?
if(isAnimRunning(ship,"Close") == 0) then
startTime = 0
-- open already running? need to offset in to the close animation
if(isAnimRunning(ship,"Open") ~= 0) then
startTime = getAnimLength(ship, "Open") - getTime(ship, "Open")
stopAnim(ship, "Open")
-- endEffect(ship, "Open")
end
startAnim(ship, "Close")
-- startEffect(ship, "Close")
setTime(ship,"Close",startTime)
setPauseTime(ship, "Close", 3)
end
end
I'll tell you all that I only figured this out because I got quite frustrated and finally decided to strip down the code to almost nothing, it just read, on onset codered, open and that was it. This paves the way for the animations on the Turanic Ion Cannon, Kushan Defenders, Somtaaw Acolyte and any others that need it.