Jump to content

[.25.x] RealRoster - Editor Crew Tab Fixed


enneract

Recommended Posts

I did some limited testing, and I think it works fine.

It does work on both KSC and Editors scenes, I didn't encounter any bugs. As it is very late (or very early;p) where I live, I don't really have time to give it anymore testing, but if I'll find any bugs tomorrow, I'll be sure to report them to you.

Link to comment
Share on other sites

Hey guys, here's something I've been working on for Real Roster: crew rotation. Instead of random selection, it maintains a separate list of Kerbals who have been assigned to craft. When they launch, those Kerbals are moved to the bottom of the list. So far it looks like the bugs have been worked out of it and I've done a pull request to enneract for inclusion.

But it would also be good to get some more people looking at this and see if they can break it / find bugs, etc.

To enable rotation, make sure that crew assignment is on and randomization is turned off. (even if assignment is off or randomization is on, Kerbal assignments are tracked so that when rotation is turned on it knows what Kerbals should be assigned ndext)

One last thing, the rotation roster is on a per save game basis and is saved in your save game files via the Scenario class.

dll is a drop in replacement.

changes and additions / source here: (feel free to use the Scenario code)

https://www.dropbox.com/s/xd73zd4qchxtpj4/RealRoster.dll?dl=1

Link to comment
Share on other sites

Ok I just downloaded enneract's latest branch and crew do randomize when a pod is placed that will have crew assigned to it.

But it's not working for ships loaded into the editor. (as in a craft file)...... I honestly can't remember if that was something that was working in the older versions. I think it was unless I just didn't notice.....

Link to comment
Share on other sites

Sorry, I said rotation but I meant randomization. I never DLed his branch to test yet.
Try hiring new kerbals and see if the new ones get added to the randomization. I'm having trouble with that unless i go into the RR settings and click some buttons.

that is freaking weird. The roster isn't cached.

Ok I just downloaded enneract's latest branch and crew do randomize when a pod is placed that will have crew assigned to it.

But it's not working for ships loaded into the editor. (as in a craft file)...... I honestly can't remember if that was something that was working in the older versions. I think it was unless I just didn't notice.....

I never figured out a great way to detect .craft file loads. All I can think of is replacing use of the GameEvent with polling the size of the vessel each (or some interval of) frame, but even then how do you tell a craft file from a subassembly? If you have any ideas, I'm all ears.

Edited by enneract
Link to comment
Share on other sites

that is freaking weird. The roster isn't cached.

I never figured out a great way to detect .craft file loads. All I can think of is replacing use of the GameEvent with polling the size of the vessel each (or some interval of) frame, but even then how do you tell a craft file from a subassembly? If you have any ideas, I'm all ears.

I'll have to think on it. I know there's an event that fires for both loads and changes. onEditorVesselChange? Or some such. I wasn't aware it also happened for subassemblies.

Link to comment
Share on other sites

I'll have to think on it. I know there's an event that fires for both loads and changes. onEditorVesselChange? Or some such. I wasn't aware it also happened for subassemblies.

Yea, I'm using that event. It doesn't actually fire on load, iirc.

Link to comment
Share on other sites

While chasing down another error, I found in the logs that RealRoster seems to be producing lots of NullReferenceExceptions (even when it's the only addon installed). I don't think it's causing any issues for me, but I figured you ought to know:

NullReferenceException: Object reference not set to an instance of an object
at RenderingManager.AddToPostDrawQueue (Int32 queueSpot, .Callback drawFunction) [0x00000] in <filename unknown>:0

at RealRoster.RealRosterGUI.init () [0x00000] in <filename unknown>:0

at RealRoster.RealRoster.Start () [0x00000] in <filename unknown>:0

Sometimes the stack begins with:

  at RealRoster.RealRosterGUI.AddToolbarButton () [0x00000] in <filename unknown>:0 

For all of these errors except the first in the log, the line "AddonLoader: Instantiating addon 'RealRoster' from assembly 'RealRoster'" comes before the NRE.

I was also finding that my crew wasn't getting randomized when I loaded a vessel in the editor or directly to the launchpad (which I do much more frequently than making a whole new rocket in the editor), but I see that's a known issue. Best of luck to resolve it.

Link to comment
Share on other sites

While chasing down another error, I found in the logs that RealRoster seems to be producing lots of NullReferenceExceptions (even when it's the only addon installed). I don't think it's causing any issues for me, but I figured you ought to know:

NullReferenceException: Object reference not set to an instance of an object
at RenderingManager.AddToPostDrawQueue (Int32 queueSpot, .Callback drawFunction) [0x00000] in <filename unknown>:0

at RealRoster.RealRosterGUI.init () [0x00000] in <filename unknown>:0

at RealRoster.RealRoster.Start () [0x00000] in <filename unknown>:0

Sometimes the stack begins with:

  at RealRoster.RealRosterGUI.AddToolbarButton () [0x00000] in <filename unknown>:0 

For all of these errors except the first in the log, the line "AddonLoader: Instantiating addon 'RealRoster' from assembly 'RealRoster'" comes before the NRE.

I was also finding that my crew wasn't getting randomized when I loaded a vessel in the editor or directly to the launchpad (which I do much more frequently than making a whole new rocket in the editor), but I see that's a known issue. Best of luck to resolve it.

Hrrrrrm.

This is without Blizzy's toolbar?

Link to comment
Share on other sites

While chasing down another error, I found in the logs that RealRoster seems to be producing lots of NullReferenceExceptions (even when it's the only addon installed). I don't think it's causing any issues for me, but I figured you ought to know:

NullReferenceException: Object reference not set to an instance of an object
at RenderingManager.AddToPostDrawQueue (Int32 queueSpot, .Callback drawFunction) [0x00000] in <filename unknown>:0

at RealRoster.RealRosterGUI.init () [0x00000] in <filename unknown>:0

at RealRoster.RealRoster.Start () [0x00000] in <filename unknown>:0

Sometimes the stack begins with:

  at RealRoster.RealRosterGUI.AddToolbarButton () [0x00000] in <filename unknown>:0 

For all of these errors except the first in the log, the line "AddonLoader: Instantiating addon 'RealRoster' from assembly 'RealRoster'" comes before the NRE.

I was also finding that my crew wasn't getting randomized when I loaded a vessel in the editor or directly to the launchpad (which I do much more frequently than making a whole new rocket in the editor), but I see that's a known issue. Best of luck to resolve it.

Fixed. Please try latest release.

Link to comment
Share on other sites

Both with and without. I had thought it was just trying and failing to make a button when the toolbar mod was absent, but they still happened when I had Blizzy's toolbar installed.

Another sort of NRE I've just got in output_log.txt after a RealRoster-and-Toolbar-only session:

NullReferenceException: Object reference not set to an instance of an object
at RealRoster.RealRoster.Update () [0x00000] in <filename unknown>:0

(That's all there is in the stack this time.)

Funnily enough, when I have more addons, it seems there are fewer NREs from this mod. I also just did a test run with all of my mods present, and there was only one NRE from RealRoster (like the one in my previous post) at the very beginning.

I'm sorry I don't have much more detailed information than this. Also, I just noticed that you've released a rev2 in the last few days, which I don't think I've installed. (Could you include a file with the version number in future downloads?) Let me see if the issue is still present with that one.

Link to comment
Share on other sites

Both with and without. I had thought it was just trying and failing to make a button when the toolbar mod was absent, but they still happened when I had Blizzy's toolbar installed.

Another sort of NRE I've just got in output_log.txt after a RealRoster-and-Toolbar-only session:

NullReferenceException: Object reference not set to an instance of an object
at RealRoster.RealRoster.Update () [0x00000] in <filename unknown>:0

(That's all there is in the stack this time.)

Funnily enough, when I have more addons, it seems there are fewer NREs from this mod. I also just did a test run with all of my mods present, and there was only one NRE from RealRoster (like the one in my previous post) at the very beginning.

I'm sorry I don't have much more detailed information than this. Also, I just noticed that you've released a rev2 in the last few days, which I don't think I've installed. (Could you include a file with the version number in future downloads?) Let me see if the issue is still present with that one.

rev2 was released about 5 minutes ago. It contains some updates that have been pending, as well as a fix for the issue you reported.

I didn't do the soft dependency on toolbar correctly, that has been resolved.

I also think that I've figured out a way to apply custom crewing on loading a saved ship, but that is going to take longer to integrate, as I want to do a general code cleanup also.

Link to comment
Share on other sites

With rev2 and toolbar, there were only two NREs (of the same kind as before, starting with RenderingManager.AddToPostDrawQueue) during loading (as in, before "Scene Change: from LOADING to MAINMENU"). I didn't see the toolbar in the Editor, though my crew was randomized when I built a new vessel.

With rev2 alone: No NREs at all.

With rev2 and toolbar again, to prove to myself that I wasn't going crazy and not seeing the button in the editor: No, I wasn't crazy. Same two NREs during loading, and also a whole bunch of a new kind right after "Scene Change : From SPACECENTER to EDITOR (Async)", ending before the game starts loading the ScenarioDestructibles:

NullReferenceException: Object reference not set to an instance of an object
at RealRoster.RealRoster.syncDictionary () [0x00000] in <filename unknown>:0

at RealRoster.RealRoster.Update () [0x00000] in <filename unknown>:0

Link to comment
Share on other sites

rev2 was released about 5 minutes ago. It contains some updates that have been pending, as well as a fix for the issue you reported.

I didn't do the soft dependency on toolbar correctly, that has been resolved.

I also think that I've figured out a way to apply custom crewing on loading a saved ship, but that is going to take longer to integrate, as I want to do a general code cleanup also.

Thanks again for your work on this. With any luck, maybe squad will take the hint.

I'll test the new version in the next few days.

Link to comment
Share on other sites

Yea. Rev2 was a quick fix, and I lost the changes which displayed the toolbar in editor. Rev3 will be today or tomorrow, and should fix those outstanding issues.

That being said, the errors in rev2 *should* be harmless.

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