Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This bit of code is designed to add every engine on the rocket into
- //an appropriate list. Each engine is tagged based on when it needs
- //to be activated. Alpha = center engine, Bravo = the two opposing
- //engines on the nadir and zenith of the booster, and Charlie =
- //the remaining four engines. All seven on each booster will be used
- //during launch, but only the Alpha and Bravo will be used for the
- //boostback, and only the Alpha engine will be used for the suicide
- //burn. Each is also assigned to an "All" list for each booster, and
- //an "All" list for the entire launch vehicle. The second stage has
- //its own list; there is only the one-engine version but I'm leaving
- //it able to support a future two-engine version.
- //The FOR loop throws an error, saying that the eng variable created
- //for the loop cannot have the suffix PARTSTAGGED. Can anyone help
- //with this? Why can't the eng variable have that suffix when I can
- //use the PARTSTAGGED suffix with the engineList variable?
- LIST ENGINES IN engineList.
- SET S1Alpha TO LIST(). //First stage engine 1
- SET S1Bravo TO LIST(). //First stage engines 2,3
- SET S1Charlie TO LIST(). //First stage engines 4,5,6,7
- SET S1All TO LIST(). //First stage all engines
- SET S2Alpha TO LIST(). //Second stage engine 1
- SET LBAlpha TO LIST(). //Left booster engine 1
- SET LBBravo TO LIST(). //Left booster engine 2,3
- SET LBCharlie TO LIST(). //Left booster engine 4,5,6,7
- SET LBAll TO LIST(). //Left booster all engines
- SET RBAlpha TO LIST(). //Right booster engine 1
- SET RBBravo TO LIST(). //Right booster engine 2,3
- SET RBCharlie TO LIST(). //Right booster engine 4,5,6,7
- SET RBAll TO LIST(). //Right booster all engines
- SET engAll TO LIST(). //All first stage and side booster engines
- FOR eng IN engineList { //Loop to assign engines to all engine lists
- IF eng:PARTSTAGGED("S1Alpha"):LENGTH > 0 { //First stage engine 1
- S1Alpha:ADD(eng).
- S1All:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("S1Bravo"):LENGTH > 0 { //First stage engine 2,3
- S1Bravo:ADD(eng).
- S1All:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("S1Charlie"):LENGTH > 0 { //First stage engine 4,5,6,7
- S1Charlie:ADD(eng).
- S1All:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("S2Alpha"):LENGTH > 0 { //Second stage engine 1
- S2Alpha:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("LBAlpha"):LENGTH > 0 { //Left booster engine 1
- LBAlpha:ADD(eng).
- LBAll:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("LBBravo"):LENGTH > 0 { //Left booster engine 2,3
- LBBravo:ADD(eng).
- LBAll:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("LBCharlie"):LENGTH > 0 { //Left booster engine 4,5,6,7
- LBCharlie:ADD(eng).
- LBAll:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("RBAlpha"):LENGTH > 0 { //Right booster engine 1
- RBAlpha:ADD(eng).
- LBAll:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("RBBravo"):LENGTH > 0 { //Right booster engine 2,3
- RBBravo:ADD(eng).
- LBAll:ADD(eng).
- engAll:ADD(eng).
- } ELSE IF eng:PARTSTAGGED("RBCharlie"):LENGTH > 0 { //Right booster engine 4,5,6,7
- RBCharlie:ADD(eng).
- LBAll:ADD(eng).
- engAll:ADD(eng).
- }. //IF-ELSE eng
- }. //FOR engineList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement