Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #****************************************************************************
- #**
- #** File : /cdimage/units/UAL0101/UAL0101_script.lua
- #** Author(s): John Comes, David Tomandl, Jessica St. Croix
- #**
- #** Summary : Aeon Land Scout Script
- #**
- #** Copyright © 2005 Gas Powered Games, Inc. All rights reserved.
- #****************************************************************************
- local AHoverLandUnit = import('/lua/aeonunits.lua').AHoverLandUnit
- local ADFLaserLightWeapon = import('/lua/aeonweapons.lua').ADFLaserLightWeapon
- UAL0101 = Class(AHoverLandUnit) {
- Weapons = {
- LaserTurret = Class(ADFLaserLightWeapon) {}
- },
- }
- TypeClass = UAL0101
- OnToggleEnable = function(self)
- if true: set selection priority = 0
- if false: set selection priority = 1
- CreateState = State {
- Main = function(self)
- self:HideBone('UEB1104', true) # This units default position is open,
- self.SliderManip:SetGoal(0,-1,0) # so we have to hide the bone, close the unit,
- self.SliderManip:SetSpeed(-1) # and then show the bone once its in its closed position.
- WaitFor(self.SliderManip)
- self:ShowBone('UEB1104', true)
- self.Closed = true
- if self.GoToActive == true then
- ChangeState(self, self.ActiveState)
- end
- end,
- },
- ActiveState = State {
- Main = function(self)
- local myBlueprint = self:GetBlueprint()
- # Play the "activate" sound
- if myBlueprint.Audio.Activate then
- self:PlaySound(myBlueprint.Audio.Activate)
- end
- # Initiate the unit's ambient movement sound
- self:PlayUnitAmbientSound( 'ActiveLoop' )
- self.SliderManip:SetGoal(0,0,0)
- self.SliderManip:SetSpeed(3)
- WaitFor(self.SliderManip)
- end,
- # User deactivates unit.
- OnConsumptionInActive = function(self)
- TMassFabricationUnit.OnConsumptionInActive(self)
- ChangeState(self, self.InactiveState)
- end,
- },
- InactiveState = State {
- Main = function(self)
- self:StopUnitAmbientSound( 'ActiveLoop' )
- self.SliderManip:SetGoal(0,-1,0)
- self.SliderManip:SetSpeed(3)
- WaitFor(self.SliderManip)
- end,
- # User activates unit.
- OnConsumptionActive = function(self)
- TMassFabricationUnit.OnConsumptionActive(self)
- ChangeState(self, self.ActiveState)
- end,
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement