Here are some tidbits from my mod...
This is the main script itself that runs the "consumption" (values going down) on a regular basis. (Note that some sections are commented out either as old code there for reference, or are temporarily being disabled for troubleshooting purposes)
scn DUNSSNMainScriptshort DoOnceshort SuspendConsumptionshort SleptOrWaitedshort SleptRecentlyfloat SleepStartfloat SleepBenefitfloat LastConsumptionRunshort ProtienLevelfloat ProtienRateshort CarbsLevelfloat CarbsRateshort NutrientLevelfloat NutrientRateshort HydrationLevelfloat HydrationRateshort RestLevelfloat RestRateshort CannibalTotal;=-=-=-=-=-=-=-=-=-= CHECK FOR PC SLEEPING =-=-=-=-=-=-=-=-=-=Begin MenuMode 1012If (SleptOrWaited == 0) Set SleepStart to GameDaysPassed Set SleptOrWaited to 1EndIfIf (IsPCSleeping == 1) Set SleptRecently to 1EndIfEnd;If (IsPCSleeping == 1) && (SleptRecently == 0); Set SleptRecently to 1; Set SleepStart to GameDaysPassed;ElseIf (SleptRecently == 0); Set ProcessedSleepRecently to 1;EndIf;EndBegin GameMode;=-=-=-=-=-=-=-=-=-= INITIAL SETUP =-=-=-=-=-=-=-=-=-=If (DoOnce != 1) Set DoOnce to 1 Set LastConsumptionRun to GameDaysPassed Set ProtienLevel to 100 Set CarbsLevel to 100 Set NutrientLevel to 100 Set HydrationLevel to 100 Set RestLevel to 100 Set CannibalTotal to GetPCMiscStat "Corpses Eaten"EndIfIf (SuspendConsumption == 0) ;=-=-=-=-=-=-=-=-=-= PROCESS CANNIBALISM =-=-=-=-=-=-=-=-=-= ;If (GetPCMiscStat "Corpses Eaten") > CannibalTotal ; If ProtienLevel >= 150 ; Set ProtienLevel to 300 ; Else ; Set ProtienLevel to (ProtienLevel + 150) ; EndIf ; If NutrientLevel >= 225 ; Set NutrientLevel to 300 ; Else ; Set NutrientLevel to (NutrientLevel + 75) ; EndIf ; Set CannibalTotal to (GetPCMiscStat "Corpses Eaten") ;EndIf ;=-=-=-=-=-=-=-=-=-= PROCESS SLEEP =-=-=-=-=-=-=-=-=-= If (SleptRecently) Set SleepBenefit to (340 * (GameDaysPassed - SleepStart)) If ((RestLevel + SleepBenefit) >= 300) Set RestLevel to 300 Else Set RestLevel to (RestLevel + SleepBenefit) EndIf Set SleptRecently to 0 EndIf ;=-=-=-=-=-=-=-=-=-= START MAIN CONSUMPTION =-=-=-=-=-=-=-=-=-= If ((GameDaysPassed - LastConsumptionRun) >= 0.05) ;=-=-=-=-=-=-=-=-=-= CALCULATE CONSUMPTION WHILE ASLEEP =-=-=-=-=-=-=-=-=-= If (SleptOrWaited) Set ProtienLevel to (ProtienLevel - (90 * (GameDaysPassed - LastConsumptionRun))) Set CarbsLevel to (CarbsLevel - (90 * (GameDaysPassed - LastConsumptionRun))) Set NutrientLevel to (NutrientLevel - (90 * (GameDaysPassed - LastConsumptionRun))) Set HydrationLevel to (HydrationLevel - (90 * (GameDaysPassed - LastConsumptionRun))) If (SleptRecently) Set SleptRecently to 0 Else Set RestLevel to (RestLevel - (90 * (GameDaysPassed - LastConsumptionRun))) EndIf Set SleptOrWaited to 0 Else ;=-=-=-=-=-=-=-=-=-= CALCULATE CONSUMPTION RATES =-=-=-=-=-=-=-=-=-= Set ProtienRate to 1 Set CarbsRate to 1 Set NutrientRate to 1 Set HydrationRate to 1 Set RestRate to 1 If (ProtienLevel < 0) Set CarbsRate to (CarbsRate + 0.66) Set NutrientRate to (NutrientRate + 0.66) Set RestRate to (RestRate + 0.15) EndIf If (CarbsLevel < 0) Set ProtienRate to (ProtienRate + 0.66) Set NutrientRate to (NutrientRate + 0.66) Set RestRate to (RestRate + 0.2) EndIf If (NutrientLevel < 0) Set ProtienRate to (ProtienRate + 0.66) Set CarbsRate to (CarbsRate + 0.66) Set HydrationRate to (HydrationRate + 0.50) Set RestRate to (RestRate + 0.15) EndIf If (HydrationLevel < 0) Set RestRate to (RestRate + 0.5) EndIf If (RestLevel < 0) Set ProtienRate to (ProtienRate + 0.1) Set CarbsRate to (CarbsRate + 0.1) Set NutrientRate to (NutrientRate + 0.1) Set HydrationRate to (HydrationRate + 0.1) EndIf ;If (Player.IsSpellTarget Buffout) ; Set ProtienRate to (ProtienRate + 0.2) ; Set CarbsRate to (CarbsRate + 0.2) ; Set NutrientRate to (NutrientRate + 0.2) ; Set HydrationRate to (HydrationRate + 0.4) ;EndIf ;If (Player.IsSpellTarget Morphine) ; Set ProtienRate to (ProtienRate + 0.2) ; Set NutrientRate to (NutrientRate + 0.3) ; Set HydrationRate to (HydrationRate + 0.3) ; Set RestRate to (RestRate + 0.4) ;EndIf ;If (Player.IsSpellTarget Jet) ; Set CarbsRate to (CarbsRate + 0.3) ; Set RestRate to (RestRate + 1.4) ;EndIf ;If (Player.IsSpellTarget MS09UltraJet) ; Set CarbsRate to (CarbsRate + 0.5) ; Set RestRate to (RestRate + 2.8) ;EndIf ;If (Player.IsSpellTarget Psycho) ; Set ProtienRate to (ProtienRate + 0.3) ; Set NutrientRate to (NutrientRate + 0.3) ; Set RestRate to (RestRate + 0.8) ;EndIf ;If (Player.IsSpellTarget Mentats) || (Player.IsSpellTarget MS15Mentat01) || (Player.IsSpellTarget MS15Mentat02) || (Player.IsSpellTarget MS15Mentat03) ; Set NutrientRate to (NutrientRate + 0.2) ; Set RestRate to (RestRate + 0.4) ;EndIf ;If (Player.IsSpellTarget NukaCola) || (Player.IsSpellTarget MS05NukaColaQtm) ; Set HydrationRate to (HydrationRate + 1) ; Set RestRate to (RestRate + 1) ;EndIf ;If (Player.HasPerk FastMetabolism) ; Set ProtienRate to (ProtienRate * 1.1) ; Set CarbsRate to (CarbsRate * 1.1) ; Set RestRate to (RestRate * 0.8) ;EndIf ;If (Player.HasPerk SolarPowered) && (Player.IsInInterior == 0) && (GameHour > 6) && (Gamehour < 18) ; Set ProtienRate to (ProtienRate * 0.75) ; Set CarbsRate to (CarbsRate * 0.75) ; Set NutrientRate to (NutrientRate * 0.75) ; Set HydrationRate to (HydrationRate * 0.75) ; Set RestRate to (RestRate * 0.5) ;EndIf ;=-=-=-=-=-=-=-=-=-= BEGIN ACTUAL CONSUMPTION =-=-=-=-=-=-=-=-=-= If (ProtienLevel >= 200) Set ProtienLevel to (ProtienLevel - (400 * ProtienRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (ProtienLevel >= 100) Set ProtienLevel to (ProtienLevel - (200 * ProtienRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (ProtienLevel >= -200) Set ProtienLevel to (ProtienLevel - (100 * ProtienRate * (GameDaysPassed - LastConsumptionRun))) Else Set ProtienLevel to -200 EndIf If (CarbsLevel >= 200) Set CarbsLevel to (CarbsLevel - (300 * CarbsRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (CarbsLevel >= 100) Set CarbsLevel to (CarbsLevel - (150 * CarbsRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (CarbsLevel >= -200) Set CarbsLevel to (CarbsLevel - (100 * CarbsRate * (GameDaysPassed - LastConsumptionRun))) Else Set CarbsLevel to -200 EndIf If (NutrientLevel >= 200) Set NutrientLevel to (NutrientLevel - (500 * NutrientRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (NutrientLevel >= 100) Set NutrientLevel to (NutrientLevel - (250 * NutrientRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (NutrientLevel >= -200) Set NutrientLevel to (NutrientLevel - (100 * NutrientRate * (GameDaysPassed - LastConsumptionRun))) Else Set NutrientLevel to -200 EndIf If (HydrationLevel >= 200) Set HydrationLevel to (HydrationLevel - (600 * HydrationRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (HydrationLevel >= 100) Set HydrationLevel to (HydrationLevel - (300 * HydrationRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (HydrationLevel >= -200) Set HydrationLevel to (HydrationLevel - (100 * HydrationRate * (GameDaysPassed - LastConsumptionRun))) Else Set HydrationLevel to -200 EndIf If (RestLevel >= 200) Set RestLevel to (RestLevel - (450 * RestRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (RestLevel >= 100) Set RestLevel to (RestLevel - (225 * RestRate * (GameDaysPassed - LastConsumptionRun))) ElseIf (RestLevel >= -200) Set RestLevel to (RestLevel - (100 * RestRate * (GameDaysPassed - LastConsumptionRun))) Else Set RestLevel to -200 EndIf EndIf Set LastConsumptionRun to GameDaysPassed EndIf ;=-=-=-=-=-=-=-=-=-= APPLY PENALTIES IF NEEDED =-=-=-=-=-=-=-=-=-= If (ProtienLevel < 0) || (CarbsLevel < 0) || (NutrientLevel < 0) || (HydrationLevel < 0) || (RestLevel < 0) If (ProtienLevel < 0) If (ProtienLevel >= -100) Player.CastImmediateOnSelf DUNSSNProtienDeficient Player.RemoveSpell DUNSSNProtienStarving Else Player.CastImmediateOnSelf DUNSSNProtienStarving Player.RemoveSpell DUNSSNProtienDeficient EndIf EndIf If (CarbsLevel < 0) If (CarbsLevel >= -100) Player.CastImmediateOnSelf DUNSSNCarbsDeficient Player.RemoveSpell DUNSSNCarbsStarving Else Player.CastImmediateOnSelf DUNSSNCarbsStarving Player.RemoveSpell DUNSSNCarbsDeficient EndIf EndIf If (NutrientLevel < 0) If (NutrientLevel >= -100) Player.CastImmediateOnSelf DUNSSNNutrientDeficient Player.RemoveSpell DUNSSNNutrientStarving Else Player.CastImmediateOnSelf DUNSSNNutrientStarving Player.RemoveSpell DUNSSNNutrientDeficient EndIf EndIf If (HydrationLevel < 0) If (HydrationLevel >= -100) Player.CastImmediateOnSelf DUNSSNHydrationDeficient Player.RemoveSpell DUNSSNHydrationStarving Else Player.CastImmediateOnSelf DUNSSNHydrationStarving Player.RemoveSpell DUNSSNHydrationDeficient EndIf EndIf If (RestLevel < 0) If (RestLevel >= -100) Player.CastImmediateOnSelf DUNSSNRestDeficient Player.RemoveSpell DUNSSNRestStarving Else Player.CastImmediateOnSelf DUNSSNRestStarving Player.RemoveSpell DUNSSNRestDeficient EndIf EndIf EndifEndIf;=-=-=-=-=-=-=-=-=-= CLEAR PENALTIES IF NEEDED =-=-=-=-=-=-=-=-=-=If (Player.IsSpellTarget DUNSSNProtienDeficient) || (Player.IsSpellTarget DUNSSNProtienStarving) || (Player.IsSpellTarget DUNSSNCarbsDeficient) || (Player.IsSpellTarget DUNSSNCarbsStarving) || (Player.IsSpellTarget DUNSSNNutrientDeficient) || (Player.IsSpellTarget DUNSSNNutrientStarving) || (Player.IsSpellTarget DUNSSNHydrationDeficient) || (Player.IsSpellTarget DUNSSNHydrationStarving) || (Player.IsSpellTarget DUNSSNRestDeficient) || (Player.IsSpellTarget DUNSSNRestStarving) If (ProtienLevel >= 0) && ((Player.IsSpellTarget DUNSSNProtienDeficient) || (Player.IsSpellTarget DUNSSNProtienStarving)) Player.RemoveSpell DUNSSNProtienDeficient Player.RemoveSpell DUNSSNProtienStarving EndIf If (CarbsLevel >= 0) && ((Player.IsSpellTarget DUNSSNCarbsDeficient) || (Player.IsSpellTarget DUNSSNCarbsStarving)) Player.RemoveSpell DUNSSNCarbsDeficient Player.RemoveSpell DUNSSNCarbsStarving EndIf If (NutrientLevel >= 0) && ((Player.IsSpellTarget DUNSSNNutrientDeficient) || (Player.IsSpellTarget DUNSSNNutrientStarving)) Player.RemoveSpell DUNSSNNutrientDeficient Player.RemoveSpell DUNSSNNutrientStarving EndIf If (HydrationLevel >= 0) && ((Player.IsSpellTarget DUNSSNHydrationDeficient) || (Player.IsSpellTarget DUNSSNHydrationStarving)) Player.RemoveSpell DUNSSNHydrationDeficient Player.RemoveSpell DUNSSNHydrationStarving EndIf If (RestLevel >= 0) && ((Player.IsSpellTarget DUNSSNRestDeficient) || (Player.IsSpellTarget DUNSSNRestStarving)) Player.RemoveSpell DUNSSNRestDeficient Player.RemoveSpell DUNSSNRestStarving EndIfEndIfEND
This is an example of one of the effect driven scripts that I use (there are many with different values - a whole lot of cut'n'pasting when setting this up at first)
scn DUNSSNProtien35Scriptbegin ScriptEffectStartIf (DUNSSNMain.ProtienLevel + 35) >= 300 Set DUNSSNMain.ProtienLevel to 300Else Set DUNSSNMain.ProtienLevel to (DUNSSNMain.ProtienLevel + 35)EndIfend
Looking at the Base Effect: Archetype set to script, assoc item is the correct script record, resist value none. Sounds are all set to none. Visual effects all set to none (other than projectile type ball and projectile speed 1 of course). Flags set are No Hit Effect, Self, No Duration, No Magnitude, No Area, Display Name Only, Painless.
Looking at the Fresh Apple ingestible: script is set to none, image/model/sounds not really relevant to the issue at hand. Addiction chance 0, addiction none, equip type food (and food item is checked at the bottom middle). Under results, three of my base effects are listed -- all with magnitude 0, area 0, duration 0, range self, and cost 0
NOTE: All of the above appears to be working properly most of the time. Eating food/water always adds the correct amount the the current levels, and levels decrease correctly over time. It just seems that sometimes something (other than eating/drinking) will happen that causes some of the MGEF related scripts to get fired off over and over again.