but as soon as i add the animation part it will move into range and will just sit there animating
for what i think is the buildduration of that to be built. Here's the script which is a modified version of the Example Mod builder:
Code: Select all
local Body = piece "Body"
local FL_Thigh = piece "FL_Thigh"
local FR_Thigh = piece "FR_Thigh"
local BL_Thigh = piece "BL_Thigh"
local BR_Thigh = piece "BR_Thigh"
local FL_Leg = piece "FL_Leg"
local FR_Leg = piece "FR_Leg"
local BL_Leg = piece "BL_Leg"
local BR_Leg = piece "BR_Leg"
local TR_Arm = piece "TR_Arm"
local TL_Arm = piece "TL_Arm"
local ML_Arm = piece "ML_Arm"
local MR_Arm = piece "MR_Arm"
local BL_Arm = piece "BL_Arm"
local BR_Arm = piece "BR_Arm"
local TR_Hand = piece "TR_Hand"
local TL_Hand = piece "TL_Hand"
local ML_Hand = piece "ML_Hand"
local MR_Hand = piece "MR_Hand"
local BL_Hand = piece "BL_Hand"
local BR_Hand = piece "BR_Hand"
local SIG_BUILD = 2
local SIG_BUILDANIM = 3
function script.Create()
return 0
end
local function BuildAnimate(heading)
Signal(SIG_BUILDANIM)
SetSignalMask(SIG_BUILDANIM)
Turn(Body, y_axis, heading, 2)
WaitForTurn(Body, y_axis)
Sleep(50)
while (true) do
Turn(TR_Arm, y_axis, -1, 10)
Turn(TR_Hand, y_axis, -1, 10)
WaitForTurn(TR_Arm, y_axis)
Turn(TL_Arm,y_axis, 1, 10)
Turn(TL_Hand, y_axis, 1, 10)
WaitForTurn(TL_Arm, y_axis)
Turn(TR_Arm,y_axis, 0, 10)
Turn(TR_Hand, y_axis, 0, 10)
WaitForTurn(TR_Arm, y_axis)
Turn(TL_Arm,y_axis, 0, 10)
Turn(TL_Hand, y_axis, 0, 10)
WaitForTurn(TL_Arm, y_axis)
Sleep(10)
Turn(MR_Arm, y_axis, -1, 10)
Turn(MR_Hand, y_axis, -1, 10)
WaitForTurn(MR_Arm, y_axis)
Turn(ML_Arm,y_axis, 1, 5)
Turn(ML_Hand, y_axis, 1, 10)
WaitForTurn(ML_Arm, y_axis)
Turn(MR_Arm,y_axis, 0, 10)
Turn(MR_Hand, y_axis, 0, 10)
WaitForTurn(MR_Arm, y_axis)
Turn(ML_Arm,y_axis, 0, 10)
Turn(ML_Hand, y_axis, 0, 10)
WaitForTurn(ML_Arm, y_axis)
Sleep(10)
Turn(BR_Arm, y_axis, -1, 10)
Turn(BR_Hand, y_axis, -1, 10)
WaitForTurn(BR_Arm, y_axis)
Turn(BL_Arm,y_axis, 1, 10)
Turn(BL_Hand, y_axis, 1, 10)
WaitForTurn(BL_Arm, y_axis)
Turn(BR_Arm,y_axis, 0, 10)
Turn(BR_Hand, y_axis, 0, 10)
WaitForTurn(BR_Arm, y_axis)
Turn(BL_Arm,y_axis, 0, 10)
Turn(BL_Hand, y_axis, 0, 10)
WaitForTurn(BL_Arm, y_axis)
Sleep(10)
end
end
local function StopBuildAnimate()
Turn(Body, y_axis, 0, 2)
WaitForTurn(Body, y_axis)
Turn(TR_Arm, y_axis, 0, 2)
Turn(TR_Hand, y_axis, 0, 2)
Turn(TL_Arm,y_axis, 0, 2)
Turn(TL_Hand, y_axis, 0, 2)
Turn(MR_Arm, y_axis, 0, 2)
Turn(MR_Hand, y_axis, 0, 2)
Turn(ML_Arm,y_axis, 0, 2)
Turn(ML_Hand, y_axis, 0, 2)
Turn(BR_Arm, y_axis, 0, 2)
Turn(BR_Hand, y_axis, 0, 2)
Turn(BL_Arm,y_axis, 0, 2)
Turn(BL_Hand, y_axis, 0, 2)
end
function script.StartBuilding(heading, pitch)
Signal(SIG_BUILD)
SetSignalMask(SIG_BUILD)
BuildAnimate(heading)
Turn(Body, y_axis, heading, 1)
WaitForTurn(Body, y_axis)
Sleep(50)
endSetUnitValue(COB.INBUILDSTANCE, 1)
return 1
end
function script.StopBuilding()
Signal(SIG_BUILD)
SetSignalMask(SIG_BUILD)
SetUnitValue(COB.INBUILDSTANCE, 0)
Signal(SIG_BUILDANIM)
StopBuildAnimate()
Sleep(1)
return 0
end
function script.QueryNanoPiece() return TL_Hand end
function script.AimFromWeapon() return TL_Hand end
function script.Killed(recentDamage, maxHealth)
return 0
end
(and sorry if this is a bit blunt or newbie-ridden)