API:Staging

From Kerbal Space Program Wiki
Jump to: navigation, search

The Staging class provides some information about the staging of the rocket, and also provides a function that lets you activate the next stage from code as if the user had pressed the space bar.

This class also seems to handle user interaction with the staging icon list (dragging icons around).

Note that in KSP the stages count DOWN as you go through the stages in your rocket, so that the LAST stage is stage zero. The stage a part activates in is given by Part.inverseStage.

Class Documentation

This is a complete list of public properties and functions of the Staging class. However, only entries that have been investigated by other users have been filled in. If you discover the use of a property or function, you are encouraged to fill it in!

The functionality of some functions may be obvious from its name, but simply have not been tested yet.

Properties

bool AdvancedStagingControls { get; } (Usage unknown.)
int CurrentStage { get; } The stage number of the currently active stage of the rocket. This decrements by one every time a new stage is activated, until it reaches zero when the final stage is activated.
Texture2D DefaultIconMapTexture { get; } (Usage unknown.)
Vector3 IconOffset { get; } (Usage unknown.)
float IconSpacing { get; } (Usage unknown.)
int lastStage { get; } (Usage unknown.)
List<StackIcon> Selection { get; } Returns a List of the selected staging icons.
bool separate_ready { get; } Returns true if the next stage is ready to activate, false otherwise.
Transform StackTransform { get; } (Usage unknown.)
int StageCount { get; } The stage number of the initial stage of the rocket. You can test to see if the rocket is still on the pad by testing whether (Staging.CurrentStage == Staging.StageCount)

Public Static Functions

void ActivateNextStage(); Activates the next stage of the rocket just as if the user had pressed space.
void ActivateStage(int stage); Activates the given stage, even if it's not the next stage.
void AddStageAt(int index); Inserts a new empty stage at the given index.
void AddToSelection(StackIcon icon, bool multipleSelect = false); (Usage unknown.)
void beginFlight(); (Usage unknown.)
StackIcon CreateIcon(Part caller); (Usage unknown.)
void DeleteStage(StageGroup stageToDelete); Deletes the given stage.
void deselect(StackIcon icon); Deselects the given staging icon in the stage stack.
void DisableIcon(StackIcon iconToDisable); (Usage unknown.)
StackIcon FindIcon(Part part); Returns the staging icon of the given part.
void findStageIndices(Part part, int thisStage); (Usage unknown.)
void GenerateStagingSequence(); (Usage unknown.)
void GenerateStagingSequence(Part root); (Usage unknown.)
int GetStageCount(List<Part> ship); Returns the number of current stages.
void OnIconDrag(StackIcon icon); Called when a staging icon is being dragged.
void OnIconDragEnd(StackIcon icon); Called when a staging icon has finished being dragged.
void OnIconDragStart(StackIcon icon); Called when a staging icon has begun being dragged.
void OnStageDrag(StageGroup stage); Called when a stage is being dragged.
void OnStageDragEnd(StageGroup stage); Called when a stage has finished being dragged.
void OnStageDragStart(StageGroup stage); Called when a stage has begun being dragged.
int RecalculateVesselStaging(Vessel v); (Usage unknown.)
void RemoveIcon(StackIcon iconToRemove); Removes the given staging icon from the staging stack.
void ResumeFlight(int currStage); (Usage unknown.)
void ScheduleSort(); (Usage unknown.)
void ScrollToIcon(StackIcon icon); (Usage unknown.)
void ScrollToStage(int stageNumber); (Usage unknown.)
void SetStageCount(int lastStg); (Usage unknown.)
void SetStageCount(List<GameObject> ship); (Usage unknown.)
void SetStageCount(List<Part> ship); (Usage unknown.)
void SortIcons(); (Usage unknown.)
void SortNow(); (Usage unknown.)
void StepBackCurrentStage(); (Usage unknown.)