Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Conditional Hooks
- $State: GS_STATE_GAME_PLAY
- $On Frame:
- [
- --Rotational Compensation. For those ignorant evil things known as THENUMBERSANDRESULTSDONTMATCHUP
- if boolean_startRotation == true then
- if ship_to_rotate.Orientation["p"] > (pitch_desired+0.01) then --get it within +-.01 of the desire. An exact number may take forever...
- ship_to_rotate.Orientation["p"] = (ship_to_rotate.Orientation["p"] - (ship_to_rotate.Orientation["p"]/pitch_desired))
- elseif ship_to_rotate.Orientation["p"] < (pitch_desired-0.01) then
- ship_to_rotate.Orientation["p"] = (ship_to_rotate.Orientation["p"] + (ship_to_rotate.Orientation["p"]/pitch_desired))
- else --must be done
- boolean_startRotation = false
- end
- end
- --Triggers the force rotation algorithm. rotation in RADIENS
- function fpo(shipName, pitch_orientation)
- ship_to_rotate = mn.Ships[shipName]
- if pitch_orientation == 0 then --if it's 0 I'm not going to bother with it due to probable division by 0 errors.
- ship_to_rotate.Orientation["p"] = 0
- else
- pitch_desired = pitch_orientation
- boolean_startRotation = true
- end
- end
- ]
- $On Death:
- [
- local dyingShip = hv.Self
- if dyingShip == hv.Player or dyingShip == ship_to_rotate then --Disable when either the player or the target ship blows up.
- boolean_startRotation = false
- end
- ]
- $On Mission End:
- [
- boolean_startRotation = false --force it off when a mission ends.
- ]
- #End
Advertisement
Add Comment
Please, Sign In to add comment