Fixing the "Brawl bug" with Cloak method of attachin

Post » Wed Aug 22, 2012 4:19 am

So, anyone who has tried using the "Cloak method" for dynamically attaching scripts has eventually run into the "Brawl bug". Basically the brawling scripts count any MGEF on the opponent as a "cheat" and sets the quest stage to 150, which causes the fight to turn ugly. I consider this a bug.

I sort of almost found a fix, but I'd like to see if anyone who understands Papyrus better than me can figure out the source of the errors I am getting after applying the fix. In DGIntimidateAliasScript (and also CompanionsSingleCombatantScript, though I'm not certain when this gets used) I modify the OnMagicEffectApply blocks like so:

Spoiler
Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)    ; if player hits with any magic effect    ; don't do this if it's a Companion's radiant quest    ;Bool bIsFootprintsLoaded = Game.GetFormFromFile(0x00001DFB, "Footprints.esp")    Actor pActor = GetActorRef()    ;Keyword[] MGEFarray = new Keyword[21]    ;MGEFarray[0] = GetFormFromFile(0x0001CEAD, "Skyrim.esm") as Keyword ; Fire Damage (902)    ;MGEFarray[1] = GetFormFromFile(0x0001CEAE, "Skyrim.esm") as Keyword ; Frost Damage (40)    ;MGEFarray[2] = GetFormFromFile(0x0001CEAF, "Skyrim.esm") as Keyword ; Shock Damage (826)    ;MGEFarray[3] = GetFormFromFile(0x0001EA70, "Skyrim.esm") as Keyword ; Paralysis (17)    ;MGEFarray[4] = GetFormFromFile(0x000424E0, "Skyrim.esm") as Keyword ; Fear (12)    ;MGEFarray[5] = GetFormFromFile(0x000424EE, "Skyrim.esm") as Keyword ; Charm (9)    ;MGEFarray[6] = GetFormFromFile(0x00042509, "Skyrim.esm") as Keyword ; Harmful Alch (23)    ;MGEFarray[7] = GetFormFromFile(0x00046B99, "Skyrim.esm") as Keyword ; Shout (55)    ;MGEFarray[8] = GetFormFromFile(0x00078098, "Skyrim.esm") as Keyword ; Influence (53)    ;MGEFarray[9] = GetFormFromFile(0x0007F404, "Skyrim.esm") as Keyword ; Telekinesis (3)    ;MGEFarray[10] = GetFormFromFile(0x0009F28E, "Skyrim.esm") as Keyword ; Trap Gas (10)    ;MGEFarray[11] = GetFormFromFile(0x000B62E4, "Skyrim.esm") as Keyword ; Cloak (Harmful) (7)    ;MGEFarray[12] = GetFormFromFile(0x000B729E, "Skyrim.esm") as Keyword ; Slow (7)    ;MGEFarray[13] = GetFormFromFile(0x000C44B6, "Skyrim.esm") as Keyword ; Frenzy (5)    ;MGEFarray[14] = GetFormFromFile(0x000FBFEE, "Skyrim.esm") as Keyword ; DB Heavy Fire (37)     ;MGEFarray[15] = GetFormFromFile(0x000FBFEF, "Skyrim.esm") as Keyword ; DB Light Fire (1)    ;MGEFarray[16] = GetFormFromFile(0x00101BDE, "Skyrim.esm") as Keyword ; Drain (1)    ;MGEFarray[17] = GetFormFromFile(0x001093BB, "Skyrim.esm") as Keyword ; Trap Poison (1)    ;MGEFarray[18] = GetFormFromFile(0x00109D79, "Skyrim.esm") as Keyword ; Rune (4)    ;MGEFarray[19] = GetFormFromFile(0x0010E4B3, "Skyrim.esm") as Keyword ; CG Heavy Fire (18)    ;MGEFarray[20] = GetFormFromFile(0x0010E4B4, "Skyrim.esm") as Keyword ; CG Light Fire (1)    ;Int MGEFindex = MGEFarray.Length    ;While MGEFindex > 0    ;    MGEFindex -= 1    ;    If (pActor.HasMagicEffectWithKeyword(MGEFarray[MGEFindex]))    ;        bIsNegativelyAffected = True    ;        MGEFindex = 0    ;    EndIf    ;EndWhile    If (pActor != None) ; Why oh Why do I need to do this?        If (pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0001CEAD, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0001CEAE, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0001CEAF, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0001EA70, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x000424E0, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x000424EE, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x00042509, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x00046B99, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x00078098, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0007F404, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0009F28E, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x000B62E4, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x000B729E, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x000C44B6, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x000FBFEE, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x000FBFEF, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x00101BDE, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x001093BB, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x00109D79, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0010E4B3, "Skyrim.esm") as Keyword) || \            pActor.HasMagicEffectWithKeyword(GetFormFromFile(0x0010E4B4, "Skyrim.esm") as Keyword))            bIsNegativelyAffectedByMagic = True        EndIf    EndIf        if (akCaster == GetPlayer()) &&  ((GetOwningQuest() as DGIntimidateQuestScript).CR04Running == 0) && (bIsNegativelyAffectedByMagic)        ; && (!bIsFootprintsLoaded);                 debug.trace(self + " hit with magic - end Intimidate")                bIsNegativelyAffectedByMagic = False                GetOwningQuest().SetStage(150)                endif     endEvent

The attempt at this generic fix basically reads as "Look for certain magic effect keywords on the opponent, and only if these exist is the player cheating" ... I included 20 or so keywords that include almost all MGEFs that are deemed damaging, hostile, etc. ... My previous attempt (commented out above) used an array instead, but the errors I got were even more obscure.

So, this code works brilliantly, up until you decide to cheat. Once you flame Uthgerd to death, for example, I get either a huge amount of errors or just one or two.

Here are the errors:
Spoiler
[08/21/2012 - 01:25:03PM] error: DGIntimidateQuest (00047AE6): attempting to start event scoped quest outside of story manager.stack:[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetCurrentStageID() - "" Line ?[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetStage() - "Quest.psc" Line 124[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 32[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 80[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp18"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 80[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 81[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 81[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 82[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 82[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 83[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 83[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 84[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 84[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 85[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 85[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 86[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 86[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 87[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 87[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 88[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 88[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 89[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 89[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 90[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 90[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 91[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 91[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 92[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 92[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 93[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 93[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 94[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 94[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 95[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 95[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 96[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 96[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 97[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 97[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 98[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 98[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 99[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 99[08/21/2012 - 01:25:03PM] error: Cannot call HasMagicEffectWithKeyword() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 100[08/21/2012 - 01:25:03PM] warning: Assigning None to a non-object variable named "::temp19"stack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 100[08/21/2012 - 01:25:03PM] error: Cannot call RemoveFromFaction() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 28[08/21/2012 - 01:25:03PM] error: Cannot call StopCombat() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 29[08/21/2012 - 01:25:03PM] error: Cannot call SendAssaultAlarm() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 30[08/21/2012 - 01:25:03PM] error: Cannot call StartCombat() on a None object, aborting function callstack:[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 31[08/21/2012 - 01:25:03PM] error: DGIntimidateQuest (00047AE6): attempting to start event scoped quest outside of story manager.stack:[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetCurrentStageID() - "" Line ?[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetStage() - "Quest.psc" Line 124[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 32[08/21/2012 - 01:25:03PM] error: DGIntimidateQuest (00047AE6): attempting to start event scoped quest outside of story manager.stack:[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetCurrentStageID() - "" Line ?[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetStage() - "Quest.psc" Line 124[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 32[08/21/2012 - 01:25:03PM] error: DGIntimidateQuest (00047AE6): attempting to start event scoped quest outside of story manager.stack:[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetCurrentStageID() - "" Line ?[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetStage() - "Quest.psc" Line 124[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnHit() - "DGIntimidateAliasScript.psc" Line 32[08/21/2012 - 01:25:03PM] error: DGIntimidateQuest (00047AE6): attempting to start event scoped quest outside of story manager.stack:[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetCurrentStageID() - "" Line ?[DGIntimidateQuest (00047AE6)].dgintimidatequestscript.SetStage() - "Quest.psc" Line 124[alias opponent on quest DGIntimidateQuest (00047AE6)].DGIntimidateAliasScript.OnMagicEffectApply() - "DGIntimidateAliasScript.psc" Line 110

I always get the top errors about "attempting to start event scoped quest outside of story manager". The rest of the errors happen only intermittently. When I was using an array I got a similar error, and it has something to do with HasMagicEffectKeyword() and GetFormFromFile() but aside from that I'm lost.
User avatar
Claire Vaux
 
Posts: 3485
Joined: Sun Aug 06, 2006 6:56 am

Post » Wed Aug 22, 2012 7:11 am

Why not call it cheating if the MGEF does NOT have a keyword, like "notacheat!" or something?

It would require authors to use that keyword to avoid the bug, but that's not really a big deal, and it makes your code a lot tidier.

Sorry I don't have anything on your errors :(

[EDIT] though, is it really necessary to call "getformfromfile" on all those keywords? Why not use properties?

[EDIT again] if you do want to define all the cheat keywords instead of just one "notcheat" keyword, what I'd do is use a formlist with all of the keywords in it and then call HasForm on all the MGEF's keywords. Is GetNthKeyword vanilla or does it require SKSE?
User avatar
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Wed Aug 22, 2012 4:24 am

Why not call it cheating if the MGEF does NOT have a keyword, like "notacheat!" or something?

It would require authors to use that keyword to avoid the bug, but that's not really a big deal, and it makes your code a lot tidier.
Basically the shortest way I can say it is that if you're cloaking everyone with "NotACheat", if you test just for that, and not the inverse, the player will never be seen as cheating even if they are. You have to actually test for the negative effect keywords, and assume everything else is not a cheat. So this includes the cloak scripting method, and also any beneficial buffs the opponent may have. So if you, say, Paralyze them, but you have a "notacheat" cloak active, and test just for that keyword it would come back as a false negative.

Edit: Also, the errors I'm getting don't actually seem to have any ill effect. You get the bounty added for cheating, and you can submit to the opponent, and if guards come along you can submit to them and pay off the bounty. The vanilla scripts are rife with errors anyway....
User avatar
Zach Hunter
 
Posts: 3444
Joined: Wed Aug 08, 2007 3:26 pm

Post » Tue Aug 21, 2012 11:44 pm

Then see my edit about using a FormList :D
User avatar
David Chambers
 
Posts: 3333
Joined: Fri May 18, 2007 4:30 am

Post » Wed Aug 22, 2012 4:53 am

Then see my edit about using a FormList :biggrin:
I don't want to edit the script properties. I don't want to edit any vanilla forms. I don't want to require a plugin for the fix. My fix is all self-contained and, on paper, works. I just can't explain why it's erroring.

I should try something else other than the Flames spell when I test what happens when cheating. I think maybe those kinds of spells count as an OnHit and an OnMagicEffectApply.
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Wed Aug 22, 2012 3:47 am

I don't want to edit the script properties. I don't want to edit any vanilla forms. I don't want to require a plugin for the fix.

Well... why not? :P

If that's how you want to play it though, then that's how you want to play it.

All your errors look like they have to with assigning "None" to the opponent alias. I've seen errors like that in other mods' scripts but don't really have any clue why it's happening :(
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Wed Aug 22, 2012 6:25 am

Well... why not? :tongue:

If that's how you want to play it though, then that's how you want to play it.

All your errors look like they have to with assigning "None" to the opponent alias. I've seen errors like that in other mods' scripts but don't really have any clue why it's happening :(
Well, it's a simple matter of keeping the fix just to a PSC and a PEX file, that will fix ANY mod that uses the cloak method versus having to not only include scripts, but also a plugin, and require the mod authors to update their mods to account for this. Although, anyone who uses a cloak in this way is going to need to update it. I had to check a few of the "No" options on my cloak effect to prevent the instant bounty and the opponent from pulling out their sword.


Edit:

Wow, am I not with it. Posted this in the wrong forum. :smile:


Thanks, mystery moderator.

Edit 2:

OK, so I believe I've fixed it. It was essentially running more than once, and I'm pretty sure that it may also do this in the vanilla script, but I never noticed. Basically both OnMagicEffectApply() and OnHit() are called when you use something like Flames on your opponent. They both try to set the quest stage to 150. However, if you use a cloak (I tested a Flame Cloak on Uthgerd, and didn't get any errors), only OnMagicEffectApply() is called, and the error never happens. So I'm pretty sure these errors occur in a vanilla game, because it only happens with certain magic types and had nothing to do with my code.
User avatar
sunny lovett
 
Posts: 3388
Joined: Thu Dec 07, 2006 4:59 am


Return to V - Skyrim