Jump to content

[1.12.x] What Do I Need?


Recommended Posts

This is a simple mod designed to show on-screen what science parts are needed to support the selected contracts.  The display can be made transparent and click-through can be allowed to allow it to not interfere with the editor.  It is only available in the Editor (VAB or SPH).

New in 0.0.1.2:  Also, will show what parts are needed to fulfil part testing contracts and vessel repair contracts

New in 0.0.1.3:

  • Updated help text for additional functionality
  • Added support for stock inventory system
  • Add support for KIS
  • Added code to remember last contracts selected
  • Added code to optionally reopen window if it was open when the editor is exited

 

The toolbar button looks like the following:

WhatDoINeed-38.png?raw=true


Clicking the button for this mod will bring up a simple window which will look similar to the following image:

window.png?raw=true

 

The initial screen will initially show all active contracts.  At the bottom there will be three buttons:

  • Select              Click to open contract selection screen
  • Close               Close the window
  • Settings         Open the settings panel

The Contract Selection screen will show a list of all active contracts.  You can deselect some or all of the active contracts on this screen.  Click the toggle to select those contracts you want to display or deselect, then click the Select Button

The Settings page will display three toggles on the first line:

  • Display Briefing        If checked, then the briefing for the contract will be shown
  • Bold                                Make the display font bold
  • Lock Position            Clock the window position
  • Hide Buttons            Hide the buttons at the bottom when the selection screen is closed

The next two lines will have the following toggles:

  • Allow click-through    If enabled, this will have the contract display window to allow clicks to fall through to game objects below.  This will only be enabled when the settings panel is NOT displayed
  • Show all active contracts upon entry    If enabled (defaults to enabled), then entering the editor will automatically populate all the active contracts in the mod

The following sliders are available:

  • Transparency            Set the transparency of the window, all the way left makes the window totally transparent
  • Hide Time                   Sets the amount of time the window will hide when the H button in the upper right is pressed
  • Font Size                      Set the size of the font to be used

Additional controls are in the upper left:

  • B                    Hide or show the buttons
  • L                    Lock the position of the window.  When locked, the window cannot be moved or resized
  • S                    Show the Settings panel

Upper right:

  • X                    Close the window

Lower right:

  • diagonal arrow        Resize the window


The window will show the selected active contracts.  Initially all experiments will be shown, along with all the parts that can provide the experiment needed.  There is a button to the left of each contract, which will allow you to collapse the experiments included in that contract.

Font Colors

  • Contacts will be shown in yellow.
  • If enabled, the briefing text will be white
  • Experiments will be shown in a light blue.  
  • Fulfilling parts (parts which can run the experiment):  The parts will be shown in either red or green.  
    Red means it is NOT part of the current vessel, green means it IS on the current vessel.  Additionally, for parts which are already on the vessel, the number of those parts on the vessel will be shown in parenthesis to the right of the part name

Supported Mods

  • Orbital Science
  • ScanSAT

Dependencies

 

Known Issues

The following science mods are not yet supported:

  • Orbital Survey Plus
  • Sci Rev ???
  • StationScience (probably not_
  • Impact
  • NehemiahEngineeringOrbitalScience
  • Tarsier Space Technology
  • Rover Science
  • Space Dust
Edited by linuxgurugamer
Link to comment
Share on other sites

6 hours ago, linuxgurugamer said:

I'll be releasing an update soon which will add support for both the stock inventory system and KIS

Update has been released and is available in all the usual places (including via CKAN)

Link to comment
Share on other sites

To follow up on tonight's stream, I have the following suggestions/observations:

  • The Contract Selection window displays the contract titles centre-justified.  This is inconvenient since that particular window currently cannot be resized and if you have contracts with long names, the ones with short names can be hidden unnecessarily.  See screenshot below in 2.
  •  There seems to be vertical misalignment in Contract Selection window between the selection button and the contract title.  This results in guess work when selecting a contract, especially in the middle of a long list.  Edit:  The workaround, as pointed out by LGG, is the titles themselves can be clicked instead of the button.
      pgu2jmJ.png
     
  •  I have a magnetic survey contract that requires Magnetometer Boom and RPWS Antenna on the craft.  They don't show up in the mod for some reason. y1Rbmna.png
     
  • Another contract in which there are no experiment parts listed, just the required outcome.  Shouldn't there be parts listed in the Active Contracts window?  uGuVaDG.png
Edited by Brigadier
Added workaround for misalignment of buttons
Link to comment
Share on other sites

Does anyone have this working with ScanSat? If yes, which planet pack are you using?

I'm trying this with JNSQ and none of the ScanSat parts are detected. I see the contracts and the relevant ScanSat experiment names, but "Fulfilling Parts" is empty even though I've unlocked the parts in career mode. The last screenshot in @Brigadier post above shows the same problem I have.

 

 

Link to comment
Share on other sites

@DeadJohnFYI, I'm in stock system so I don't believe it's a planet pack problem.  During his last stream, LGG mentioned that DMagic parts and/or ScanSat itself had been giving him problems during the initial coding.  I'm sure he's on it.

Edited by Brigadier
Link to comment
Share on other sites

1 hour ago, Brigadier said:

@DeadJohnFYI, I'm in stock system so I don't believe it's a planet pack problem.  During his last stream, LGG mentioned that DMagic parts and/or ScanSat itself had been giving him problems during the initial coding.  I'm sure he's on it.

Thanks. Now I know not to waste my time debugging or LGG's time reading through my log files :)

Link to comment
Share on other sites

This is definitely a must-have for Kerbal brained ship designers like myself. Congratulations on the release.

I also highly appreciate your adopted "Where Can I Go?" mod, possibly that mod inspired you in thinking about a series of useful QoL mods with similar names?

I think probably "Who" might be covered by:

"How" and "Why" are probably covered by mods without such names, but one can always dream, and this is not a suggestion for LGG to come up with anything.

 

Link to comment
Share on other sites

@linuxgurugamer It looks like there's some interaction happening between What Do I Need, KIS, and KSPCF. KIS isn't a hard dependency, correct?

What Do I Need still seems to work. The only issue I'm seeing in game is the SCANsat issue mentioned earlier in the thread which may or may not be connected to this log error.

[WRN 19:07:12.162] [KSPCF] A ReflectionTypeLoadException thrown by Assembly.GetTypes() has been handled by KSP Community Fixes.
This is usually harmless, but indicates that the "WhatDoINeed" plugin failed to load (location: "GameData\WhatDoINeed\Plugins\WhatDoINeed.dll")
It happened because "WhatDoINeed" is missing the following dependencies : "KIS"

Full log at https://drive.google.com/file/d/1tLTksuDM682yNrFDz0gbS86Iy-edijuD/view?usp=sharing

 

Edited by DeadJohn
Link to comment
Share on other sites

1 hour ago, DeadJohn said:

@linuxgurugamer It looks like there's some interaction happening between What Do I Need, KIS, and KSPCF. KIS isn't a hard dependency, correct?

What Do I Need still seems to work. The only issue I'm seeing in game is the SCANsat issue mentioned earlier in the thread which may or may not be connected to this log error.

[WRN 19:07:12.162] [KSPCF] A ReflectionTypeLoadException thrown by Assembly.GetTypes() has been handled by KSP Community Fixes.
This is usually harmless, but indicates that the "WhatDoINeed" plugin failed to load (location: "GameData\WhatDoINeed\Plugins\WhatDoINeed.dll")
It happened because "WhatDoINeed" is missing the following dependencies : "KIS"

 

Correct, at least according to CKAN.

FYI, I have the same 3 mods but don't see this warning in either player.log or KSP.log.

Link to comment
Share on other sites

11 hours ago, DeadJohn said:

@linuxgurugamer It looks like there's some interaction happening between What Do I Need, KIS, and KSPCF. KIS isn't a hard dependency, correct?

What Do I Need still seems to work. The only issue I'm seeing in game is the SCANsat issue mentioned earlier in the thread which may or may not be connected to this log error.

[WRN 19:07:12.162] [KSPCF] A ReflectionTypeLoadException thrown by Assembly.GetTypes() has been handled by KSP Community Fixes.
This is usually harmless, but indicates that the "WhatDoINeed" plugin failed to load (location: "GameData\WhatDoINeed\Plugins\WhatDoINeed.dll")
It happened because "WhatDoINeed" is missing the following dependencies : "KIS"

Full log at https://drive.google.com/file/d/1tLTksuDM682yNrFDz0gbS86Iy-edijuD/view?usp=sharing

 

 

10 hours ago, Brigadier said:

Correct, at least according to CKAN.

FYI, I have the same 3 mods but don't see this warning in either player.log or KSP.log.

 

No, it's not a hard dependency.  The error will be removed in the next version, I figured out how to work with the mods without those references.

I'm working right now on getting full SCANsat integration.  It's a pita, I'm making progress, but will be another few days

Link to comment
Share on other sites

  • 2 weeks later...

New release, 0.0.2

  • Fixed window not seeing an attached or detached part until a seperate click was made
  • Left-justifed & larger font for contracts in contract selection window
  • Removed toggle from contact selection window
  • Added color coding of contracts in contract selection window (red == not selected)
  • Added support for DMagic science parts
  • Added support for REPOSoft parts
  • Fixed autoselection of all when none selected not working at times
  • Fixed last open status being honored
  • Fixed window not closing immediately upon scene exit
  • Added a confirmation window before launching a new vessel
  • Made settings window use entire window when active
  • Removed need to compile with KIS and SCANsat dlls (added a bit of Reflection)
  • Replaced the "foreach" statements with "for (int i = 0; i < var.count; i++)" where applicable (for efficiency)
  • Updated and reorganized Help window reflecting new mode for settings pane
  • Added support for SCANsat
  • Added the ConstructionParameter support
  • Fixed style of the Contract Selection window to match main window
  • Changed button name for contact selection to "Contract Selection"
Link to comment
Share on other sites

Updated to v0.0.2 and the WDIN icon no longer appears on the VAB or SPH toolbar.  Removed and reinstalled via CKAN and I can confirm that the GameData\WDIN folder exists with contents.  Only WDIN error in the KSP/player.log is :
 

[ERR 23:08:51.956] WhatDoINeed: Error 2, experiment is null

[EXC 23:08:51.959] ArgumentNullException: Value cannot be null.
Parameter name: key
    System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <9577ac7a62ef43179789031239ba8798>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <9577ac7a62ef43179789031239ba8798>:0)
    WhatDoINeed.WhatDoINeed.SetUpExperimentParts () (at <6873a91d132a47a2aa11b0196a932b62>:0)
    WhatDoINeed.WhatDoINeed.Start () (at <6873a91d132a47a2aa11b0196a932b62>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

 

Link to comment
Share on other sites

As per my comment in tonight's Twitch session, I've updated to v0.0.3 and restarted the game.  Still no WDIN icon on the VAB stock toolbar.  However, I am getting several WDIN errors in the KSP.log:

  1. Error 2, experiment is null
  2. Error 3, experiment is null
  3. SCANsatCoverage scanType: 2 not a number
  4. SCANsatCoverage scanType: 256 not a number

KSP.log and .sfs file are in this Dropbox  folder.

Link to comment
Share on other sites

On 2/10/2025 at 12:05 AM, Brigadier said:

As per my comment in tonight's Twitch session, I've updated to v0.0.3 and restarted the game.  Still no WDIN icon on the VAB stock toolbar.  However, I am getting several WDIN errors in the KSP.log:

  1. Error 2, experiment is null
  2. Error 3, experiment is null
  3. SCANsatCoverage scanType: 2 not a number
  4. SCANsatCoverage scanType: 256 not a number

KSP.log and .sfs file are in this Dropbox  folder.

Thanks.  I've been looking at it, so far no idea what's happening, there isn't the expected nullref.  If you could create that sandbox example you mentioned, zip up the entire sandbox save for me, would be helpful

Those messages "Error 2/3" are not really errors, just left over debugging messages, you can ignore them.  The other two regarding the scanType may be an issue

Edit:  I found the error, so will be just a matter of time to fix:

177873 ArgumentException: An item with the same key has already been added. Key: SCANsat

 

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 4 weeks later...

New major release, 0.0.4

I would like to express my deep thanks and appreciation to @Brigadier for helping me with testing this new release.  His patience and throughness is greatly appreciated.

 

  •     Adjusted colors again
  •     Changed selection window so that it shows along with the main window, instead of replacing it
  •     Added support for ContractConfigurator Filter section (Added check for parts, and for both parts &  partModules now looks for multiple entries in the filter)
  •     Changed settings from being saved to file to being saved in game file as a scenario
  •     Total rewrite of internal structure 
  •     Rewrote Contract Display Window to allow scanning of contracts before displaying them, needed to enable the launch button check to work again
  •     Redid where the settings are saved.  Now saves all non-game-specific settings to a local config file, saves the selected contracts in the game persistent.sfs file
  •     Fixed the saving of the window posiiton
  •     Fixed the Reopen when entering editor
  •     Fixed scanning of ship after being loaded in editor (also after starting a new ship)
  •     Removed the number of scans of ship
  •     Added a filter to only show contracts which require a new vessel
  •     Changed display as follows:
  •         1.  Experiments are shown in either red or green, green meaning the necessary parts are there
  •         2.  Parts are shown in cyan.  A check mark will be placed next to parts which are on the vessel
  •         3.  The unnecessary line saying required parts/modules has been removed
  •     Added wrapping of the contract titles
  •     Optimized window display to reduce processing time
  •     Added resizing handle for Contract Selection Window
  •     Fixed resizing of width for main window
  •     Fixed parts with category = none causing a keynotfound exception
  •     Fixed the over-optimized calls which were preventing the screen from updating properly
  •     Improved the summary in the Unfullfillable  Contracts dialog:
  •         List # contracts which have all requirements
  •         List # of contracts which are  missing requirements
  •     Added code to save the selection window position to the file
  •     Remove number of missing parts from the pre-launch warning
  •     Make lock position setting apply to the contract selection window
  •     Make settings into new window
  •     Removed the Hide Buttons setting
  •     Changed the contract selection window to it's own monobehaviour
  •     Updated title of settings window
  •     Add code to preprocess part title, deleting anything for "<color" to the end (needed for @zer0Kerbal's mods)
  •     Make H hide all windows
  •     Fix title of the  "Active Contracts" window.
  •     Make the "Close Settings" button on the Settings window should width-centered.
  •     Adjusted the size of the Close Contract Selection button
  •     Improved descriptions for ScanSat scans
  •     Made fonts in the Settings window adjust according to the font size settings
  •     Added wordwrapping to the Contract Title and briefing notes in the Active Contracts window
  •     Replaced launch dialog with Monobehavour window
  •     Launch Check window now always stays on top
  •     Reduced size of Contract Selection Window data lines
  •     Added bullet to beginning of lines in Contract Selection Window
  •     Fixed Clicking the 'S' button to display the Settings window should change the Settings button on the Active Contracts window to "Close Settings'.
  •     Fixed Clicking the 'S' button a second time should close the Settings window.  Currently, you have to close the window by clicking the Settings window's own close button once or the Active Contracts Settings button twice.
  •     Added new buttons to expand or collapse all the contracts on the Active Contracts window.  
  •     Add a button to show/hide the briefing
  •     Added button to contract list for contract to open a nwe PartsWindow, showing requiring parts of a particular type
  •     Fixed font resizing the the Parts Available window
  •     Added new button to Parts Available to either Show Mounted Parts or Show All Parts
  •     Added bullet to each line in the Contract Selection window
  •     Added ability to spawn part by clicking on part name, both in the partlist and the main window.   If there is a part already selected then the selected part will be deleted and a new part will be created,
  •     Added ability to show parts needed for modules in the Active Contracts window, expandable with a +/- button
  •     Updated the +/- button to use icon instead of button
  •     Fixed settings window debug option to have toggle shown.
  •     Moved all toggles to the left
  •     Fixed settings window font size
  •     Added settings window resize ability
  •     Adjusted layout of checkbox in Settings window
  •     Settings window will now close if all other windows are closed
  •     Windows will now fade when a part is spawned.
  •     New option added to control hide time when part spawned
  •     Fix colors in the settings window
  •     Fix colors on the launch check window
  •     Font slider behaviour fixed, no flickering anymore
  •     The text wrapping in the Contract Selection window has been corrected to take into account the scrollbars
  •     Clicking on the mod icon now closes all windows
  •     When clicking on the toolbar icon a second time, WDIN windows now return to their former state 
  •     On the Settings window, the "Check For Missing..." and "Only Check Selected..." are now grouped
  •     On the Settings window, the part spawning options are now grouped
  •     The "Debug mode" button moved to the bottom
  •     The parts in the Parts window are indented again.  The checkmark now back in the resulting margin 
  •     The expand/collapse buttons are now indented for the modulesn.
  •     Fixed text in Title bar goes blank when not focused.
  •     Added a checkmark to the appropriate Active Contracts window lines that have Parts buttons, reflecting the presence of a needed part.
  •     Swap + and - buttons
  •     Filter out launchclamps:  launchClamp1
  •     Changed filter for launchclamps to look for a module called LaunchClamp
  •     Fixed (again) the initial selection of all contracts if none are active
  •     Changed display of checkmark to keep text lines aligned
  •     Added checkmark to Module line when parts with module exist
  •     Fixed the launch clamp filter 
  •     Fixed Near Future Exploration antenna parts not showing up in list
  •     Fixed Settings window opening upon reopen when it was closed
Link to comment
Share on other sites

2 hours ago, linuxgurugamer said:

I would like to express my deep thanks and appreciation to @Brigadier for helping me with testing this new release.  His patience and throughness is greatly appreciated.

Thank you; it was my pleasure.  Anyway, you did the hard part and it only took us a month &)

Edited by Brigadier
Link to comment
Share on other sites

4 hours ago, drhay53 said:

I updated from CKAN this morning, and now when I right click a part in the VAB I get massive log spam and the PAW never comes up. Here's a log:

I can confirm this issue, @linuxgurugamer

Probably some debug statements that LGG hasn't removed yet.  He'll confirm my guess and deal with it, I'm sure.  I noticed that double-right-clicking worked as expected for a single click.

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