Jump to content

[1.12.x] Ship Manifest (Crew, Science, & Resources) - v 6.0.8.0 - 28 Apr 23


Papa_Joe

Recommended Posts

But, now that I think of it, if there is only one part module, I "could" default it to selected. that would cover a large percentage of the time I think, and save a click.

Good idea. I was actually surprised that "receive" button is disabled after each transfer. It would be more logical to keep it pressed until other receiving part is selected, I guess.

Link to comment
Share on other sites

Ok, New Update. Some requested features, and Realism enhancements / options.

Version 0.23.3.1.4 - 15 Feb, 2014 - General cleanup, configuration & UI enhancements.

- Realism Mode: Science Xfers now render experiments inoperable after xfer.

- Changed Science Xfers Target Module selection to Auto select, If the target Part has only 1 target module. Saves a click the majority of the time.

- Added Save Debug Log support. Save Log button now works.

- Added support for tailoring Ship Manifest for your needs:

- Config File switch to enable/disable Fill & Empty Resource buttons in PreFlight. Enabled by default.

- Config File switch to enable/disable Crew Transfer Feature. Enabled by default.

- Config File switch to enable/disable Science Transfer Feature. Enabled by default.

- Include Toolbar 1.5.3 redistribution

We should be getting pretty stable now.

Enjoy!

Link to comment
Share on other sites

Cool, let's try new one.

P.S. There is toolbar 1.6.0 already out there :D

Small landers? Without MOOOOARR engines, struts and fuel? :mad:

I know, right? I had gone to his thread to downloaded the latest JUST before he posted the update.. I then released After he did with the Old version.... Bleh!

@ Papa_Joe: could you shed some light about your future plans, in particular with the "In Flight Checklists" you mentioned some days ago?

As per the discussions earlier in the thread, I'm thinking That Checklists should likely be a separate mod. Based on the ideas I have, and the interface work needed, it really will be bigger than SM. It is already in work as I write this...

So, I will likely start a WIP thread so we can discuss my ideas and flesh out what the community might like.. I will need a title...

Edited by Papa_Joe
Link to comment
Share on other sites

An idea just struck me. How about when transferring kerbals around the ship/station the kerbal(s) can be seen moving through the ship like an xray view? Would be really cool and probably easier than making true advanced iva as you would just load the kerbal in standard eva mode just without physics and move him around inside the ship.

Btw the connected living space plugin api could also be put to good limiting kerbs transfers use with ship manifest if the interest is there. Should probably have an on/off setting so ppl who dont wanna use it wouldnt find it in the way and us realism mode nuts can have it on.

Edited by landeTLS
Link to comment
Share on other sites

An idea just struck me. How about when transferring kerbals around the ship/station the kerbal(s) can be seen moving through the ship like an xray view? Would be really cool and probably easier than making true advanced iva as you would just load the kerbal in standard eva mode just without physics and move him around inside the ship.

Btw the connected living space plugin api could also be put to good limiting kerbs transfers use with ship manifest if the interest is there. Should probably have an on/off setting so ppl who dont wanna use it wouldnt find it in the way and us realism mode nuts can have it on.

The "x-ray view" may be more of a challenge than you make it sound, and I don't expect to include it with Ship Manifest. It is an interesting idea however, and worth at least investigation. I like visual "aids" :)

I've already contacted codepoet about integration with ConnectedLivingSpace, and discussed briefly my intentions. I expect to add connected space limitations as soon as codepoet and I work out how best to integrate both for me and other modders.

I expect to include new crew transfer realism feature soon. As usual, I will provide a means to customize your experience. After all, there is no incorrect way to play KSP.

Edited by Papa_Joe
Link to comment
Share on other sites

I've already contacted codepoet about integration with ConnectedLivingSpace, and discussed briefly my intentions. I expect to add connected space limitations as soon as codepoet and I work out how best to integrate both for me and other modders.

I expect to include new crew transfer realism feature soon. As usual, I will provide a means to customize your experience. After all, there is no incorrect way to play KSP.

CLS was formally released today. Papa_Joe, let me know what you need and we can get this show on the road. The CLS API is documented on the CLS development thread, and I have also released a simple mod that uses CLS to demonstrate how it can be used. I expect this biggest challenge will be if you want to use reflection in order to avoid a hard dependency on CLS. I have never used reflection, but it can't be that hard! Like I say, let me know which direction you want to go, and I will make it happen for you.

(In an unrelated note, in writing my simple mod to use CLS i ran into a problem of kerbal portraits which I saw mentioned in this thread. Is it still a problem for ShipManifest? Does ShipManifest still need button to restore the potraits? If so take a look at the code for KerbalHotSeat to see how I got around the problem.

Edited by codepoet
code!
Link to comment
Share on other sites

CLS was formally released today. Papa_Joe, let me know what you need and we can get this show on the road. The CLS API is documented on the CLS development thread, and I have also released a simple mod that uses CLS to demonstrate how it can be used. I expect this biggest challenge will be if you want to use reflection in order to avoid a hard dependency on CLS. I have never used reflection, but it can't be that hard! Like I say, let me know which direction you want to go, and I will make it happen for you.

(In an unrelated note, in writing my simple mod to use CLS i ran into a problem of kerbal portraits which I saw mentioned in this thread. Is it still a problem for ShipManifest? Does ShipManifest still need button to restore the potraits? If so take a look at the code for KerbalHotSeat to see how I got around the problem.

Thanks so much. Work has been keeping me from the fun coding, but I'll take a look now.

Link to comment
Share on other sites

The "x-ray view" may be more of a challenge than you make it sound

Im sorry i didnt mean to make it sound like it was so trivial. I know it would probably require a lot of coding like making the kerbs movement conform to the fusulage etc.. I just meant compaired to moving kerbals around in iva view(what i meant with adv iva) via a plugin im guessing it would be atleast a bit easier.

Link to comment
Share on other sites

@Papa while working on some crew management code of my own this evening, I ran into major problems updating the IVA portraits, and decided to take a peak at your code to see how you might have handled it.

Turns out you hadn't found a solution either, HOWEVER, after playing around with multiple approaches and calling way too many random functions with hopeful sounding names, I seem to have come up with a solution based on the approach you use in your "update portraits" button code.

Turns out if you just set a flag when you perform a crew transfer, and then call Vessel.SpawnCrew() on the next update after the transfer based on that flag, everything appears to work great. I've run a number of tests with it, and seat.SpawnCrew(), part.SpawnCrew(), or any of the other SpawnCrew() action doesn't appear to be necessary. Just remove from one part, add to another, and Vessel.SpawnCrew() next update.

I can only assume that KSP is performing some kind of required maintenance on the crew between frames which only makes the SpawnCrew() call valid on the next update.

Anyways, just thought I'd share in case it helps you out and potentially saves you any of the trial and error random-function-until-it-works action I just went through :)

Link to comment
Share on other sites

@Papa while working on some crew management code of my own this evening, I ran into major problems updating the IVA portraits, and decided to take a peak at your code to see how you might have handled it.

Turns out you hadn't found a solution either, HOWEVER, after playing around with multiple approaches and calling way too many random functions with hopeful sounding names, I seem to have come up with a solution based on the approach you use in your "update portraits" button code.

Turns out if you just set a flag when you perform a crew transfer, and then call Vessel.SpawnCrew() on the next update after the transfer based on that flag, everything appears to work great. I've run a number of tests with it, and seat.SpawnCrew(), part.SpawnCrew(), or any of the other SpawnCrew() action doesn't appear to be necessary. Just remove from one part, add to another, and Vessel.SpawnCrew() next update.

I can only assume that KSP is performing some kind of required maintenance on the crew between frames which only makes the SpawnCrew() call valid on the next update.

Anyways, just thought I'd share in case it helps you out and potentially saves you any of the trial and error random-function-until-it-works action I just went through :)

That is exactly the solution I came up with for KerbalHotSeats too.

I am curious - what are you working on?

Link to comment
Share on other sites

@ FlowerChild and codepoet.

I took a look at codepoet's solution, and realized that calling a change Vessel event would refresh everything, so that will probably work. I tried the vessel.SpawnCrew() during my initial development with a scope flag to pass control to the update event and didn't have any luck, when crossing part boundaries (seemed to work when in the same part, but with so many tries, I may be getting confused). Did you test that as well?

I know I did a lot of testing, and figured that we were missing a higher level call. That could likely be the Vesselchange event.

thanks so much for looking into this, as the Update Portraits button has always grated against me...

Edited by Papa_Joe
Link to comment
Share on other sites

I took a look at codepoet's solution, and realized that calling a change Vessel event would refresh everything, so that will probably work. I tried the vessel.SpawnCrew() during my initial development with a scope flag to pass control to the update event and didn't have any luck, when crossing part boundaries (seemed to work when in the same part, but with so many tries, I may be getting confused). Did you test that as well?

Nope, not yet. It's on my todo list :)

In theory though, if it's a problem I suspect that calling SpawnCrew() on the Part.vessel of both the source and destination part of the transfer if they differ may do the trick there.

Link to comment
Share on other sites

What did it for me was to call Vessel.SpawnCrew on the next call to FixedUpdate. So I set a flag to indicate that a refresh was pending.

Firing a ChangeVessel event on its own did not fix the portraits for me.

Yup, that's what we're all talking about, but I think he's referring to what happens when two separate vessels dock in game. It's handled rather differently internally than with just a single vessel (or if you launch the vessel already docked), which I also ran into when working on my fuel pump code.

EDIT: Ok, so I just tested it with this docked vessel monstrosity, repeatedly sending Kerbals to and fro to the various types of command pods on the thing, and everything was fine:

z5GX8TZ.png

So yeah, I'd say just delaying the vessel.SpawnCrew() call until the next update works pretty good :)

Edited by FlowerChild
Link to comment
Share on other sites

codepoet & FlowerChild,

!hanks so much for the assist! I'm off to update and test.

My pleasure man! You discovering the SpawnCrew() aspect for your update portraits button gave me a big assist as well in pointing me in the right direction, so thank you for that :)

Link to comment
Share on other sites

My pleasure man! You discovering the SpawnCrew() aspect for your update portraits button gave me a big assist as well in pointing me in the right direction, so thank you for that :)

Well, thanks to codepoet and FlowerChild, I have solved my IVA Portrait update problem. Thanks so much!

Interesting problem.

I did exactly as codepoet and FlowerChild described, as I had during my initial testing when I added crew transfers. It did not work!? :(

So, I instrumented the process to verify that I was hitting the expected code path, in doing so I refactored my logging scheme... wannabe code geek that I am... :)

In the end, the solution was to add a "frame delay". Weird, huh?

Well, I'm running an NVidia 9600GT card. Pretty ancient, but serviceable. So, I got to thinking...

If there was an asynchronous process that normally was completed in advance of the next frame on "new" cards, us older cards are chugging a bit.. so..

It seems If I add 5 frames of delay, it still does not work. But, if I add 10+... It does!

So, naturally, I added a Config Item "IVAFrameDelay" to allow customization for older cards. you can make it anything from 0 (no delay) to what ever works for you...

My guess...

Adding the 10 frame delay should be a non issue for those that would have not experienced the issue and older cards can now tweak the setting if they experience issues... :)

Okay, with that "solved",

I'll move the update portrait button to a hidden button. If you want/need it. turn it on in the config. Just in case :)

Come to think of it... with a frame delay.... you could also use a time delay... so we could establish a "time" it takes kerbal to move to another seat.... and delay the portrait update until the kerbal has "made it to his seat"... maybe add cute hollow bumping and shuffling sounds during the transfer time..." Something to think about.. :)

Back to adding "spatial awareness" to Ship Manifest...

Edited by Papa_Joe
Link to comment
Share on other sites

I did exactly as codepoet and FlowerChild described, as I had during my initial testing when I added crew transfers. It did not work!? :(

Interesting. Although from what you're describing about the frame delay, one potentially relevant difference between my approach and codepoet's is that I checked for the flag and performed SpawnCrew() within OnUpdate() (which I believe is called on a per frame basis) rather than OnFixedUpdate() (which I believe is being called on a per physics tick update).

Hence, I suspect if you're also doing the latter, it might have something to do with why you needed the frame delay, if multiple physics ticks are running per visual frame on your hardware.

Anyways, just thought it worth mentioning. I chose to use OnUpdate() given this is a graphics update we're performing here with the portraits, and given the difficulties you mentioned above I thought it might be relevant enough to warrant mentioning.

Link to comment
Share on other sites

3. Added Fill and Empty Crew buttons in Pre-Flight Mode. I promised I would :)

Thanks for adding that. I had another question. Would it be possible to add a balance feature for fuel tanks?

Edited by heralo
Link to comment
Share on other sites

Interesting. Although from what you're describing about the frame delay, one potentially relevant difference between my approach and codepoet's is that I checked for the flag and performed SpawnCrew() within OnUpdate() (which I believe is called on a per frame basis) rather than OnFixedUpdate() (which I believe is being called on a per physics tick update).

Hence, I suspect if you're also doing the latter, it might have something to do with why you needed the frame delay, if multiple physics ticks are running per visual frame on your hardware.

Anyways, just thought it worth mentioning. I chose to use OnUpdate() given this is a graphics update we're performing here with the portraits, and given the difficulties you mentioned above I thought it might be relevant enough to warrant mentioning.

I'm not sure which event I'm hooked into. I've researched the code, and I'm not sure what is firing the method I'm using. Since my mod is "partless", the update method I'm using is embedded into a class with monobehavior as it's base. So, not sure what is triggering it... :/

Based on my research, testing and logging, it "appears" to be the Unity Update method... I'm very good at C# and coding in general, but I'm new to Unity's object model, architecture, and KSP's API.

Link: http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.Update.html

Edited by Papa_Joe
Link to comment
Share on other sites

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...