ForbodingAngel

Untitled

Sep 16th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. base, turret, nanos, nanopoint1, nanopoint2, dirt = piece('base', 'turret', 'nanos', 'nanopoint1', 'nanopoint2', 'dirt')
  2. local SIG_AIM = {}
  3.  
  4. -- state variables
  5. isMoving = "isMoving"
  6. terrainType = "terrainType"
  7.  
  8. function script.Create()
  9. StartThread(common.SmokeUnit, {base, turret, barrel1})
  10. StartThread(doYouEvenLift)
  11. local building = false
  12. end
  13.  
  14. common = include("headers/common_includes_lus.lua")
  15.  
  16. function script.StartMoving()
  17. isMoving = true
  18. StartThread(thrust)
  19. end
  20.  
  21. function script.StopMoving()
  22. isMoving = false
  23. end
  24.  
  25. function doYouEvenLift()
  26. common.HbotLift()
  27. end
  28.  
  29. function thrust()
  30. common.DirtTrail()
  31. end
  32.  
  33. local function RestoreAfterDelay()
  34. Sleep(2000)
  35. Turn(turret, y_axis, 0, 5)
  36. end
  37.  
  38. local nanoPoints = {}
  39. -- FIXME: this example has 2 nano pieces to alternate between
  40. for i = 1, 2 do
  41. -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model
  42. nanoPoints[i] = piece("nanopoint" .. i)
  43. end
  44. Spring.SetUnitNanoPieces(unitID, nanoPoints)
  45.  
  46. function script.StartBuilding(heading, pitch)
  47. -- TODO: This is where you would add your unpack / point towards animation
  48. Turn(turret, y_axis, heading, 100)
  49. SetUnitValue(COB.INBUILDSTANCE, true)
  50. local building = true
  51. while(building == true) do
  52. EmitSfx (nanopoint1, 1024)
  53. EmitSfx (nanopoint2, 1024)
  54. Sleep(500)
  55. end
  56. end
  57. function script.StopBuilding()
  58. -- TODO: This is where you would add your pack-up animation
  59. SetUnitValue(COB.INBUILDSTANCE, false)
  60. local building = false
  61. --StartThread(RestoreAfterDelay)
  62.  
  63. end
  64.  
  65. function script.Killed()
  66. Explode(nanos, SFX.EXPLODE_ON_HIT)
  67. Explode(turret, SFX.EXPLODE_ON_HIT)
  68. Explode(base, SFX.EXPLODE_ON_HIT)
  69. return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos
  70. end
Advertisement
Add Comment
Please, Sign In to add comment