Jump to content

Updating display of KSPField contents


Recommended Posts

I posted this question about a week ago in the generic "Developers helping developers" thread, but it didn't get a response so I'm re-posting here.

For some reason, variables with the KSPfield attribute are only displaying their initialized valuesin the in-flight GUI, regardless of what updates the variable's value receives. How can you force the part GUI menu to update the displayed field values? This problem is occurring with string, double, float, and bool data types (I know either float or doubles aren't supported by KSPField, just can't remember which).

Again, I've seen this in question asked in several other places, but I haven't seen it answered.

Any help is appreciated.

Link to comment
Share on other sites

Doubles aren't supported by KSPField.

As for that, I've never had problem with the display. RealChute uses the display of a float for the number of repacks available and there was never any problem with the updating of the number.

Could you show a snippet of code or an example of what you're trying to do?

Link to comment
Share on other sites

<sigh>

So, I was paring down the code to just be the parts that were giving me trouble, and somewhere in the rewrite I made it work (the KSPFields are updating properly). Building things back up, I think the issue isn't with the KSPFields, but with the calling the method: this.vessel.checkLanded().

The persistence file lists the vessel as "landed = true", but this method is returning "false", and when I lower the part that has the custom module so that it touches the ground, this.part.checkLanded is returning true... which is weird. I guess I need help understanding how this.vessel.checkLanded() works.

Edited by LethalDose
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...