Jump to content

Who wants 773 dialogue fixes?


CamDawg

Recommended Posts

This coding will fix the 773 dialogue errors (w00t, two years off!) that Near Infinity reports in a patched, non-Baldurdashed SoA game. ToB is next. This also includes the handful of dialogue fixes that are included in SoA Baldurdash. Please not that this fixes dialogues to the point where they will compile, but it would not address, say, a wrong variable being set or a bad resref.

 

The lack of a newline character for WeiDU's regexp handling also means I could not eliminate all occurrences of empty DO actions. This means NI is still reporting some dlg files as corrupt, and running this will return a lot of parse warnings from WeiDU.

 

I suspect that the Baldurdash corrections to BAERIE are actually introducing a new bug--Dorner has a couple of SetGlobal("SleptAerie","GLOBAL"0) in places where the PC appears to be sleeping with Aerie. I'll let whomever is tackling the Aerie morning-after bug sort it out.

 

Be warned, the code is not for the faint of heart. :) First is a bit of dialogue that needs compiling; these are for the various fixes I couldn't do via tp2, below.

 

REPLACE MADAM
IF ~~ THEN BEGIN 4 // from: 12.2 7.1 3.1 0.2
 SAY #16588 /* ~Excellent.  This is Cominda, and she will accompany you to your room, my Lord.  You may speak with her further, there, as you wish.~ */
 IF ~True()~ THEN DO ~SetGlobal("Escort","AR0406",1)
CreateCreature("ESCORT1",[1483.513],0)~ EXIT
 IF ~InPartySlot(LastTalkedToBy,0)
IfValidForPartyDialogue("Viconia")
~ THEN DO ~SetGlobal("EscortBusy","AR0406",1)
SetGlobal("Escort","AR0406",1)
CreateCreature("ESCORT1",[1483.513],0)
~ EXTERN ~VICONIJ~ 30
 IF ~InPartySlot(LastTalkedToBy,0)
!IfValidForPartyDialogue("Viconia")
IfValidForPartyDialogue("Anomen")
~ THEN DO ~SetGlobal("EscortBusy","AR0406",1)
SetGlobal("Escort","AR0406",1)
CreateCreature("ESCORT1",[1483.513],0)
~ EXTERN ~ANOMENJ~ 167
END

IF ~~ THEN BEGIN 5 // from: 12.3 7.2 3.2 0.3
 SAY #16591 /* ~Excellent.  This is Kerstia, and she will accompany you to your room, my Lord.  You may speak with her further, there, as you wish.~ */
 IF ~True()~ THEN DO ~
SetGlobal("Escort","AR0406",2)
CreateCreature("ESCORT2",[1483.513],0)~ EXIT
 IF ~InPartySlot(LastTalkedToBy,0)
IfValidForPartyDialogue("Viconia")
~ THEN DO ~SetGlobal("EscortBusy","AR0406",1)
SetGlobal("Escort","AR0406",2)
CreateCreature("ESCORT2",[1483.513],0)
~ EXTERN ~VICONIJ~ 30
 IF ~InPartySlot(LastTalkedToBy,0)
!IfValidForPartyDialogue("Viconia")
IfValidForPartyDialogue("Anomen")
~ THEN DO ~SetGlobal("EscortBusy","AR0406",1)
SetGlobal("Escort","AR0406",2)
CreateCreature("ESCORT2",[1483.513],0)
~ EXTERN ~ANOMENJ~ 167
END

IF ~~ THEN BEGIN 6 // from: 12.4 7.3 3.3 0.4
 SAY #16592 /* ~Excellent.  This is Jenthan, and he will accompany you to your room, my Lady.  You may speak with him further, there, as you wish.~ */
 IF ~True()~ THEN DO ~SetGlobal("Escort","AR0406",3)
CreateCreature("ESCORT3",[1483.513],0)~ EXIT
 IF ~InPartySlot(LastTalkedToBy,0)
IfValidForPartyDialogue("Viconia")
~ THEN DO ~SetGlobal("EscortBusy","AR0406",1)
SetGlobal("Escort","AR0406",3)
CreateCreature("ESCORT3",[1483.513],0)
~ EXTERN ~VICONIJ~ 30
 IF ~InPartySlot(LastTalkedToBy,0)
!IfValidForPartyDialogue("Viconia")
IfValidForPartyDialogue("Anomen")
~ THEN DO ~SetGlobal("EscortBusy","AR0406",1)
SetGlobal("Escort","AR0406",3)
CreateCreature("ESCORT3",[1483.513],0)
~ EXTERN ~ANOMENJ~ 167
END
END

REPLACE PLAYER1
IF WEIGHT #8 ~Global("Slayer10","GLOBAL",1)
~ THEN BEGIN 27 // from:
 SAY #55324 /* ~In the depths of your being stirs a familiar evil, reaching out of the darkness. It offers power...for a price. Do you accept and sacrifice part of yourself?~ */
 IF ~False()
~ THEN REPLY #55325 /* ~I accept, despite the risks.~ */ DO ~IncrementGlobal("SlayerDeath","GLOBAL",1)
SetGlobal("Slayer10","GLOBAL",2)
SetGlobalTimer("TheSlayerTimer","GLOBAL",60)
ApplySpell(Player1,SLAYER_CHANGE_TWO)
ApplySpell(Player2,DRAIN_PARTY)
ApplySpell(Player3,DRAIN_PARTY)
ApplySpell(Player4,DRAIN_PARTY)
ApplySpell(Player5,DRAIN_PARTY)
ApplySpell(Player6,DRAIN_PARTY)
ForceSpell(Player1,SLAYER_FEAR)
~ EXIT
 IF ~~ THEN REPLY #55326 /* ~No, it will not have me. I will not give in.~ */ DO ~SetGlobal("Slayer10","GLOBAL",0)
~ EXIT
 IF ~True()~ THEN DO ~SetGlobal("Slayer10","GLOBAL",2)
SetGlobalTimer("TheSlayerTimer","GLOBAL",60)
ReputationInc(-2)
ApplySpell(Player1,SLAYER_CHANGE_TWO)~ EXIT
END
END

REPLACE_STATE_TRIGGER BAERIE 294
~Global("LoveTalk","LOCALS",32)
Global("AerieRomance","GLOBAL",1)
!StateCheck(Player1,STATE_SLEEPING)
OR(2)
Global("HaerDalisRomanceActive","GLOBAL",1)
Global("HaerDalisRomanceActive","GLOBAL",2)
InParty("HaerDalis")~
SET_WEIGHT BAERIE 294 #15

REPLACE_STATE_TRIGGER BAERIE 302
~Global("LoveTalk","LOCALS",34)
InParty("HaerDalis")
See("HaerDalis")
OR(2)
Global("HaerDalisRomanceActive","GLOBAL",2)
Global("HaerDalisRomanceActive","GLOBAL",1)
!StateCheck("HaerDalis",STATE_SLEEPING)
Global("AerieHaerDalis1","LOCALS",0)~
SET_WEIGHT BAERIE 302 #16

ADD_TRANS_ACTION BAERIE
BEGIN 360 END
BEGIN 0 END
~SetGlobal("SleptAerie","GLOBAL",0)~

REPLACE_ACTION_TEXT PHEIRK ~True()~ ~~
REPLACE_ACTION_TEXT PHEIRKAS ~True()~ ~~
REPLACE_TRIGGER_TEXT_REGEXP ~.*~ ~\bSetGlobal(~ ~Global(~
REPLACE_ACTION_TEXT_REGEXP  ~.*~ ~\bGlobal(~ ~SetGlobal(~

 

And the tp2 (not for the fait of heart):

 

COPY_EXISTING_REGEXP GLOB %.*\.dlg$% %override%
 DECOMPILE_DLG_TO_D
   // generic, repeating issues
   // eliminates empty DO ~~ actions that NI reports as corrupt dlg
   REPLACE_TEXTUALLY %DO ~~%
                     %%
   REPLACE_TEXTUALLY %DO ~
*~%
                     %%
   // fixes common mistake
   REPLACE_TEXTUALLY %AreaType(OUTSIDE)%
                     %AreaType(OUTDOOR)%
   // matches (foo,CHR,##) replaces with (foo,##,ddd)
   REPLACE_TEXTUALLY %CheckStat\(L\|G\)T(\(.*\),\([a-z|A-Z|0-9][a-z|A-Z|0-9][a-z|A-Z|0-9]\),\([0-9]+\))%
                     %CheckStat\1T(\2,\4,\3)%/*
   // matches (foo,CHR,##)  // replaces with (foo,##,ddd)
   REPLACE_TEXTUALLY %CheckStatGT(\(.*\),\([a-z|A-Z|0-9][a-z|A-Z|0-9][a-z|A-Z|0-9]\),\([0-9]+\))%
                     %CheckStatGT(\1,\3,\2)%*/
   REPLACE_TEXTUALLY %"LastTalkedToBy"%
                     %LastTalkedToBy%
   // matches (foo,[0.0]) // outputs (foo,[0.0],0)
   REPLACE_TEXTUALLY %CreateCreature(\(.*\),\(\[.*\]\))%
                     %CreateCreature(\1,\2,0)%
   // matches (foo1,foo2) // outputs (foo1,foo2,1,1,1)
   REPLACE_TEXTUALLY %CreateItem(\("?[a-z|A-Z|0-9]+"?\))%
                     %CreateItem(\1,1,1,1)%
   // matches (foo1,foo2) // outputs (foo1,foo2,1,1,1)
   REPLACE_TEXTUALLY %GiveItemCreate(\("?[a-z|A-Z|0-9]+"?\),\("?[a-z|A-Z|0-9]+"?\))%
                     %GiveItemCreate(\1,\2,1,1,1)%
   // matches (foo1,foo2,#) // outputs (foo1,foo2,#,1,1)
   REPLACE_TEXTUALLY %GiveItemCreate(\("?[a-z|A-Z|0-9]+"?\),\("?[a-z|A-Z|0-9]+"?\),\([0-9]+\))%
                     %GiveItemCreate(\1,\2,\3,1,1)%
   // matches ("foo1,"foo2",#,#,#) // outputs ("foo1","foo2",#,#,#)
   REPLACE_TEXTUALLY %GiveItemCreate("\([a-z|A-Z|0-9]+\),\("?[a-z|A-Z|0-9]+"?\),\([0-9]+\),\([0-9]+\),\([0-9]+\))%
                     %GiveItemCreate("\1",\2,\3,\4,\5)%
   REPLACE_TEXTUALLY %SeGlobal(%
                     %SetGlobal(%
    // matches (Set)Global(foo","foo2",foo3) // outputs Global("foo","foo2",foo3)
   REPLACE_TEXTUALLY %Global(\([a-z|A-Z|0-9]+\)","\([a-z|A-Z|0-9]+\)",\([0-9]+\))%
                     %Global("\1","\2",\3)%
    // matches (Set)Global("foo,"foo2",foo3) // outputs Global("foo","foo2",foo3)
   REPLACE_TEXTUALLY %Global("\([a-z|A-Z|0-9]+\),"\([a-z|A-Z|0-9]+\)",\([0-9]+\))%
                     %Global("\1","\2",\3)%
    // matches (Set)Global("foo",foo2",foo3) // outputs Global("foo","foo2",foo3)
   REPLACE_TEXTUALLY %Global("\([a-z|A-Z|0-9]+\)",\([a-z|A-Z|0-9]+\)",\([0-9]+\))%
                     %Global("\1","\2",\3)%
    // matches (Set)Global("foo","foo2","foo3) // outputs Global("foo","foo2",foo3)
   REPLACE_TEXTUALLY %Global("\([a-z|A-Z|0-9]+\)","\([a-z|A-Z|0-9]+\)","\([0-9]+\))%
                     %Global("\1","\2",\3)%
    // matches GlobalL/GT("foo",foo2",foo3) // outputs GlobalL/GT("foo","foo2",foo3)
   REPLACE_TEXTUALLY %Global\(L\|G\)T("\([a-z|A-Z|0-9]+\)",\([a-z|A-Z|0-9]+\)",\([0-9]+\))%
                     %Global\1T("\2","\3",\4)%
    // matches SetGlobalTimer("foo,"foo2",foo3) // outputs Global("foo","foo2",foo3)
   REPLACE_TEXTUALLY %SetGlobalTimer("\([a-z|A-Z|0-9]+\),"\([a-z|A-Z|0-9]+\)",\([0-9]+\))%
                     %SetGlobalTimer("\1","\2",\3)%
   REPLACE_TEXTUALLY %\(^\|~\)StartDialogueNoSet(Player1))\($\|~\)%
                     %\1StartDialogueNoSet(Player1)\2%
   REPLACE_TEXTUALLY %,"GLOABL",%
                     %,"GLOBAL",%
   REPLACE_TEXTUALLY %,"GLBOAL",%
                     %,"GLOBAL",%
   REPLACE_TEXTUALLY %"GLOBAL'%
                     %"GLOBAL"%
   REPLACE_TEXTUALLY %,"GLOBAL,%
                     %,"GLOBAL",%
   // matches If or IsValidForPartyDialog(ue)("foo) // outputs IsValidForPartyDialog("foo")
   REPLACE_TEXTUALLY %I[sf]ValidForPartyDialog\(ue\)?("\([a-z|A-Z|0-9]+\))%
                     %IsValidForPartyDialog("\2")%
   // matches ActionOverride(foo1",foo2) // matches ActionOverride("foo1",foo2)
   REPLACE_TEXTUALLY %ActionOverride(\([a-z|A-Z|0-9]+\)",\(.*\))%
                     %ActionOverride("\1",\2)%
   REPLACE_TEXTUALLY %STATE_CHAMRED%
                     %STATE_CHARMED%
   REPLACE_TEXTUALLY %STATE_DHARMED%
                     %STATE_CHARMED%
   // replaces AddJournalEntry(#) with AddJournalEntry(#,USER)
   REPLACE_TEXTUALLY %AddJournalEntry(\([0-9]+\))%
                     %AddJournalEntry(\1,USER)%
   REPLACE_TEXTUALLY %True(.+)%
                     %True()%
   REPLACE_TEXTUALLY %True$%
                     %True()%
   // replaces Dead("foo) with Dead("foo")
   REPLACE_TEXTUALLY %Dead("\([a-z|A-Z|0-9]+\))%
                     %Dead("\1")%
   REPLACE_TEXTUALLY %\[Player1\]%
                     %Player1%
   REPLACE_TEXTUALLY %CheckState%
                     %StateCheck%
   REPLACE_TEXTUALLY %NumTimesTalkedTo()%
                     %NumTimesTalkedTo(0)%
   REPLACE_TEXTUALLY %Set("\([a-z|A-Z|0-9]+\)","GLOBAL",\([0-9]+\))%
                     %SetGlobal("\1","GLOBAL",\2)%
   // due to an EscapeArea being at the EOF, we need to add () to all EscapeArea...
   REPLACE_TEXTUALLY %EscapeArea%
                     %EscapeArea()%
   // and then undo it for when it turns them into EscapeArea()foo
   REPLACE_TEXTUALLY %EscapeArea()\((\|[A-Z]\)%
                     %EscapeArea\1%
   REPLACE_TEXTUALLY %EscapeArea(.+)%
                     %EscapeArea()%
   REPLACE_TEXTUALLY %EscapeArea();%
                     %EscapeArea()%
   REPLACE_TEXTUALLY %True();%
                     %True()%
   REPLACE_TEXTUALLY %~True~%
                     %~True()~%
   // replaces Random(#,#) with RandomNum(#,#)
   REPLACE_TEXTUALLY %Random(\([0-9]+\),\([0-9]+\))%
                     %RandomNum(\1,\2)%
   // replaces DestroyItem(foo) with DestroyItem("foo")
   REPLACE_TEXTUALLY %DestroyItem(\([a-z|A-Z|0-9]+\))%
                     %DestroyItem("\1")%
   REPLACE_TEXTUALLY %HALFELF%
                     %HALF_ELF%
   REPLACE_TEXTUALLY %MoveToPoint(\[\.\])%
                     %MoveToPoint([-1.-1])%
   REPLACE_TEXTUALLY %Enemt()%
                     %Enemy()%
   REPLACE_TEXTUALLY %Die()%
                     %Kill(Myself)%
   // matches PartyGoldL/GT(#( with PartyGoldL/T(#)
   REPLACE_TEXTUALLY %PartyGold\(L\|G\)T(\([0-9]+\)(%
                     %PartyGold\1T(\2)%
   // matches PartyGoldL/GT(#( with PartyGoldL/T(#)
   REPLACE_TEXTUALLY %Reaction\(L\|G\)T(\([a-z|A-Z|_|0-9]+\))%
                     %Reaction\1T(LastTalkedToBy,\2)%
   REPLACE_TEXTUALLY %FRIENLY_LOWER%
                     %FRIENDLY_LOWER%
   REPLACE_TEXTUALLY %NUETRAL_LOWER%
                     %NEUTRAL_LOWER%
   REPLACE_TEXTUALLY %RAKHASA%
                     %RAKSHASA%
   REPLACE_TEXTUALLY %Class(Player,MAGE_ALL)%
                     %Class(Player1,MAGE_ALL)%
   REPLACE_TEXTUALLY %NumberOfTimesTalkedTo%
                     %NumTimesTalkedTo%
   REPLACE_TEXTUALLY %CreateVisualEffectObject("\([a-z|A-Z|_|0-9]+\),"\([a-z|A-Z|_|0-9]+\)")%
                     %CreateVisualEffectObject("\1","\2")%
   REPLACE_TEXTUALLY %ChangeAIScript("\([a-z|A-Z|_|0-9]+\),\([a-z|A-Z|_|0-9]+\))%
                     %ChangeAIScript("\1",\2)%
   REPLACE_TEXTUALLY %Name(LastTalkedToBy,"\([a-z|A-Z|_|0-9]+\)")%
                     %Name("\1",LastTalkedToBy)%
   REPLACE_TEXTUALLY %!Dead(\(PLAYER[1-6]\))%
                     %!StateCheck(\1,STATE_DEAD)             
!StateCheck(\1,STATE_DEAD)
!StateCheck(\1,STATE_ACID_DEATH)
!StateCheck(\1,STATE_FLAME_DEATH)
!StateCheck(\1,STATE_EXPLODING_DEATH)
!StateCheck(\1,STATE_STONE_DEATH)
!StateCheck(\1,STATE_FROZEN_DEATH)%
   // specific triggers and actions
    // aerie.dlg
   REPLACE_TEXTUALLY %StartDialogueNoSet()%
                     %StartDialogueNoSet([PC])%
   // arnman11.dlg
   REPLACE_TEXTUALLY %ActionOverride("arnman10",MoveToObject("arnman11")\($\|~\)%
                     %ActionOverride("arnman10",MoveToObject("arnman11"))\1%
   // baerie.dlg
   REPLACE_TEXTUALLY %MoveGlobal("AR0607","Aerie",\[1034\.1034\],0)%
                     %MoveGlobal("AR0607","Aerie",[1034.1034])%
   // bandic.dlg
   REPLACE_TEXTUALLY %NumDeadGT("Bandcap"4)%
                     %NumDeadGT("Bandcap",4)%
    // banomen.dlg
   REPLACE_TEXTUALLY %ReactionGT(Player1,NEUTRAL_UPPER))%
                     %ReactionGT(Player1,NEUTRAL_UPPER)%      
   // bdact05.dlg
   REPLACE_TEXTUALLY %ActionOverride("bdact06",MoveToPoint(1384.420\])%
                     %ActionOverride("bdact06",MoveToPoint([1384.420]))%
   //" bdact05.dlg
   REPLACE_TEXTUALLY %StartCutScene("Cut31L)%
                     %StartCutScene("Cut31L")%
   // "bhgaal01.dlg
   REPLACE_TEXTUALLY %SetGlobal("UnseeingEye,"GLOBAL",1)%
                     %SetGlobal("UnseeingEye","GLOBAL",1)%
   REPLACE_TEXTUALLY %Global("InteractEdwin,"LOCALS",0)%  
   //" burch2.dlg
                     %Global("InteractEdwin","LOCALS",0)%
   // "bhgaal01.dlg
   REPLACE_TEXTUALLY %SetGlobal("UnseeingEye,"GLOBAL",1)%
                     %SetGlobal("UnseeingEye","GLOBAL",1)%
   // CATTAC.DLG
   REPLACE_TEXTUALLY %Attack(NearestEnemyOf(Myself)\($\|~\)%
                     %Attack(NearestEnemyOf(Myself))\1%
   // dadrow17
   REPLACE_TEXTUALLY %SetGlobal("GhaunTimer","GLOBAL",ONE_DAY)%
                     %SetGlobalTimer("GhaunTimer","GLOBAL",ONE_DAY)%
   // dmtown1
   REPLACE_TEXTUALLY %RandomNum(4,1)1%
                     %RandomNum(4,1)%
   // drunk.dlg
   REPLACE_TEXTUALLY %Sleep()%
                     %ReallyForceSpell(Myself,SURE_SLEEP)%
   // cor.dlg
   REPLACE_TEXTUALLY %Global("AnomenDecide,"GLOBAL",3)%
                     %Global("AnomenDecide","GLOBAL",3)%
   // elgea
   REPLACE_TEXTUALLY %!IsValidForPartyDialog("Korgan")!%
                     %!IsValidForPartyDialog("Korgan")%
   // fergus
   REPLACE_TEXTUALLY %~Global("FERGUS1","GLOBAL",2);~%
                     %~Global("FERGUS1","GLOBAL",2)~%
   // firtrl01
   REPLACE_TEXTUALLY %Dead(firorc01)%
                     %Dead("firorc01")%
   // flam7
   REPLACE_TEXTUALLY %StateCheck(Myself,STATE_CHARMED);%
                     %StateCheck(Myself,STATE_CHARMED)%
   // gorf1
   REPLACE_TEXTUALLY %Global("GorfBystander","GLOBAL",6")%
                     %Global("GorfBystander","GLOBAL",6)%
   REPLACE_TEXTUALLY %ReactionGLT(LastTalkedToBy,NEUTRAL_UPPER)%
                     %ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)%
   // kaish
   REPLACE_TEXTUALLY %Dead(Karoug)%
                     %Dead("Karoug")%
   // kielpc
   REPLACE_TEXTUALLY %OpenDoor(Door09)%
                     %OpenDoor("Door09")%
   REPLACE_TEXTUALLY %MoveToPoint(2357\.930\])%
                     %MoveToPoint([2357.930])%
   REPLACE_TEXTUALLY %ChangeAIScript(\?\?\?\?\?,Override)%
                     %ChangeAIScript("",Override)%
   // kielpc
   REPLACE_TEXTUALLY %Global("SpokenToEmerson",0)%
                     %Global("SpokenToEmerson","GLOBAL",0)%
   // test2
   REPLACE_TEXTUALLY %Attack(\[0\],0,\[0\])%
                     %Attack([ANYONE])%
   // uhinn01
   REPLACE_TEXTUALLY %!Dead("uhinn02')%
                     %!Dead("uhinn02")%
   REPLACE_TEXTUALLY %!InParty("Korgan")!%
                     %!InParty("Korgan")%
   REPLACE_TEXTUALLY %!Gabber%
                     %!IsGabber%
   REPLACE_TEXTUALLY %ientActivate("AM3000A",TRUE)%
                     %AmbientActivate("AM3000A",TRUE)%
   REPLACE_TEXTUALLY %AmbAmbientActivate("AM3000A",TRUE)%  
                     %AmbientActivate("AM3000A",TRUE)%
   REPLACE_TEXTUALLY %StaticSeque%  
                     %StaticSequence("AM3000A",1)%
   REPLACE_TEXTUALLY %StaticSequence("AM3000A",1)nce%  
                     %StaticSequence%
   REPLACE_TEXTUALLY %EscapeAreaMove("AR2002",341,400,12~%            //~
                     %EscapeAreaMove("AR2002",341,400,12)~%           //~
   REPLACE_TEXTUALLY %Open("\([a-z|A-Z|0-9]+\)")%
                     %OpenDoor("\1")%
   REPLACE_TEXTUALLY %GiveItem(\[PC\],"misc8u")%  
                     %GiveItem("misc8u",[PC])%
   REPLACE_TEXTUALLY %SetGlobalTimer("CircusEnded","GLOBAL",ONE_DAY~%  //~
                     %SetGlobalTimer("CircusEnded","GLOBAL",ONE_DAY)~% //~
   REPLACE_TEXTUALLY %FadeFromColor(\[20.0),0\]\($\|~\)%
                     %FadeFromColor([20.0),0])\1%
   REPLACE_TEXTUALLY %ReactionGT(Player1,NEUTRAL_UPPER))\($\|~\)%
                     %ReactionGT(Player1,NEUTRAL_UPPER)\1%
   REPLACE_TEXTUALLY %InParty("YOSHIMO)% //"
                     %InParty("YOSHIMO")%
   REPLACE_TEXTUALLY %SetGlobal("PitFight",AR0406",3)%  //"
                     %SetGlobal("PitFight","AR0406",3)%
   REPLACE_TEXTUALLY %InParty("Viconia)%  //"
                     %InParty("Viconia")%
   REPLACE_TEXTUALLY %SetGlobalTimer("KeldornHome","GLOBAL",THREE_DAYS")% //"
                     %SetGlobalTimer("KeldornHome","GLOBAL",THREE_DAYS)%
 COMPILE_D_TO_DLG
 BUT_ONLY_IF_IT_CHANGES

Link to comment

I realized I should at least try to document my methodology and add some notes re: fixes. Anything that was causing compilation to fail or emit warnings was fixed--this includes the leftover BG dialogues. Some of the fixes I passed off to a d file for safety, such as the massive numbers of SetGlobals used as triggers and Globals used as actions (trying to replace a Global in an action in a purely textual fashion has the potential to break it when used legitimately as a trigger). I've tried to document these changes in the tp2 itself. i.e.

 

     // matches (Set)Global(foo","foo2",foo3) outputs Global("foo","foo2",foo3)
   REPLACE_TEXTUALLY %Global(\([a-z|A-Z|0-9]+\)","\([a-z|A-Z|0-9]+\)",\([0-9]+\))% 
                     %Global("\1","\2",\3)%

 

The next block of changes were to address specific issues in specific dialogues. For the most part I have tried to generalize these solutions as much as possible.

 

The next block of changes is to repair bad references to DVs. Most of these are typos in the dialogues, though a few are non-assigned DVs in the creature files itself. These are addressed in a cre patch prior to the dlg patch. To determine bad script references, I would first look to see if it matched a BG DV. Next step would be to try and see if the DV matched a BG2 creature filename--if so I either used the existing DV in that filename or assigned that creature file to use its filename as its DV if none existed. If there was no creature filename match, I would search for a creature with the same apparent name as the DV.

 

Following this is a massive block that would remove every reference to a BG cre file or DV not used in BG2. This block reduces the warnings from NI to under 100 (from the original 1500) but takes WeiDU well over 30 minutes to execute. As a result, it's included but commented out if you wish to run it to narrow down your warning list.

 

Even with these changes, there remain some outstanding warnings I was unable to address:

  • TakeItemReplace("GORCHRAM","GORCHR",Myself) - GORCHRAM is not a valid item; this is from GORCHR.dlg
  • TriggerActivation("Guillotine1",TRUE) and TriggerActivation("Guillotine2",TRUE) from ARNWAR07.dlg. This is an apparent references to traps in AR0329 which are not present; we should look to restore the traps.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...