# --MicroEngine-- 3/19/2017 12:12:55 PM once # Set up image(s). You NEED to set image layer to Ships, otherwise your module will render behind ships. Self "main" "Custom3_128" SetImage Self "main" "Ships" SetImageLayer Self "main" 2 SetImageOrder Self "main" 1 1 SetImageScale Self "ShipModule.prpl" "Ship" GetScriptVar ->Ship <-Ship.ShipIsEnemy ->IsEnemy -1 ->target <-uid GetShipThrustMultiplier ->Thrust <-Thrust 1.5 add ->Thrust2 endonce #The heading of the ship the module is attached to. Self "ShipModule.prpl" "ShipAngle" GetScriptVar ->ShipAngle #The amount the heading has changed in the last frame (in radians) Self "ShipModule.prpl" "delta" GetScriptVar ->Delta #Whether the module exists. #0 = hull destroyed #1 = under construction #2 = built Self "ShipModule.prpl" "exist" GetScriptVar ->Exist #If the module is destroyed, make it invisible and prevent the rest of the script from running. <-Exist eq0 if self "main" 0 0 0 0 SetImageColor return endif #make module align with ship self "main" <-ShipAngle SetImageRotation IsPaused if return endif CurrentPixelCoords ->y ->x <-Exist 1 eq if # if under construction, make the module semi transparent. # also use this for things like resetting turret rotation or cooldown if the module is destroyed and rebuilt self "main" 255 255 255 128 SetImageColor else self "main" 255 255 255 255 SetImageColor # I don't know of a way to read the Fire Multiple property on some enemy ships, which increases their fire rate. # Instead, this script pretends that all enemy ships have amp gems. <-Ship.ShipHasAmp <-IsEnemy or ->GemPresent #code your module's abilities here <-uid <-Thrust2 SetShipThrustMultiplier endif 24 0 do I GetShipNameFromSlot ->ShipName <-ShipName "itty bitty" eq if I GetShipFromSlot ->uid endif loop :awake # I dunno, I like to have all my scrpts OWP and exit partway through, I doubt it's caused by the brain chip. 1 OperateWhilePaused