enneract

[1.0.x] CrewQueue - Crew Rotation and Vacations

Recommended Posts

Either/Or doesn't matter. Career and Sandbox both don't work (default crews load, and are immediately available after recovery). No mods, my first thought was mod conflict so I pulled all my mods out to do the 50/50 method, but it didn't work with just stock either. I also just downloaded a clean copy of KSP, just in case there were some traces left behind.

Just in case it's PEBCAK... here is what I'm doing. Build a craft in VAB (stick a Mk1 pod on a SRB and give it a chute). Launch said craft directly from VAB. Fly up 1000m or so, and parachute back down. Recover craft by using the button that appears above the altimeter in the flight scene. Result: Astro complex says available for next mission, and I can load them straight back onto the next ship

Yea. I'm really not sure what is up with the version I released. It was overall just far too fragile, but passed my tests. The current development snapshot is much better, mostly because I rewrote the entire data-storage mechanism. Expect a new release pretty soon; what is left is auto-assigning new crews and testing.

Share this post


Link to post
Share on other sites

Anyone using this without KCT, please try out the new prerelease.

If you are using KCT, I've got a PR in to KCT to add compatibility; next release of KCT should be compatible.

Share this post


Link to post
Share on other sites
Anyone using this without KCT, please try out the new prerelease.

If you are using KCT, I've got a PR in to KCT to add compatibility; next release of KCT should be compatible.

And if you're feeling particularly adventurous, the latest KCT development builds should support CrewQ. Note that the new features I'm working on don't work properly yet, but there's a bunch of bug fixes for existing problems. (aka, don't use the recover to ship storage feature yet. The KSC button doesn't do anything in the main GUI yet either.)

Edited by magico13

Share this post


Link to post
Share on other sites

Just tested latest crewq added to a in progress career that already had latest KCT. When I went to lvl 2 astronaut facility and tried adding a new kerbal i got spammed with exception CrewQ.CrewQData.GetVactionTimer this would continue indefinitely until I go back to the KSC screen, or remove the new kerbal from my roster. Going back in if leave to the KSC screen would cause the exceptions to start again. Here is my log. I would just search for that exception as the log is pretty large. Let me know if you want a save file or anything else.

Share this post


Link to post
Share on other sites
Just tested latest crewq added to a in progress career that already had latest KCT. When I went to lvl 2 astronaut facility and tried adding a new kerbal i got spammed with exception CrewQ.CrewQData.GetVactionTimer this would continue indefinitely until I go back to the KSC screen, or remove the new kerbal from my roster. Going back in if leave to the KSC screen would cause the exceptions to start again. Here is my log. I would just search for that exception as the log is pretty large. Let me know if you want a save file or anything else.

Thanks, this is useful. I'm not sure what is going on, but I'll get a fix out asap.

Can you do me a favor and try it without KCT?

Edited by enneract

Share this post


Link to post
Share on other sites

I have another bug to report it seems when using ship manifest to create and change kerbals names causes issues with this mod. I renamed some kerbals including Jeb and when i went to the astro complex I get spammed with null references. I also lose the renamed kerbals if i send them back to the complex out of my roster. When I leave the complex and come back they are gone. Here is my log

Share this post


Link to post
Share on other sites
I have another bug to report it seems when using ship manifest to create and change kerbals names causes issues with this mod. I renamed some kerbals including Jeb and when i went to the astro complex I get spammed with null references. I also lose the renamed kerbals if i send them back to the complex out of my roster. When I leave the complex and come back they are gone. Here is my log

Ah, balls, yea, that would do that.

Next version will have some sanity checks. I've been AFK due to school lately, I'm hoping to get some KSP time soon.

Share this post


Link to post
Share on other sites

Hey just glad to hear feedback was received, and take your time. I just love the idea for the mod, so least i can do is help with bug reports to help toward stability. I can't imagine how hard it must be to code for all these little interaction. I have respect for any who learn to make thing like this themselves.

Share this post


Link to post
Share on other sites
Hey just glad to hear feedback was received, and take your time. I just love the idea for the mod, so least i can do is help with bug reports to help toward stability. I can't imagine how hard it must be to code for all these little interaction. I have respect for any who learn to make thing like this themselves.

Yep, no problem. Thanks for pointing out this problem, I didn't consider it. I need to think about what the best solution would be, because right now I'm keeping track of crew by their names. This works fine in stock, but.. yea.

Bleh. Maybe I'll go look at how FF handles this.

Share this post


Link to post
Share on other sites

Ah, here's the updated version.

I posted on the RealRoster thread, sorry about that.

Share this post


Link to post
Share on other sites

Any updates on compatibility with kerbals with edited names?

Share this post


Link to post
Share on other sites
Any updates on compatibility with kerbals with edited names?

Not really, I haven't had a chance to do any modding lately. You can work around it by looking for the CrewQ section of your persistence file, and updating the names there to match the new ones.

Share this post


Link to post
Share on other sites

I believe this mod is causing a bug in my games

when i am launching a craft after around 10k the camera starts to move away from the center of the craft

Share this post


Link to post
Share on other sites
I believe this mod is causing a bug in my games

when i am launching a craft after around 10k the camera starts to move away from the center of the craft

Nope, no way that this mod could do that. Totally not possible. I don't touch the camera at all, or interact with the flight scene in any significant way.

Share this post


Link to post
Share on other sites
I believe this mod is causing a bug in my games

when i am launching a craft after around 10k the camera starts to move away from the center of the craft

Did you recently install RealChutes, and launch a craft that you created before you installed RealChutes? There's a bug around that.

Share this post


Link to post
Share on other sites
Nope, no way that this mod could do that. Totally not possible. I don't touch the camera at all, or interact with the flight scene in any significant way.

FYI, you don't have to explicitly do anything to the camera. An error in any module at the wrong time could do it. The camera POV gets detached. Or the rigid body gets detached

Bug report: Kerbals currently assigned to ships can (will) be assigned to new ships. I can launch endless successions of 1 man pods all filled with Jeb.

Edit: Found the cause. Will do a pull request with the fix later.

Edited by Starwaster

Share this post


Link to post
Share on other sites

enneract has indicated that he's extremely busy with work and said I could release my build of CrewQ with a fix for duplicate crews. (I'm not clear under what conditions this happens because CrewQ usually empties the pod but I've seen it happen where I had 4 identical sets of the same crew)

For the curious, this was a two line fix which you can see here: https://github.com/fingerboxes/CrewQ/pull/4/files

Here is the fixed dll:

https://www.dropbox.com/s/ueht0vt838i4hea/CrewQ-v1.03-starwaster.update.zip?dl=1

Unzip that to your KSP's GameData folder, overwriting where prompted for the dll.

(the folder structure is kept intact; there are two files: CrewQ.dll and license.md. The license file is actually identical to enneract's so it's really just the dll you have to overwrite)

(I left the license in there because I've got warned for not having licenses in uploaded files.... I don't think it had to be in there but better safe than sorry)

Share this post


Link to post
Share on other sites

Starwaster TY for your work. I was wondering if this fixes the issue I had with changing kerbals name via ship manifest. Before when doing so it broke crewq functionality as I believe enneract stated he track kerbals by name. Does your update address this issue?

Share this post


Link to post
Share on other sites
Starwaster TY for your work. I was wondering if this fixes the issue I had with changing kerbals name via ship manifest. Before when doing so it broke crewq functionality as I believe enneract stated he track kerbals by name. Does your update address this issue?

No, not at all.

I'm not sure what the solution there is since the game tracks by Kerbal name as well. Unless there's some way of being notified that a name change occurred.... or maybe if the index of the master roster remains the same over time, CrewQ could periodically check and see if Kerbal X has changed names.

Honestly though it's really a problem to change Kerbal names because like I said, that's how the game identifies them and tracks them. There is no GUID for a Kerbal.

Share this post


Link to post
Share on other sites
Starwaster TY for your work. I was wondering if this fixes the issue I had with changing kerbals name via ship manifest. Before when doing so it broke crewq functionality as I believe enneract stated he track kerbals by name. Does your update address this issue?

As Starwaster said, Kerbals are literally defined by their name. Even their profession is based off of a calculation performed on their name. When you 'rename' a kerbal, you are more or less deleting the old one and adding a new one, as far as the game is concerned.

No, not at all.

I'm not sure what the solution there is since the game tracks by Kerbal name as well. Unless there's some way of being notified that a name change occurred.... or maybe if the index of the master roster remains the same over time, CrewQ could periodically check and see if Kerbal X has changed names.

Honestly though it's really a problem to change Kerbal names because like I said, that's how the game identifies them and tracks them. There is no GUID for a Kerbal.

I have a few ideas on how to address this, but haven't had a chance to play with them;

1) Implement into the compatibility interface a way to inform CrewQ of changes that gameevents doesnt notice. PR ship manifest to inform CrewQ of changes. Doesn't fix the underlying problem (fixes would need to be done per-mod), but would result in least-exploitable solution (ie, you couldn't rename a kerbal to reset their vacation timer).

2) Do some sanity checking when building the internal roster. Only perform actions on Kerbals that actually exist, and generate new CrewQ data for kerbals that suddenly 'appear'. Downsides, you could exploit this to reset timers, and would marginally increase overhead of CrewQ.

I'll probably do both, but... yea, time.

On another note, I'm about 50% sure that the existing compatibility with KCT doesn't actually work. Some reports on that would be helpful; any day now, I'll have some time to spend on this.

Share this post


Link to post
Share on other sites
No, not at all.

I'm not sure what the solution there is since the game tracks by Kerbal name as well. Unless there's some way of being notified that a name change occurred.... or maybe if the index of the master roster remains the same over time, CrewQ could periodically check and see if Kerbal X has changed names.

Honestly though it's really a problem to change Kerbal names because like I said, that's how the game identifies them and tracks them. There is no GUID for a Kerbal.

As Starwaster said, Kerbals are literally defined by their name. Even their profession is based off of a calculation performed on their name. When you 'rename' a kerbal, you are more or less deleting the old one and adding a new one, as far as the game is concerned.

I have a few ideas on how to address this, but haven't had a chance to play with them;

1) Implement into the compatibility interface a way to inform CrewQ of changes that gameevents doesnt notice. PR ship manifest to inform CrewQ of changes. Doesn't fix the underlying problem (fixes would need to be done per-mod), but would result in least-exploitable solution (ie, you couldn't rename a kerbal to reset their vacation timer).

2) Do some sanity checking when building the internal roster. Only perform actions on Kerbals that actually exist, and generate new CrewQ data for kerbals that suddenly 'appear'. Downsides, you could exploit this to reset timers, and would marginally increase overhead of CrewQ.

I'll probably do both, but... yea, time.

On another note, I'm about 50% sure that the existing compatibility with KCT doesn't actually work. Some reports on that would be helpful; any day now, I'll have some time to spend on this.

I agree. There really needs to be a better way of tracking kerbals then by their name.

Kerbalstats uses a persist file to manage name changes, and professions based on their names. Based on what testing I've done, changing the name does not "break" their experience, as that seems to be persisted in the save. SM uses a hack to change the name with "non printing" characters to spoof the profession generator at load to assign the correct profession. It saves with no issues, and does not seem to cause any loss of experience, but I've not confirmed that with any of my users... The fact that it is kind of a hack is why I have kerbal renaming disabled by default and warn users to use at their own risk :)

I'm looking at integrating KerbalStats with Roster Manager to better handle persistence, but want to allow users the option of either using Kerbalstats or not.

@enneract, you may want to look into Kerbalstats as a possible means to solve your issues. I could see compatibility being improved with the use of that mod, along with my mod and yours... They could then all "play" together nicely...

Share this post


Link to post
Share on other sites
I agree. There really needs to be a better way of tracking kerbals then by their name.

Kerbalstats uses a persist file to manage name changes, and professions based on their names. Based on what testing I've done, changing the name does not "break" their experience, as that seems to be persisted in the save. SM uses a hack to change the name with "non printing" characters to spoof the profession generator at load to assign the correct profession. It saves with no issues, and does not seem to cause any loss of experience, but I've not confirmed that with any of my users... The fact that it is kind of a hack is why I have kerbal renaming disabled by default and warn users to use at their own risk :)

I'm looking at integrating KerbalStats with Roster Manager to better handle persistence, but want to allow users the option of either using Kerbalstats or not.

@enneract, you may want to look into Kerbalstats as a possible means to solve your issues. I could see compatibility being improved with the use of that mod, along with my mod and yours... They could then all "play" together nicely...

Good to hear from you.

It looks like KerbalStats doesn't currently support soft dependency (though that could be contributed if that is a thing you are really interested in, it isn't too difficult), nor does it (as of yet) support anything like name changes. If you are interested in collaborating on implementing that, I would be willing to make the attempt.

Share this post


Link to post
Share on other sites
Good to hear from you.

It looks like KerbalStats doesn't currently support soft dependency (though that could be contributed if that is a thing you are really interested in, it isn't too difficult), nor does it (as of yet) support anything like name changes. If you are interested in collaborating on implementing that, I would be willing to make the attempt.

KerbalStats does have a profession management ability, and that is only 1 step from name changes. I can see easily adding such support.

I would be willing to collaborate. I'll fork your code and get familiar with it. We can then start talking about extending KerbalStats with taniwha to fit our needs. I don't have much for Roster Manager yet (other than some ideas, but do have the Roster portion of SM in place as a starting point. You can look at portion of SM's code if you wish to see where I'm at there.

Share this post


Link to post
Share on other sites

Oh man dream come true. Papa and enneract you are both awesome and I cannot wait for your mods to work together I will have an even better career experience. :D

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.