Jump to content

[1.2] OSE Workshop - KIS Addon: (v1.1.0 - 2016.11.03)


ObiVanDamme

Recommended Posts

  • 3 weeks later...
  • 2 weeks later...

I've got a problem.

I flew a lab (stock) from the other side of Minmus, docked it to the base. Science didn't appear in the workshop until I switched to KSC then back. But then all seems to be fine and dandy - I began printing another lab (MK2) to extend the base. I made room for it in the container and...

 

pLDo4Uc.png

As you can see:

- there's enough room (18000l vs 15517l)

- the lab is completed.

- the container is 'favored' and empty

The log is spammed with repeated:

 

[ERR 20:59:50.342] [OSE] - OseModuleWorkshop_OnUpdate

[EXC 20:59:50.343] NullReferenceException: Object reference not set to an instance of an object
	ModuleScienceLab.OnSave (.ConfigNode node)
	PartModule.Save (.ConfigNode node)
	ProtoPartModuleSnapshot..ctor (.PartModule module)
	ProtoPartSnapshot..ctor (.Part PartRef, .ProtoVessel protoVessel)
	KIS.KIS_Shared.PartSnapshot (.Part part)
	KIS.KIS_Item..ctor (.Part part, KIS.ModuleKISInventory inventory, Single quantity)
	KIS.ModuleKISInventory.AddItem (.Part part, Single qty, Int32 slot)
	System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
	Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
	System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
	System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
	Workshop.KIS.ModuleKISInventory.AddItem (.Part partPrefab)
	Workshop.OseModuleWorkshop.AddToContainer (Workshop.WorkshopItem item)
	Workshop.OseModuleWorkshop.FinishManufacturing ()
	Workshop.OseModuleWorkshop.ProcessItem ()
	Workshop.OseModuleWorkshop.OnUpdate ()
	UnityEngine.Debug:LogException(Exception)
	Workshop.OseModuleWorkshop:OnUpdate()
	Part:ModulesOnUpdate()
	Part:Update()
[EXC 20:59:50.349] MissingMethodException: Method not found: 'FlightEVA.spawnEVA'.
	Part.ModulesOnUpdate ()
	Part.Update ()

Edit: It seems like the module (from the MK2 Expansion mod) can't be placed in the container. Either the workshop miscalculates the volume or there are some provisions against it. Regardless, it seems the standard lab (which should fit just the same; only a little larger but still under 18k suffers the same problem.)

Edited by Sharpy
Link to comment
Share on other sites

I don't know why the Workshop itself is blacklisted - one of the most awesome features of 3D printers is that they can print copies of themselves.

 

OTOH you might want another part blacklisted - the launch clamp. Produces 1 electricity per second, costs peanuts. Kinda RTG battery on steroids.

 

Edit: No, leave it in. If they use it, they have nobody to fault for the results, but themselves.

And the results can be hilarious.

Guilty as charged.

Edited by Sharpy
Link to comment
Share on other sites

On 9/22/2016 at 0:07 PM, Sharpy said:

I've got a problem.

I flew a lab (stock) from the other side of Minmus, docked it to the base. Science didn't appear in the workshop until I switched to KSC then back. But then all seems to be fine and dandy - I began printing another lab (MK2) to extend the base. I made room for it in the container and...

 

As you can see:

- there's enough room (18000l vs 15517l)

- the lab is completed.

- the container is 'favored' and empty

The log is spammed with repeated:

 


[ERR 20:59:50.342] [OSE] - OseModuleWorkshop_OnUpdate

[EXC 20:59:50.343] NullReferenceException: Object reference not set to an instance of an object
	ModuleScienceLab.OnSave (.ConfigNode node)
	PartModule.Save (.ConfigNode node)
	ProtoPartModuleSnapshot..ctor (.PartModule module)
	ProtoPartSnapshot..ctor (.Part PartRef, .ProtoVessel protoVessel)
	KIS.KIS_Shared.PartSnapshot (.Part part)
	KIS.KIS_Item..ctor (.Part part, KIS.ModuleKISInventory inventory, Single quantity)
	KIS.ModuleKISInventory.AddItem (.Part part, Single qty, Int32 slot)
	System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
	Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
	System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
	System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
	Workshop.KIS.ModuleKISInventory.AddItem (.Part partPrefab)
	Workshop.OseModuleWorkshop.AddToContainer (Workshop.WorkshopItem item)
	Workshop.OseModuleWorkshop.FinishManufacturing ()
	Workshop.OseModuleWorkshop.ProcessItem ()
	Workshop.OseModuleWorkshop.OnUpdate ()
	UnityEngine.Debug:LogException(Exception)
	Workshop.OseModuleWorkshop:OnUpdate()
	Part:ModulesOnUpdate()
	Part:Update()
[EXC 20:59:50.349] MissingMethodException: Method not found: 'FlightEVA.spawnEVA'.
	Part.ModulesOnUpdate ()
	Part.Update ()

Edit: It seems like the module (from the MK2 Expansion mod) can't be placed in the container. Either the workshop miscalculates the volume or there are some provisions against it. Regardless, it seems the standard lab (which should fit just the same; only a little larger but still under 18k suffers the same problem.)

The problem is not that the stock lab is blacklisted. The issue is the ModuleScienceLab doesn't like being saved when a part snapshot is taken. If you look at the error, it occurs when you try to add any part with a ModuleScienceLab to a KIS inventory. The fault is in the stock module, not KIS, though KIS may need to protect itself against the NRE. @IgorZ is aware of the issue so no need to bug him. :)

Edited by Angel-125
Link to comment
Share on other sites

2 hours ago, Baladain said:

@ObiVanDamme

Is there an official announcement if this is going to be supported for 1.2?

Don't know if @ObiVanDamme is working on it yet but I'm going through the code and making it KSP 1.2 ready. Once IgorZ has KIS ready for 1.2 I can have a build going. :)

Edited by Angel-125
Link to comment
Share on other sites

6 hours ago, Angel-125 said:

Don't know if @ObiVanDamme is working on it yet but I'm going through the code and making it KSP 1.2 ready. Once IgorZ has KIS ready for 1.2 I can have a build going. :)

Awaiting patiently. I have an idea for an entirely new career/campaign, based entirely around the OSE Workshop.

Spoiler

The Dunans.

A "base" on Duna, with absolute minimum of supplies - but counting the workshop amongst them. The kerbals need to return to Kerbin all on their own - building the craft from scratch, and assembling it with KIS/KAS only.

 

Link to comment
Share on other sites

On 10/2/2016 at 10:14 AM, Angel-125 said:

Don't know if @ObiVanDamme is working on it yet but I'm going through the code and making it KSP 1.2 ready. Once IgorZ has KIS ready for 1.2 I can have a build going. :)

You're good to go. 1.2-pre is out for KIS. And I really hope they've fixed science module there :) Otherwise, I'll have to make another workaround.

Link to comment
Share on other sites

57 minutes ago, IgorZ said:

You're good to go. 1.2-pre is out for KIS. And I really hope they've fixed science module there :) Otherwise, I'll have to make another workaround.

Awesome, thanks for all your hard work! :) I'll download it tomorrow and update OSE Workshop. Thanks again. :)

Link to comment
Share on other sites

Making progress on the update to OSE Workshop:

eFTQFbI.png

Basic functionality is working, and it integrates with the pre-release of KIS. I have to fiddle with the code to get the new part categories to show up, and add a cancel button somewhere so you can cancel the current production, then it will be good to go. :)

Link to comment
Share on other sites

Take a gander at OSE Workshop's KSP 1.2 GUI:

DsFtrK5.png

You can now pause/resume the current production and cancel the current production entirely.

Want to give it a try? Download it here! :)

Note that you'll need the latest Firespitter for KSP 1.2 and the KIS for KSP 1.2 pre-release to use OSE Workshop 1.0.0 properly. For this pre-release, you might need to manually add MaterialKits to the storage containers.

Looking at @ObiVanDamme's wish list, he also wants the ability to select which KIS inventory will receive the output, and enable efficiency based upon skill. Both I can do, but let's just make sure the current stuff works in KSP 1.2 first. :)

@IgorZ: Unfortunately, I get the same issue as before when trying to add a part with ModuleScienceContainer to a KISInventory. Here's the debug output:

Spoiler

[LOG 17:10:06.194] KIS.Container2 added to ship - part count: 2
[LOG 17:10:18.172] Start pickup in mode Move from part: WBI.DocSciLab (Part)
[WRN 17:10:19.606] WORKAROUND. Found null field shortName in module prefab WBIMultipurposeLab, fixing to default value of type System.String:
[EXC 17:10:19.609] NullReferenceException: Object reference not set to an instance of an object
    ModuleScienceLab.OnSave (.ConfigNode node)
    PartModule.Save (.ConfigNode node)
    ProtoPartModuleSnapshot..ctor (.PartModule module)
    ProtoPartSnapshot..ctor (.Part PartRef, .ProtoVessel protoVessel)
    KIS.KIS_Shared.PartSnapshot (.Part part)
    KIS.KIS_Item..ctor (.Part part, KIS.ModuleKISInventory inventory, Single quantity)
    KIS.ModuleKISInventory.AddItem (.Part part, Single qty, Int32 slot)
    KIS.ModuleKISInventory.GuiHandleEmptySlot (Rect textureRect, Int32 slotIndex)
    KIS.ModuleKISInventory.GuiInventory ()
    KIS.ModuleKISInventory.GuiMain (Int32 windowID)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)

 

 

Edited by Angel-125
Link to comment
Share on other sites

4 hours ago, Angel-125 said:

@IgorZ: Unfortunately, I get the same issue as before when trying to add a part with ModuleScienceContainer to a KISInventory. Here's the debug output:

I did an investigation, and I know why it's failing. But I have no idea why this code is working in the game and not working in snapshot.

Here is the problematic filed:

public class ModuleScienceLab : PartModule, IResourceConsumer
{
  public List<string> ExperimentData;

  ...
}

This field is not initialized anywhere in C# code (or I fail to find it). Not surprising snapshoting fails with NRE. If I don't figure out what's wrong with this field I'll probably add another dirty hack into KIS to initialize this field to an empty list.

Link to comment
Share on other sites

39 minutes ago, IgorZ said:

I did an investigation, and I know why it's failing. But I have no idea why this code is working in the game and not working in snapshot.

Here is the problematic filed:


public class ModuleScienceLab : PartModule, IResourceConsumer
{
  public List<string> ExperimentData;

  ...
}

This field is not initialized anywhere in C# code (or I fail to find it). Not surprising snapshoting fails with NRE. If I don't figure out what's wrong with this field I'll probably add another dirty hack into KIS to initialize this field to an empty list.

Thank you for investigating this. :)

Link to comment
Share on other sites

On 10/6/2016 at 3:11 AM, Angel-125 said:

Looking at @ObiVanDamme's wish list, he also wants the ability to select which KIS inventory will receive the output, and enable efficiency based upon skill. Both I can do, but let's just make sure the current stuff works in KSP 1.2 first. :)

We already have a "favor inventory" option... is this per-part inventory selection?  (part 1 in container A, part 2 in container B)

Link to comment
Share on other sites

On 10/7/2016 at 5:56 AM, Enceos said:

Hi @Angel-125, I've been out of KSP and modelling for a while. Is the hatch of the printing lab still obstructed in 1.2 prerelease?

Honestly I haven't checked. Most likely yes as I haven't touched the models.

8 hours ago, hab136 said:

We already have a "favor inventory" option... is this per-part inventory selection?  (part 1 in container A, part 2 in container B)

Yeah, it could be that "Favor Inventory" is what he was referring to. For efficiency based upon skill, I could see cutting production time down based upon engineering skills. Stock has the RepairSkill for engineers, that's probably close enough and avoids having to create a new skill. I'm thinking that for each rank the kerbal has, cut production time by 1-2%. So if you have a workshop staffed with two engineers and they're both 5-star, then production time gets cut by 10-20%. That way you don't fiddle with the resource mass required to build the part.

Link to comment
Share on other sites

Looking forward to this, had so much fun with this in 1.13, My gilly base build an lander to land ore on Eve and an single kerbal interplanetary ship, (life support and MK1 crew cabin for living space :))
Only bumper is that part  launch id is copied from the workshop so you can not build new satellites 

Link to comment
Share on other sites

On 8.10.2016 at 8:06 PM, Angel-125 said:

Honestly I haven't checked. Most likely yes as I haven't touched the models.

Yeah, it could be that "Favor Inventory" is what he was referring to. For efficiency based upon skill, I could see cutting production time down based upon engineering skills. Stock has the RepairSkill for engineers, that's probably close enough and avoids having to create a new skill. I'm thinking that for each rank the kerbal has, cut production time by 1-2%. So if you have a workshop staffed with two engineers and they're both 5-star, then production time gets cut by 10-20%. That way you don't fiddle with the resource mass required to build the part.

Hi @Angel-125, thank you for taking over the maintenance of OSE Workshop, I really appreciate that. Unfortunately I was extremely busy in the last few months and it will continue for the rest of the year at least. I hope that I will be back in KSP early next year. 

The favor inventory option is the item from my to do list. I would prefer a centralized method to select the inventory, but this approach already works. It is not per part, but globally for the vessel. The crew efficiency feature should use the engineers repair trait and cut the production time, as you already proposed. 

While I was not able to program for OSE Workshop or play KSP I developed a ton of Ideas to enhance the mod. If you like, we can discuss those Ideas and maybe continue to work on them together in 2017?!

Link to comment
Share on other sites

1 hour ago, ObiVanDamme said:

Hi @Angel-125, thank you for taking over the maintenance of OSE Workshop, I really appreciate that. Unfortunately I was extremely busy in the last few months and it will continue for the rest of the year at least. I hope that I will be back in KSP early next year. 

The favor inventory option is the item from my to do list. I would prefer a centralized method to select the inventory, but this approach already works. It is not per part, but globally for the vessel. The crew efficiency feature should use the engineers repair trait and cut the production time, as you already proposed. 

While I was not able to program for OSE Workshop or play KSP I developed a ton of Ideas to enhance the mod. If you like, we can discuss those Ideas and maybe continue to work on them together in 2017?!

No problem, happy to keep the lights on until you return. :) One way to centralize inventory selection is to do part highlighting and watch what part the user clicks on. I already have a system in place for MOLE's experiment  transfer system, so I know how to do that for OSE Workshop. For the crew efficiency, I figured it would give about 2% production speed improvement per star, modified by the kerbal's stupidly rating. Staffing the lab with smart and experienced engineer types is a good thing. I can do both of those after kicking the latest release out the door and finishing up work on Snacks.

It sounds like we'll have extra improvements in 2017 too, I should be able to help, time permitting. :) 

Link to comment
Share on other sites

5 minutes ago, Angel-125 said:

No problem, happy to keep the lights on until you return. :) One way to centralize inventory selection is to do part highlighting and watch what part the user clicks on. I already have a system in place for MOLE's experiment  transfer system, so I know how to do that for OSE Workshop. For the crew efficiency, I figured it would give about 2% production speed improvement per star, modified by the kerbal's stupidly rating. Staffing the lab with smart and experienced engineer types is a good thing. I can do both of those after kicking the latest release out the door and finishing up work on Snacks.

It sounds like we'll have extra improvements in 2017 too, I should be able to help, time permitting. :) 

Just to chime in.  I would only throw in that it would be nice if the stupidity rating at worst doesn't cause a negative effect.  Those traits in game are borderline maddening, especially in places like EPL where it can bring productivity below 0.  The main reason is that while you can train kerbals to increase their stars, there is no way to "train" up their stupidity trait (at least as far as I am aware).  And since it is a completely random trait it becomes un-fun in my opinion to work around.

Link to comment
Share on other sites

1 hour ago, goldenpsp said:

Just to chime in.  I would only throw in that it would be nice if the stupidity rating at worst doesn't cause a negative effect.  Those traits in game are borderline maddening, especially in places like EPL where it can bring productivity below 0.  The main reason is that while you can train kerbals to increase their stars, there is no way to "train" up their stupidity trait (at least as far as I am aware).  And since it is a completely random trait it becomes un-fun in my opinion to work around.

Right. The productivity gains would work like this: ConstructionTime - (1.0 * (experience rank * stupidity))

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