Jump to content

AnomenJ.dlg state triggers


Recommended Posts

EDIT: The code below got edited due to bugfixes, please note the changes! (Current: Novembre, 12th.) In case this post is not the last one in this thread, there might be a more up-to-date (bug-fixed) tweaks list further down (as I cannot edit this post if it is no longer the last of the thread).


I coded tweaks for the dialogue states of the AnomenJ I already mentioned (although not the proposed ones, as I have had better ideas and insights in the meanime, but I can't edit my previous posts.)


In the changed version, the triggering of the dialogues includes two set of variables: One is used in the script block from 0 to 1, the second is set from zero to one in the dialogue. This is how the triggering was done originally, but the script variable wasn't used as a trigger variable in the dialogue, so that is what I added (I used existing variables where they were available). In some cases, I had to add script trigger variables (easy to recognise by the "C#" prefix) to complete the cycle. In several cases I added incrementing of the dialogue variable as it was missing.


The following is not fully alpha-tested yet. What I tested is: I have checked the changed .bcs and dlg quite carefully, and alphatested the Windspear hill "after fight" dialogue and the "after trial" dialogues.

If there is any reason why this is no good idea (accidentally overwriting of a trigger variable for other events, false or crappy coding, I am an idiot, other other similar severe reasons) please let me know.

In case anyone likes this so much that he/she wants to include this into his/her mod, feel free to do so. As I understood the used code will not give an error message during install if the script blocks are already changed by another mod, so having more than one mod that tries to make the same tweaks would not lead to an install error but the tweaks would be applied by the first mod installed.

You would need to include the extra_regexp_vars.tph from the BGII Fixpack, though, which I shamelesly copied, thank you, CamDawg. :)


The variables starting with "C#" refer to variables I introduced to guaranty uniqueness of the state, all other variables are original BioWare variables that are used in the according dialogue's scriptblock already. ("C#" is my personal prefix, but I don't mind if is used for the here proposed tweaks /fixes.)


The changed states are:


/* AnomenJ tweaks (in correspondance to the Anomen.bcs tweaks in the setup.tp2): Adding of unique trigger variables to prevent the dialogues to kick in instead of mod-added dialogues*/

/*"What did we do" Windspear Hill dialogue:*/
ADD_STATE_TRIGGER ANOMENJ 0 ~Global("C#AnomenMonsters1","LOCALS",1)~

/*"Our honour is redeemed" Windspear Hill dialogue*/
ADD_STATE_TRIGGER ANOMENJ 9 ~Global("C#AnomenMonsters2","LOCALS",1)~

/*Anomen complains to return to his home after the news of his dead sister, complaint 1:*/
ADD_STATE_TRIGGER ANOMENJ 28 ~Global("C#AnomenComplain","LOCALS",1)~

/*Anomen complains to return to his home after the news of his dead sister, complaint 2:*/
ADD_STATE_TRIGGER ANOMENJ 32 ~Global("C#AnomenComplain","LOCALS",2)~

/* add state trigger for Anomen's after knight test talk(s): */
/*CN Anomen*/
A_S_T AnomenJ 101 ~Global("AnomenSpeaksAfterTrial","LOCALS",1)~

/*LG Anomen*/
A_S_T AnomenJ 110 ~Global("AnomenSpeaksAfterTrial","LOCALS",1)~

/*Anomen's warning dialogue in the tanner's house*/
A_S_T AnomenJ 205 ~Global("TannerWarning","AR0502",1)~

/*Anomen's comment on the dead watchman's body (tanner house)*/
A_S_T AnomenJ 207 ~Global("FoundAegis2","LOCALS",1)~

/*Anomen's comment on dead Saerk, after he killed him and his daughter*/
A_S_T AnomenJ 282 ~Global("TheBadManIsDead","LOCALS",1)~

/* AnomenJ fix (in correspondance to the Anomen.bcs tweaks in the setup.tp2):
This is a fix so that Anomen's second "dead sisther" complaint can be triggered at all:*/


In the script blocks, I added the trigger variables accordingly by REPLACE_TEXTUALLY (note that printed into the .tp2 there should be no line breaks after the "[%tab%" or between the "RESPONSE #100"):


/* AnomenJ.dlg "tweaks and fixes": To prevent the dialogues to trigger instead of mod dialogues, and fix of the Anomen-Garren's kid quest and second "return to my home because my sister is dead" complaint 

COPY_EXISTING ~anomen.bcs~ ~override~
/*Tweak: Giving the Windspear Hill "What did we do" dialogue a unique trigger variable (next two R_T), the Wait(1) is removed to make Anomen's dialogue be triggered faster than Garren's:*/
REPLACE_TEXTUALLY ~\(Global("AnomenMonsters","LOCALS",0)\)~ 
~Global("C#AnomenMonsters1","LOCALS",0) \1~
REPLACE_TEXTUALLY ~Wait(1)[%tab% %lnl%%mnl%%wnl%]+\(StartDialogu?e?NoSet(Player1)[%tab% %lnl%%mnl%%wnl%]+SetGlobal("AnomenMonsters","LOCALS",1)\)~
~SetGlobal("C#AnomenMonsters1","LOCALS",1) \1~

/*Tweak: Giving the Windspear Hill "Anomen is happy because PC's honour is restored" dialogue a unique trigger variable (next two R_T):*/
REPLACE_TEXTUALLY ~\(Global("AnomenMonsters","LOCALS",1)[%tab% %lnl%%mnl%%wnl%]+Global("Kidnap","GLOBAL",3)\)~
~Global("C#AnomenMonsters2","LOCALS",0) \1~
REPLACE_TEXTUALLY ~\(StartDialogu?e?NoSet(Player1)[%tab% %lnl%%mnl%%wnl%]+SetGlobal("AnomenMonsters","LOCALS",2)\)~ 
~SetGlobal("C#AnomenMonsters2","LOCALS",1) \1~

/*Fix: Puts the variable setting in front of the dialogue triggering so that Anomen's complaint about delaying Garren kid's quest gets triggered:*/
REPLACE_TEXTUALLY ~\(StartDialogu?e?NoSet(Player1)[%tab% %lnl%%mnl%%wnl%]+\)\(SetGlobal("ddAnomenWhine","LOCALS",1)\)~
~\2 \1~

/*Tweak: Giving Anomen's complaints about returning home to his dead sister a unique trigger variable:*/
REPLACE_TEXTUALLY ~\(GlobalLT("AnomenComplain","LOCALS",2)[%tab% %lnl%%mnl%%wnl%]+Global("TalkedToCor","GLOBAL",0)[%tab% %lnl%%mnl%%wnl%]+CombatCounter(0)[%tab% %lnl%%mnl%%wnl%]+!Global("Chapter","GLOBAL",4)[%tab% %lnl%%mnl%%wnl%]+!Global("Chapter","GLOBAL",5)[%tab% %lnl%%mnl%%wnl%]+!Global("Chapter","GLOBAL",7)[%tab% %lnl%%mnl%%wnl%]+AreaType(OUTDOOR)[%tab% %lnl%%mnl%%wnl%]+See(Player1)\)[%tab% %lnl%%mnl%%wnl%]+\(THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100\)[%tab% %lnl%%mnl%%wnl%]+\(StartDialogNoSet(Player1)\)~
~\1 GlobalLT("C#AnomenComplain","LOCALS",2) \2 IncrementGlobal("C#AnomenComplain","LOCALS",1) \3~

/*Tweak: Giving Garren a "Wait(1)" before he initiates dialogue with the PC after the Windspear Hill fight, to enable Anomen to start his dialogue:*/
COPY_EXISTING ~garren.bcs~ ~override~
REPLACE_TEXTUALLY ~\(GlobalLT("DomainPaladinBattle","GLOBAL",4)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100\)[%tab% %lnl%%mnl%%wnl%]+\(StartDialogu?e?NoSet(Player1)\)~
~\1 Wait(1) \2~

Link to comment


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

  • Create New...