Jump to content

[Minimum KSP: 1.12.2] Snacks! - Friendly, Simplified Life Support


Angelo Kerman

Recommended Posts

 

21 hours ago, Capt. Hunt said:

cool!  A full days worth of snacks might be a little OP though, unless you fixed the bug where an EVAed astronaut's snacks are not subtracted from the mothership when they leave.  I foresee an exploit where you could set Meals Per Day to maximum and use EVAs to replenish your food supply just by sending them outside and then back in.

Since we have options for meals per day and also snacks per meal, maybe an EVAed kerbal should only carry 1 meal's worth of snacks, rather then a full day's ration.  How often are they going to be outside for an entire day anyway?

I fixed that issue. Kerbals pull snacks from the ship when they EVA, and put it back when they return. You need a full day's worth because you don't know when snack time will be, and if you don't have enough then you'll take a hit.

Link to comment
Share on other sites

cool,

Speaking of which, would it be possible to make it so that the feedings are still random, but also spaced equally throughout the day? or maybe enforce a minimum time between meals?  You wouldn't want the kerbals to eat all their meals within 5 minutes and then go hungry for 6 hours, right?

Sorry to bug you, I'm just trying to pick apart the timing algorithm for potential issues.

Link to comment
Share on other sites

42 minutes ago, Capt. Hunt said:

cool,

Speaking of which, would it be possible to make it so that the feedings are still random, but also spaced equally throughout the day? or maybe enforce a minimum time between meals?  You wouldn't want the kerbals to eat all their meals within 5 minutes and then go hungry for 6 hours, right?

Sorry to bug you, I'm just trying to pick apart the timing algorithm for potential issues.

Not really. When you enable random snacking, the time is based upon meals per day. So if you have 3 meals per day, you snack between 1-2 hours.

Link to comment
Share on other sites

Spoiler

[ERR 04:50:43.021] Exception handling event onVesselRecovered in class SnackController:System.NullReferenceException: Object reference not set to an instance of an object
  at Snacks.SnackController.onVesselRecovered (.ProtoVessel protoVessel, Boolean someBool) [0x00000] in <filename unknown>:0
  at EventData`2[ProtoVessel,System.Boolean].Fire (.ProtoVessel data0, Boolean data1) [0x00000] in <filename unknown>:0

[EXC 04:50:43.022] NullReferenceException: Object reference not set to an instance of an object
    Snacks.SnackController.onVesselRecovered (.ProtoVessel protoVessel, Boolean someBool)
    EventData`2[ProtoVessel,System.Boolean].Fire (.ProtoVessel data0, Boolean data1)
    UnityEngine.Debug:LogException(Exception)
    EventData`2:Fire(ProtoVessel, Boolean)
    VesselRetrieval:recoverVessel(Vessel)
    VesselRetrieval:recoverVessels()
    <OnLevelLoaded>c__Iterator46:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Spoiler

NullReferenceException: Object reference not set to an instance of an object
    Snacks.FaintPenalty.CheckFaintKerbals (.Vessel vessel)
    Snacks.SnacksVesselModule.OnStart ()
    VesselModule.Start ()

https://www.dropbox.com/s/dmo1qgsms09nico/KSP-Snacks2.rar?dl=0

 

While playing one of the scenarios, I think this is because scenarios do not set difficulty and Snacks mod doesn't know what to do, no such error occurs in career or sandbox(i think), still maybe it;s important.

Edited by dtoxic
Link to comment
Share on other sites

On 10/25/2016 at 7:53 PM, dtoxic said:
  Hide contents

[ERR 04:50:43.021] Exception handling event onVesselRecovered in class SnackController:System.NullReferenceException: Object reference not set to an instance of an object
  at Snacks.SnackController.onVesselRecovered (.ProtoVessel protoVessel, Boolean someBool) [0x00000] in <filename unknown>:0
  at EventData`2[ProtoVessel,System.Boolean].Fire (.ProtoVessel data0, Boolean data1) [0x00000] in <filename unknown>:0

[EXC 04:50:43.022] NullReferenceException: Object reference not set to an instance of an object
    Snacks.SnackController.onVesselRecovered (.ProtoVessel protoVessel, Boolean someBool)
    EventData`2[ProtoVessel,System.Boolean].Fire (.ProtoVessel data0, Boolean data1)
    UnityEngine.Debug:LogException(Exception)
    EventData`2:Fire(ProtoVessel, Boolean)
    VesselRetrieval:recoverVessel(Vessel)
    VesselRetrieval:recoverVessels()
    <OnLevelLoaded>c__Iterator46:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

  Hide contents

NullReferenceException: Object reference not set to an instance of an object
    Snacks.FaintPenalty.CheckFaintKerbals (.Vessel vessel)
    Snacks.SnacksVesselModule.OnStart ()
    VesselModule.Start ()

https://www.dropbox.com/s/dmo1qgsms09nico/KSP-Snacks2.rar?dl=0

 

While playing one of the scenarios, I think this is because scenarios do not set difficulty and Snacks mod doesn't know what to do, no such error occurs in career or sandbox(i think), still maybe it;s important.

Ok, I think I fixed that, and found a situation where the MM patches weren't adding Snacks to parts. I fixed it for new vessels in the editor; now I can watch for part placement events and add snacks as needed. I might get to the point were the MM patch won't be needed. :)

Link to comment
Share on other sites

I'm not quite sure if I'm missing some vital detail, but actual snack consumption seems to be only 40% of the expected value. A 50 day stay (1 snack per meal and day, no active recyclers) in a Mk.I Lander Can still leaves me with 30 snacks and an estimation of 30 more days before supplies run out.

Link to comment
Share on other sites

2 hours ago, Piscator said:

I'm not quite sure if I'm missing some vital detail, but actual snack consumption seems to be only 40% of the expected value. A 50 day stay (1 snack per meal and day, no active recyclers) in a Mk.I Lander Can still leaves me with 30 snacks and an estimation of 30 more days before supplies run out.

Meals per day is supposed to be 3 by default, maybe this setting is 1 in your save? With 1 meal/day  a can can supply for 83 days.

Link to comment
Share on other sites

3 hours ago, Piscator said:

I'm not quite sure if I'm missing some vital detail, but actual snack consumption seems to be only 40% of the expected value. A 50 day stay (1 snack per meal and day, no active recyclers) in a Mk.I Lander Can still leaves me with 30 snacks and an estimation of 30 more days before supplies run out.

Do you have random snacking turned on?

Link to comment
Share on other sites

As I said, I was playing with 1 snack per meal, day and Kerbal and thus expected to last 50 days with 50 snacks in a one-seater. Switching to other values changed the consumption rates accordingly, but actual consumption still seems to be roughly half of what I and the estimation window calculate for a given setting.

I turned random snacking off when I noticed the deviation as I suspected this might be the cause of the trouble, but this doesn't seem to have had a noticeable effect.

Am I right to assume, that no-one else experiences the same problem and this is likely a local issue? So far I'm only using KAC, OPM and the necessary dependencies, but this might still be a case of mod incompability, I guess.

 

Link to comment
Share on other sites

@Angel-125, two questions:

  1. How hard is it to add the Ore->Snacks converter to other labs? I like using OPT parts and their lab is fairly convenient (though I could just put a normal lab in the cargo bay), so it would be nifty if that lab could also make snacks.
  2. For a real long term outpost on a planet/moon, could I set up a drill on a nuke (or big solar arrays and huge batteries) harvesting away at ore, then a ore->snacks converter constantly running, and Kerbals being fed? I'd have to check on the power plant fuel, but I'm pondering methods for long term outposts, and not having to worry about them run out of food while I'm time warping long missions elsewhere.
Link to comment
Share on other sites

1 hour ago, AmpCat said:

@Angel-125, two questions:

  1. How hard is it to add the Ore->Snacks converter to other labs? I like using OPT parts and their lab is fairly convenient (though I could just put a normal lab in the cargo bay), so it would be nifty if that lab could also make snacks.
  2. For a real long term outpost on a planet/moon, could I set up a drill on a nuke (or big solar arrays and huge batteries) harvesting away at ore, then a ore->snacks converter constantly running, and Kerbals being fed? I'd have to check on the power plant fuel, but I'm pondering methods for long term outposts, and not having to worry about them run out of food while I'm time warping long missions elsewhere.

Yes and yes. For the ore->snacks converter, there is a MM_stock.cfg file that adda the converter to the lab. All you need to do is copy the text for the converter and change the @PART section to use the name of the part that you want. 

Link to comment
Share on other sites

I'm new to the whole modding thing. Is there anything I need to worry about, or do to integrate with ModuleManager properly? I'm not even entirely sure what ModuleManager does.. aside from manage modules. I presume it takes care of part conflicts somehow?

Thanks @Angel-125, worked like a charm! Got a working snack processor in the OPT science module.

Edited by AmpCat
Link to comment
Share on other sites

1 minute ago, Skalou said:

thank you for this mod :)

however i see sometime the time displayed in months, but how many time is 1 month please? ( hours or kerbin days)

1 month is 6.43 days according to the official KSP Wiki. You can also change the time format to days; simply consult the Snacks entry in the in-game KSPedia.

Link to comment
Share on other sites

thank you, i didn't know about this definition!

for those wondering here is the KSpedia:

vj2ZFxa.png

What i would prefer  for Snacks however is a 3rd option :P:

display in (kerbin)years:days:hours (no month and display hours instead of 0,X day)

Link to comment
Share on other sites

3 hours ago, Angel-125 said:

Updated to Snacks 1.5.5

- Fixed some NREs.
- Fixed a situation where the ModuleManager patch wasn't adding snacks to crewed parts; Snacks can now dynamically add them when adding parts to vessels in the VAB/SPH.

adding or removing any part in VAB get's this, in Sandbox

Spoiler

Exception handling event onEditorPartPlaced in class SnackController:System.NullReferenceException: Object reference not set to an instance of an object
  at Snacks.SnackController.onEditorPartPlaced (.Part part) [0x00000] in <filename unknown>:0
  at EventData`1[Part].Fire (.Part data) [0x00000] in <filename unknown>:0

https://www.dropbox.com/s/nznw09uzxu8hfhy/KSP.rar?dl=0

Also while on the Selection menu, when choosing, any of the 3 options

Spoiler

[EXC 20:25:21.171] NotImplementedException: The requested feature is not implemented.
    Snacks.SnacksProperties.SetDifficultyPreset (Preset preset)
    GameParameters.GetDefaultParameters (Modes mode, Preset p)
    UnityEngine.Debug:LogException(Exception)
    GameParameters:GetDefaultParameters(Modes, Preset)
    MainMenu:UpdatedGameParameters(GameParameters)
    MainMenu:<CreateNewGameDialog>m__259(Boolean)
    DialogGUIToggle:<Create>m__6F6(Boolean)
    UnityEngine.EventSystems.EventSystem:Update()

https://www.dropbox.com/s/0zgnt5qt3segpqr/KSP1.rar?dl=0

Edited by dtoxic
Link to comment
Share on other sites

@Angel-125

I'm working on updating Dang It!, and a tester is having a problem with Snacks.

So, before I start digging, I saw that on SpaceDock, the version seems to be for 1.2 (unless you just forgot to update Spacedock), and the last version was released on 11/2

So, do you have a 1.2.1 version available?

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