Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CMLS1
- //Version 0.1
- WHEN loxRemaining <= (S1SepLevel / 100) THEN { //Checks to see if first stage is at sep level, shutdown engines and extend fins if true
- FOR eng IN S1All {
- eng:GETMODULE("ModuleEngines"):DOEVENT("Shutdown Engine").
- }. //FOR eng shutdown
- IF opMode = "1R" {
- FOR part IN S1finHinges {
- PART:GETMODULE("MuMechToggle"):DOACTION("move -",TRUE).
- }. //FOR finhinge move
- S1Ant:GETMODULE("ModuleRTAntenna"):DOEVENT("Activate").
- }. //IF opMode
- RCS ON.
- SAS ON.
- PRINT "T+" + missionClock + " Stage 1 at sep level, staging" AT(0,nextLine).
- SET nextLine TO nextLine + 1.
- SET S1ECOtimer to missionClock. //Marks the time at which S1ECO occurred
- WHEN missionClock >= (S1ECOtimer + 1.5) THEN { //Checks to see if 1.5 seconds has passed since S1ECO, quit extending fins if true
- IF opMode = "1R" {
- FOR part IN finHinges {
- PART:GETMODULE("MuMechToggle"):DOACTION("move -",FALSE).
- }. //FOR finhinge stop
- PRINT "T+" + missionClock + " Fins extended" AT(0,nextLine).
- SET nextLine TO nextLine + 1.
- }. //IF opMode
- WHEN missionClock >= (S1ECOtimer + 2.5) THEN { //Checks to see if 2.5 seconds have passed since S1ECO, stage sep if true
- interStage:GETMODULE("ModuleDecouple"):DOEVENT("Decouple").
- PRINT "T+" + missionClock + " Staging confirmed" AT(0,nextLine).
- SET nextLine TO nextLine + 1.
- SET activeStage TO 2. //Denotes that stage 2 is now the active stage
- SET loxCap TO S2Tank:RESOURCES[1]:CAPACITY.
- LOCK loxAmount TO S2Tank:RESOURCES[1]:AMOUNT.
- WHEN missionClock >= (S1ECOtimer + 7.5) THEN { //Checks to see if 5 seconds have passed since stage sep, MEI if true
- FOR eng IN S2Alpha {
- eng:GETMODULE("ModuleEngines"):DOEVENT("Activate Engine").
- }.
- PRINT "T+" + missionClock + " MEI" AT(0,nextLine).
- SET nextLine TO nextLine + 1.
- WHEN SHIP:ALTITUDE > 60000 AND missionClock >= (S1ECOtimer + 10.5) THEN { //Fairing sep at 60km or 3 seconds after stage 2 ignition, both conditions need satisfied
- FOR PART IN fairingShell {
- PART:GETMODULE("ProceduralFairingDecoupler"):DOEVENT("Jettison").
- }. //FOR loop
- SET fairingSep TO TRUE. //Readout will update to confirm fairing sep status
- S2Ant:GETMODULE("ModuleRTAntenna"):DOEVENT("Activate"). //Activate small omni on second stage
- PRINT "T+" + missionClock + " Fairing separation confirmed" AT(0,nextLine).
- SET nextLine TO nextLine + 1.
- }. //WHEN SHIP:ALTITUDE
- }. //WHEN stage2StartTimer
- }. //WHEN BECOtimer decouple
- }. //WHEN BECOtimer finHinges
- }. //WHEN loxRemaining
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement