Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- WHIPLASH'S KAPUT SYSTEM SCRIPT - revision 2 - 7/19/15
- Torpedo 1
- DESCRIPTION:
- This script covers the launching system of the KAPUT weapon platform designed for the
- Shortbow Torpedo Bomber
- - Whiplash141
- */
- static string torpedo_no = "1";
- string forwardThrustName = "Forward Thrust - Torpedo - " + torpedo_no;
- string maneuveringThrustersName = "Small Thruster - Maneuvering - " + torpedo_no;
- string detachThrustName = "Small Thruster - Detach - " + torpedo_no;
- List<IMyTerminalBlock> forwardThrusters = new List<IMyTerminalBlock>();
- List<IMyTerminalBlock> maneuveringThrusters = new List<IMyTerminalBlock>();
- List<IMyTerminalBlock> Spaceballs = new List<IMyTerminalBlock>();
- List<IMyTerminalBlock> detachThrusters = new List<IMyTerminalBlock>();
- int timeElapsed = 0;
- void Main()
- {
- GridTerminalSystem.SearchBlocksOfName(detachThrustName,detachThrusters);
- if (timeElapsed == 0)
- {
- for(int i = 0 ; i < detachThrusters.Count ; i++)
- {
- IMyThrust Thrust = detachThrusters[i] as IMyThrust;
- Thrust.ApplyAction("OnOff_On");
- }
- Echo("Detach Thrust On");
- }else if(timeElapsed == 1){
- for(int i = 0 ; i < detachThrusters.Count ; i++)
- {
- IMyThrust Thrust = detachThrusters[i] as IMyThrust;
- Thrust.ApplyAction("OnOff_Off");
- }
- ThrusterOverride();
- ManeuveringThrust();
- Echo("Detach Thrust Off");
- Echo("Thruster Override On");
- }else if(timeElapsed == 5){
- SpaceballMass();
- Echo("Spaceballs Mass Maxed");
- }
- timeElapsed++;
- //debug
- Echo("Time Elapsed: " + timeElapsed);
- }
- void ManeuveringThrust()
- {
- GridTerminalSystem.SearchBlocksOfName(maneuveringThrustersName,maneuveringThrusters);
- for(int i = 0 ; i < maneuveringThrusters.Count ; i++)
- {
- IMyThrust Thrust = maneuveringThrusters[i] as IMyThrust;
- Thrust.ApplyAction("OnOff_On");
- }
- }
- void ThrusterOverride()
- {
- GridTerminalSystem.SearchBlocksOfName(forwardThrustName,forwardThrusters);
- for(int i = 0; i < forwardThrusters.Count;i++)
- {
- IMyThrust Thrust = forwardThrusters[i] as IMyThrust;
- Thrust.SetValue<float>("Override", float.MaxValue);
- }
- }
- void SpaceballMass()
- {
- GridTerminalSystem.GetBlocksOfType<IMySpaceBall>(Spaceballs);
- for (int i = 0; i < Spaceballs.Count; i++)
- {
- Spaceballs[i].SetValueFloat("VirtualMass",float.MaxValue);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement