Checking applied MGEF?

Post » Mon May 16, 2011 11:24 pm

I'm working on alpha testing a needs mod that I've written, and am running into a problem that I'm unsure of how to best isolate.

From a structure standpoint, the mod works similarly to SimpleNeeds --- that is a main quest script kicks off using comparing the last run time to gamedayspassed, and decrements levels/reserves accordingly. Meanwhile, ingestibles are set to kick off an MGEF that kicks off a script to increase the appropriate reserves.


The problem that I'm having right now, is that at times I'll notice that a couple of my counters are going up, not down. I recently managed to grab a save game right as some problem behavior is happening, that has shed some new light on it: first only some counters are going up, while others remain constant, and second they climb at very rapid increments (while the logic of the main quest script only kicks off once every 0.05 days)

It is acting as if a couple of the MGEF's are being fired off several times, when they shouldn't be. I've check all of my ingestibles to make sure I didn't accidentally have one calling MGEF's with a non-zero duration, but that does not appear to be the case. Nothing shows on the status of pip-boy suggesting that something is going on... yet I can watch a couple of my counters increase every second or so for a little while (despite not having "eaten" anything recently).

So my question: Is there a console command that I can use to see what MGEF's are currently being applied to the PC - or something along those lines - to help me figure out what the bloody heck is going on?
User avatar
Bitter End
 
Posts: 3418
Joined: Fri Sep 08, 2006 11:40 am

Post » Tue May 17, 2011 1:36 am

Can't think of any off-hand, but maybe post a pic of you ingestible, base effect and script that's not working properly.
User avatar
Justin Hankins
 
Posts: 3348
Joined: Fri Oct 26, 2007 12:36 pm

Post » Tue May 17, 2011 10:16 am

It seems the plot thickens:

Loading and watching different save games, I now have a situation where I can load a save game where I'm just inside the opening of a metro tunnel. Outside, some Talon are waiting for me (they have already been spawned - this save is after ducking back inside to avoid them for a moment).

- If I stay inside, everything seems normal (every 0.05 days all of my levels drops by the correct amount)

- If I go outside, a couple of my levels start to increase roughly every other second. It doesn't matter if I engage the Talon in combat, or pop a stealthboy and just sit there.


Any help in getting more information on just WTF is going on, would be greatly appreciated.
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Post » Tue May 17, 2011 4:04 am

Will post some scripts and such in a moment, but some additional "strange" fuel for the fire.

The indoor save game I mentioned is inside the flooded metro entrance south of G'ma Sparkle - the one that leads to Arlington. Again, the Talon encounter outside is already triggered, just avoided for the moment.

- If I load the game and stay in the tunnel, my mod continues to work correctly (values dropping).

- If I load the game, turn around and go back outside to the Talon fight, something goes wrong (some values increase at rapid intervals).

- If I load the game, go through the tunnels to the Arlington side and go up top, my mod continues working correctly.

- If I load the game, go through the tunnels to the Arlington side and go up top (noting that values are dropping as they should), then go back into the metro (values still dropping), then come out on the other/original side where the Talon are waiting for me... the same problem behavior pops up.


This tells me that something is going on that is loaded by / saved with that cell in particular -- I just have no idea at all what it could be.

(Note: The overarching problem is not with that cell in particular, as this same basic problem has happened other times in other places - this is just the one time I've been putting as much nitty gritty time into trying to troubleshoot the behavior)
User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am

Post » Tue May 17, 2011 3:18 am

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.
User avatar
Sian Ennis
 
Posts: 3362
Joined: Wed Nov 08, 2006 11:46 am

Post » Tue May 17, 2011 3:17 am

The UFP http://www.fallout3nexus.com/downloads/file.php?id=3808 has a gamedaypassed fix incorporated - apparently there is a problem under certain conditions. You might want to check it out to see what was done to fix it.

From the readme:
Fixed GameDaysPassed calculating incorrectly, the more time you played the game the the bigger the gap would be when the day changed in the sleep\wait screen (day would change at say 7am after playing for 20 hours) (New Quest: UF3PGameDaysPassedFix, New Script: UF3PGameDaysPassedFixScript

User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am

Post » Tue May 17, 2011 7:40 am

RickerHK: Hunh, that is interesting. I wonder if that is something that has been fixed in more recent versions of Fallout -- as before my mod here, I'd been using SimpleNeeds for a long time (which uses the same logic with gamedayspassed for calculation), and never noticed any substantial problems (then again, if the problem is numerically not very large, I might just have not noticed it).

However, I'm pretty convinced that that isn't an issue with the problem I'm having here. Gamedayspassed gets brought into the "lower all values" part of the equation, where the problem I'm having is with some unexpected "increase in some values" going on.

Further, when some values are increasing on their own, they never increase beyond 300 --- that threshold is really only set/applied in my MGEF scripts... making me more convinced that what is going on here is that for some reason there is something unexpected triggering the MGEF or related script.
User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Post » Tue May 17, 2011 11:45 am


Further, when some values are increasing on their own, they never increase beyond 300 --- that threshold is really only set/applied in my MGEF scripts... making me more convinced that what is going on here is that for some reason there is something unexpected triggering the MGEF or related script.


That is strange.

Getting back to your original question - I've used this command at the console for Spells and it works. An example with buffout:

player.IsSpellTarget 15163

Sample console output:

player.IsSpellTarget 15163Is Spell Target >> 0.00player.cios 15163                        <--then switch to gamemode for a second, back to consoleplayer.IsSpellTarget 15163Is Spell Target >> 1.00

User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Post » Tue May 17, 2011 2:31 am

That is strange.

Getting back to your original question - I've used this command at the console for Spells and it works. An example with buffout:

player.IsSpellTarget 15163

Sample console output:


Hmm... trying to figure out how I can use that to try and figure something out here... since at this point with all available information I've gathered so far, I'm pretty confidant that I know that some of my MGEF's are being trigger repeatedly... I just first don't know by what or why, second don't know which ones specifically (there are many for different values of protien/carbs/etc). Since the MGEF's are marked to not have duration, it seems that there should be something else triggering them repeatedly -- but to use a method to check by ID of the ingestible... I'd have to go through every food item in the game. o_O

Though I confess, I'm honestly not sure of any other / better direction to go right now... I'm just truly baffled.
User avatar
Monika
 
Posts: 3469
Joined: Wed Jan 10, 2007 7:50 pm


Return to Fallout 3