Jump to content

ActiveVessel.currentStage is incorrect?


Recommended Posts

So I am trying to determine when in the Flight scene the player activates their first stage. I thought this should be easy. When the Flight scene starts, record the currentStage value, which when you start up the Flight scene is set to the highest stage + 1 if you have not launched yet. And then if currentStage drops, then I know they have activated the first stage.

KSP Reality seems to be different. When you start the Flight scene, currentStage is indeed set to highest stage + 1. However if you re-arrange your stages, this value *does not update* to reflect the current setup. So for example if you have 3 stages, 0, 1 and 2, when you start the Flight scene, currentStage will be 3. Now you suddenly realize that what is in stage 2 should be split into 2 stages, so you add a new stage, Stage 3, and drag one of the items from 2 into it. Now you have stages 0, 1, 2, and 3. What is currentStage? Still 3. Just like it was before. If you were to activate stage 3 at this point, the currentStage value would *not* change until you activated the *next* stage after that.

Even worse if you were to add say 2 or 3 new stages, so that your total number of stages was say 5, currentStage *would still be 3*!! until such time as you worked through the first few stages and got back in sync!

Does anyone have any idea how I can tell when the player activates the very first stage at launch?

- - - Updated - - -

Ok turns out that I was making it way more complicated than it had to be.

All of the above is true, and that's a pretty nasty bug in KSP as far as I can see, but it isn't necessary.

There is a GameEvent for when a stage is activated so I can just use that.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...