Jump to content

[LE] How to isolate where a bug is coming from?


HouseHosted

Recommended Posts

Hello, all,

 

I'm trying to learn how to fix a bug in Skyrim. It's the one where spell absorption on Circle of Protection ceases to work if you're caught in the AOE of pretty much anything. Spriggans when they die, pacify, dragons landing, giant stomps and clubs when they bludgeon the ground. I've managed to figure out how to fix a couple bugs on my own. For instance, the daedric boots issue with the atronach forge, and chicken nest egg respawns. But I can't find any reference to what it could be from in the USLEEP changelog. The closest, I think is the line here:


Numerous magic effects were assigned to the wrong schools, or inappropriately assigned to one at all, resulting in a number of unexpected and outright wrong results. (Bug #439)

 

There is mention of what I'm seeking help with on elderscrolls.fandom.com @ https://elderscrolls.fandom.com/wiki/circle_of_protection_(skyrim). It is quoted as:

The magicka well effect gained from combining Circle of Protection with spell absorption will be lost when the player is caught in the radius of their own explosive spells. Such spells are not restricted to Destruction (e.g. Fireball, Fire Storm, etc.). Most Master-level spells of whatever school (e.g. Bane of the Undead, Mass Paralysis) as well as some lower-level spells such as Rally will destroy the effect. Spells such as Fireball and Rally can be cast without interrupting the magicka well effect so long as the caster is not caught in the spell's radius.

  • A confirmed solution is to receive explosive damage from an external source. One readily repeatable means of doing so is to summon a Storm Atronach, wait until it performs its explosive attack on the player, then destroy or banish it. The spell absorption from Circle of Protection will return indefinitely unless it is interrupted again by the player's own explosive effects. This solution can also be applied indefinitely.

 

What is described there are solutions, but learning how to properly fix it would be so fabulous! I went and used this very helpful step-by-step on how to enable papyrus script logging (https://www.nexusmods.com/skyrim/articles/368/), however, it seems that only logs certain parts of in-game happenings. At least, from I can make out, only what happens when the game loads, and not what happens during gameplay. I mean, I did notice this entry: warning:


Assigning None to a non-object variable named "::temp6"
stack:
[MGRitual04 (000CD987)].mgritual04questscript.OnUpdate() - "MGRitual04QuestScript.psc" Line 59
[02/18/2019 - 08:58:46PM] Error: Cannot call Is3DLoaded() on a None object, aborting function call
stack:
[MGRitual04 (000CD987)].mgritual04questscript.OnUpdate() - "MGRitual04QuestScript.psc" Line 59
[02/18/2019 - 08:58:46PM]

 

 

etc., etc., repeats itself about 200 times in a very short time though. Yeah, I'm sort of lost, honestly. And I did see that these unofficial patches add additional scripts to prevent effects from being applied to your person. I'm worried this is the only to stop this from happening, but if it is, it'd just be a matter of learning how to implement such a script. I'd appreciate any help the forums can offer me. Getting to the bottom of this bug would mean night and day to me, since my favourite character to play relies heavily on spell absorption.

Edited by HouseHosted
Link to comment
Share on other sites

You can manually output to the log with Debug.Trace() (https://www.creationkit.com/index.php?title=Trace_-_Debug), which will let you put specific notes in on, e.g., casting the spell, effects triggering, and so on.

 

That specific warning means that that line of the script is trying to perform an operation that requires an object reference, but wasn't properly assigned one. You'd need to open up the script and trace the logic to find the root cause.

Link to comment
Share on other sites

Thanks for the info, foamyesque. Unfortunately, I can't get the debug back to working as it was before. So, I'm not sure what to do about following this train of thought. I mean, all you have to do is change the 0s back to 1s, right? On the bright side, that script converted to pex no problem

 

ScriptName DebugTrace extends Debug

Function Trace(string asTextToPrint, int aiSeverity = 0) native

However, since I can't get the debug thingy workng again, I was trying to think of ways to work around the bug. So far I've thought up something like simply having the Atronach Stone effect reset/remove then re-added itself when hit. I had made it this far:

Scriptname AbsorbRefreshScript extends ActiveMagicEffect
{firstissue}

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked )

if Player.HasMagicEffect 000E5F50 ; (doomAtronachEffect)
debug.Notification("You got it.")
EndIf
endEvent

 

Essentially, I just wanted to get as far as getting the script "functioning." Like I knew I'd need to figure out the sytax for checking the character had the atronach effect to begin with, and then only replace it then. After all, it would be pretty silly to get the game to give you the atronach perk if you had something else, etc... It was about this time, from reading on a Fallout 4 thread, that you apparently need quest references and such to get notifications to pop up. I'm putting up a fight though! Just, as of today, I'm pretty wiped. Learning this stuff is bloody tough. How anyone can just pick up stuff like this with ease are superhuman, as far I'm concerned.

Link to comment
Share on other sites

Wait wait, did you *try to make your own debug script*?

 

It's literally part of the default game stuff, you can call it from any other script by going Debug.Trace(), same as you would, say, Game.GetPlayer() or what have you.

 

EDIT:

 

You even use a similar call, Debug.Notification(), correctly in your second code block! I'm confused about what you did now. Debug.Trace() works identically to Debug.Notification() from a coding point of view. The changes are that it is faster, dumps to the log instead of to screen, has an automatic timestamp (same as everything else in the log), and will not cull redundant identical strings.

Edited by foamyesque
Link to comment
Share on other sites

Thanks for the info, foamyesque. Unfortunately, I can't get the debug back to working as it was before. So, I'm not sure what to do about following this train of thought. I mean, all you have to do is change the 0s back to 1s, right? On the bright side, that script converted to pex no problem

 

ScriptName DebugTrace extends Debug

 

Function Trace(string asTextToPrint, int aiSeverity = 0) native

However, since I can't get the debug thingy workng again, I was trying to think of ways to work around the bug. So far I've thought up something like simply having the Atronach Stone effect reset/remove then re-added itself when hit. I had made it this far:

Scriptname AbsorbRefreshScript extends ActiveMagicEffect

{firstissue}

 

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked )

 

if Player.HasMagicEffect 000E5F50 ; (doomAtronachEffect)

debug.Notification("You got it.")

EndIf

endEvent

 

Essentially, I just wanted to get as far as getting the script "functioning." Like I knew I'd need to figure out the sytax for checking the character had the atronach effect to begin with, and then only replace it then. After all, it would be pretty silly to get the game to give you the atronach perk if you had something else, etc... It was about this time, from reading on a Fallout 4 thread, that you apparently need quest references and such to get notifications to pop up. I'm putting up a fight though! Just, as of today, I'm pretty wiped. Learning this stuff is bloody tough. How anyone can just pick up stuff like this with ease are superhuman, as far I'm concerned.

Debug.trace/notification can be called from within any script object. Quest scripts are just a "go to" because they require little in the way of setting up, when testing certain things.

Link to comment
Share on other sites

Keep in mind there is a difference between a syntax error and a logic error. Most debuggers will only show syntax errors.

You seem to be talking about a logic error in that they were put in the wrong places. Much harder to weed out.

 

Using a Debug.Notification(" Pass ...") style of debugging works best for that. Also actually printing out the scripts

and highlighting the functions you are looking at can really help.

 

Also try not to say the same thing twice to Debug.Notification it will not show the 2nd one if pops in to fast after the 1st one.

But something like this would show every time ...

 

Debug.Notification("test")

Debug.Notification("1")

Edited by NexusComa
Link to comment
Share on other sites

Wait wait, did you *try to make your own debug script*?

 

It's literally part of the default game stuff, you can call it from any other script by going Debug.Trace(), same as you would, say, Game.GetPlayer() or what have you.

 

EDIT:

 

You even use a similar call, Debug.Notification(), correctly in your second code block! I'm confused about what you did now. Debug.Trace() works identically to Debug.Notification() from a coding point of view. The changes are that it is faster, dumps to the log instead of to screen, has an automatic timestamp (same as everything else in the log), and will not cull redundant identical strings.

 

Thanks for clarifying. I didn't realize I wouldn't have to make a script for that. The article said to write this:

Trace(string asTextToPrint, int aiSeverity = 0) native global

 

Using what I've learned so far about extending scripts, I figured you just had to extend that from the debug.psc. I was kind of confused why they'd say to write "global" when saying so would cause the compiling function to fail (being already present in the debug.psc).

 

 

Debug.trace/notification can be called from within any script object. Quest scripts are just a "go to" because they require little in the way of setting up, when testing certain things.

Okay. Thanks.

 

Keep in mind there is a difference between a syntax error and a logic error. Most debuggers will only show syntax errors.

You seem to be talking about a logic error in that they were put in the wrong places. Much harder to weed out.

 

Using a Debug.Notification(" Pass ...") style of debugging works best for that. Also actually printing out the scripts

and highlighting the functions you are looking at can really help.

 

Also try not to say the same thing twice to Debug.Notification it will not show the 2nd one if pops in to fast after the 1st one.

But something like this would show every time ...

 

Debug.Notification("test")

Debug.Notification("1")

I see. Thanks for the info. I'm sure I'll be able to make use of that during the production of this small project. ^^

 

-----------

 

I don't have much to contribute to this thread for now. I'm taking another shot at learning more syntax stuff now. I have a real hard time following what is written in the CK wiki, so I've been looking at videos by this darkfox127 fellow. Needless to say, I'm just barely comprehending what he's talking about, but seeing the scripts written in real-time helps a lot.

 

The two items of highest priority to learn appear to be "Property" and "Function". One step at a time, as they say.

 

Hope you all have a good one!

Link to comment
Share on other sites

Well, I reached my cap for learning today. And despite being very tiring, it is really exciting to see the potential for future ideas as more knowledge is assimilated. For today, I did have a couple thoughts that, I thnk, might prove to be a good foundation for this thing; once I have more syntax and reference knowledge. Basically, if I was to look at how diseases are contracted, and alter it just so that there's a check for the ability itself (with a bit of a timer), this bad boy could potentially be working like a charm. I haven't been able to locate the source for how that's treated in Skyrim yet. I'm not quite a master of navigating the CK yet, so there are various dead ends here and there. Anyways, I'll share with you all my progress. Most of it is copy-pasted from various sources, including other Skyrim pscs; MagicDispellSpellOnHitScript being the top contributor.


Scriptname firstissue extends ActiveMagicEffect
{2ndissue}

;======================================================================================;
; PROPERTIES /
;=============/

spell Property ncced

;======================================================================================;
; VARIABLES /
;=============/

Actor Target
bool bWaitLongEnough
Float PosY
Float PosZ
Float RotY
Float RotZ
Float RotX
Float PosX

;======================================================================================;
; FUNCTIONS /
;=============/

function GetPos()

PosX = Target.GetPositionX()
PosY = Target.GetPositionY()
PosZ = Target.GetPositionZ()
RotX = Target.GetAngleX()
RotY = Target.GetAngleY()
RotZ = Target.GetAngleZ()
endFunction

function OnEffectFinish(Actor akTarget, Actor akCaster)function OnEffectStart(Actor akTarget, Actor akCaster)

Target = akTarget
endFunction

;======================================================================================;
; EVENTS /
;=============/
Event OnEffectStart(Actor akTarget, Actor akCaster)
Target = Target
utility.wait(8.0)
bWaitLongEnough = true
EndEvent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked )

if bWaitLongEnough
bWaitLongEnough = False
if ncced
TargetActor.removespell(ncced)
endif
if (Game.GetPlayer().RemoveSpell(nccedProperty))
Debug.Trace("2nd issue")
endIf

endEvent

; if Player.HasMagicEffect 000E5F50 ; (doomAtronachAbility)
; debug.Notification("You got it.")
; EndIf

 

I'll admit, the way those Skyrim guys prettied up their scripts with hyphens and forward slashes adds a nice presence to them. You feel like you're flipping through manila file folders as you scroll down through the sections.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...