Posted by: jastey
« on: September 16, 2007, 01:31:36 AM »Cool. 

/* Dynaheir hostile leave if attacked */
I_C_T4 ~%tutu_var%DYNAHE~ 10 X#AjantisDynaheir
== ~%AJANTIS_JOINED%~ IF ~valid~ THEN @21 DO ~
ActionOverride("ajantis",LeaveParty())
ActionOverride("ajantis",SetLeavePartyDialogFile())
ActionOverride("ajantis",ChangeAIScript("",DEFAULT))
ActionOverride("ajantis",Enemy())
SetGlobal("X#AjantisRomanceActive","GLOBAL",3)~
== ~%KIVAN_JOINED%~ IF ~valid~ THEN @33 DO ~
ActionOverride("kivan",LeaveParty())
ActionOverride("kivan",SetLeavePartyDialogFile())
ActionOverride("kivan",ChangeAIScript("",DEFAULT))
ActionOverride("kivan",Enemy())~
END
IF ~~ THEN BEGIN 10 // from: 9.1
SAY #86901 /* ~An unfortunate decision! Pardon me while I put up a fight!~ */
IF ~~ THEN DO ~ActionOverride("minsc",LeaveParty())
ActionOverride("minsc",Enemy())
Enemy()
~ EXIT
END
WARNING: I_C_T2: the interjection point (_DYNAHE 10) has multiple exit transitions that have different actions!
First Action: SetGlobal("X#KivanDynaheir","GLOBAL",1)
ActionOverride("minsc",LeaveParty())
ActionOverride("minsc",Enemy())
Enemy()
Other Action: ActionOverride("minsc",LeaveParty())
ActionOverride("minsc",Enemy())
Enemy()
/* Dynaheir hostile leave if attacked */
I_C_T2 ~%tutu_var%DYNAHE~ 10 X#AjantisDynaheir
== ~%AJANTIS_JOINED%~ IF ~InParty("ajantis") InMyArea("ajantis") !StateCheck("ajantis",CD_STATE_NOTVALID)~ THEN @21 DO ~LeaveParty() SetLeavePartyDialogFile() ChangeAIScript("",DEFAULT) Enemy() SetGlobal("X#AjantisRomanceActive","GLOBAL",3)~
END
and in another file we do this:I_C_T2 ~%tutu_var%DYNAHE~ 10 X#KivanDynaheir
== ~%KIVAN_JOINED%~ IF ~InParty("kivan") InMyArea("kivan") !StateCheck("kivan",CD_STATE_NOTVALID)~ THEN @33
DO ~ActionOverride("kivan",LeaveParty()) ActionOverride("kivan",Enemy())~
END
/* Dynaheir hostile leave if attacked */
I_C_T ~%tutu_var%DYNAHE~ 10 X#AjantisDynaheir
== ~%AJANTIS_JOINED%~ IF ~InParty("ajantis") InMyArea("ajantis") !StateCheck("ajantis",CD_STATE_NOTVALID)~ THEN @21 DO ~ActionOverride("ajantis",LeaveParty()) ActionOverride("ajantis",SetLeavePartyDialogFile()) ActionOverride("ajantis",ChangeAIScript("",DEFAULT)) ActionOverride("ajantis",Enemy()) SetGlobal("X#AjantisRomanceActive","GLOBAL",3)~
== ~%tutu_var%DYNAHE~ ~Some Reply Here.~
END
I_C_T2 ~%tutu_var%DYNAHE~ 10 X#KivanDynaheir
== ~%KIVAN_JOINED%~ IF ~InParty("kivan") InMyArea("kivan") !StateCheck("kivan",CD_STATE_NOTVALID)~ THEN @33
DO ~ActionOverride("kivan",LeaveParty()) ActionOverride("kivan",SetLeavePartyDialogFile()) ActionOverride("kivan",ChangeAIScript("",DEFAULT))ActionOverride("kivan",Enemy())~
== ~%tutu_var%DYNAHE~ ~Some Reply Here.~
END
I_C_T3 ~_WILLIA~ 10 ManyInt6
== ~BranwenJ~ IF ~InParty("Branwen")~ THEN ~Hi, I'm Branwen.~
== ~_WILLIA~ IF ~InParty("Branwen")~ THEN ~Hello, Branwen.~
== ~MinscJ~ IF ~InParty("Minsc")~ THEN ~Hi, I'm Minsc.~
== ~_WILLIA~ IF ~InParty("Minsc")~ THEN ~Hello, Minsc.~
== ~ImoenJ~ IF ~InParty("Imoen")~ THEN ~Hi, I'm Imoen.~
== ~_WILLIA~ IF ~InParty("Imoen")~ THEN ~Hello, Imoen.~
END
and to make it a "jump into a state with multiple different transitions, with actions retained by the original speaker no matter what":I_C_T4 ~_WILLIA~ 10 ManyInt6
== ~BranwenJ~ IF ~InParty("Branwen")~ THEN ~Hi, I'm Branwen.~
== ~MinscJ~ IF ~InParty("Minsc")~ THEN ~Hi, I'm Minsc.~
== ~ImoenJ~ IF ~InParty("Imoen")~ THEN ~Hi, I'm Imoen.~
END
I_C_T4 ~_WILLIA~ 10 ManyInt6
== ~BranwenJ~ IF ~InParty("Branwen")~ THEN ~Hi, I'm Branwen.~
// == ~_WILLIA~ IF ~InParty("Branwen")~ THEN ~Hello, Branwen.~
== ~MinscJ~ IF ~InParty("Minsc")~ THEN ~Hi, I'm Minsc.~
// == ~_WILLIA~ IF ~InParty("Minsc")~ THEN ~Hello, Minsc.~
== ~ImoenJ~ IF ~InParty("Imoen")~ THEN ~Hi, I'm Imoen.~
// == ~_WILLIA~ IF ~InParty("Imoen")~ THEN ~Hello, Imoen.~
END
Searching for: WILLIA~ 10
phase2\dlg\x#ajint.d(29): I_C_T ~%tutu_scriptbg%WILLIA~ 10 ManyInt10
phase2\dlg\x#alint.d(236): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 X#ManyInt15
phase2\dlg\x#brint.d(39): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 X#ManyInt6
phase2\dlg\x#edint.d(93): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt12
phase2\dlg\x#elint.d(7): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt9
phase2\dlg\x#gaint.d(84): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt11
phase2\dlg\x#imint.d(1238): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt14
phase2\dlg\x#jaint.d(214): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt16
phase2\dlg\x#miint.d(266): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt7
phase2\dlg\x#miint.d(274): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt8
phase2\dlg\x#xaint.d(195): I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt13
Found 11 occurrence(s) in 10 file(s)
WARNING: I_C_T2: the interjection point (_WILLIA 10) has multiple exit transitions that have different actions!
First Action: SetGlobal("ManyInt6","GLOBAL",1)
EscapeArea()
Other Action: EscapeArea()
The problem code:I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt6
== ~%BRANWEN_JOINED%~ IF ~InParty("branwen") InMyArea("branwen") !StateCheck("branwen",CD_STATE_NOTVALID)~ THEN @9
== ~%tutu_scriptbg%WILLIA~ IF ~InParty("branwen") InMyArea("branwen") !StateCheck("branwen",CD_STATE_NOTVALID)~ THEN @10
END
and state 10 originally:IF ~~ THEN BEGIN 10 // from:
SAY #78838 /* ~Cute as a bug, you were. Go play with your friends now. Go on.~ */
IF ~~ THEN DO ~EscapeArea()
~ EXIT
END
I_C_T2 ~%tutu_scriptbg%WILLIA~ 10 ManyInt16
== ~%JAHEIRA_JOINED%~ IF ~InParty("jaheira") InMyArea("jaheira") !StateCheck("jaheira",CD_STATE_NOTVALID)~ THEN @57
== ~%KHALID_JOINED%~ IF ~InParty("jaheira") InMyArea("jaheira") !StateCheck("jaheira",CD_STATE_NOTVALID) InParty("khalid") InMyArea("khalid") !StateCheck("khalid",CD_STATE_NOTVALID)~ THEN @58
== ~%JAHEIRA_JOINED%~ IF ~InParty("jaheira") InMyArea("jaheira") !StateCheck("jaheira",CD_STATE_NOTVALID) InParty("khalid") InMyArea("khalid") !StateCheck("khalid",CD_STATE_NOTVALID)~ THEN @59
== ~%KHALID_JOINED%~ IF ~InParty("jaheira") InMyArea("jaheira") !StateCheck("jaheira",CD_STATE_NOTVALID) InParty("khalid") InMyArea("khalid") !StateCheck("khalid",CD_STATE_NOTVALID)~ THEN @60
END
.WARNING: I_C_T2: the interjection point (_SAFANA 5) has multiple exit transitions that have different actions!
First Action: JoinParty()
Other Action: SetGlobalTimer("Safana","GLOBAL",FIVE_DAYS)
SetGlobal("MACGolemCave","GLOBAL",1)
JoinParty()
I_C_T2 ~%tutu_var%SAFANA~ 5 JaheiraSafana1
== ~%JAHEIRA_JOINED%~ IF ~Gender(Player1, MALE) InParty("jaheira") InMyArea("jaheira") !StateCheck("jaheira",CD_STATE_NOTVALID)~ THEN @19
== ~%tutu_var%SAFANA~ IF ~Gender(Player1, MALE) InParty("jaheira") InMyArea("jaheira") !StateCheck("jaheira",CD_STATE_NOTVALID)~ THEN @20
END
the original state 5, IF ~~ THEN BEGIN 5 // from: 4.1
SAY #88285 /* ~Ohh, thank you, you won't regret your decision. I know that powerful heroes like you will easily push through any obstacles in our path. Well, we should be off then. From what my map showed, the pirate cove is located somewhere along the coast, just south of Candlekeep.~ */
IF ~Global("MACGolemCave","GLOBAL",0)
~ THEN DO ~SetGlobalTimer("Safana","GLOBAL",FIVE_DAYS)
SetGlobal("MACGolemCave","GLOBAL",1)
JoinParty()
~ UNSOLVED_JOURNAL #88286 /* ~Safana's treasure hunt
We have agreed to help Safana recover a treasure from the talons of some type of monster. She was most persuasive when requesting our help. The treasure cove is located somewhere along the coast, just south of Candlekeep.~ */ EXIT
IF ~GlobalGT("MACGolemCave","GLOBAL",0)
~ THEN DO ~JoinParty()
~ EXIT
END
In this instance, the bantering already returns to Safana, so the recode is simply moving it to I_C_T. Safana will carry out the actions in the transition rather than Jaheira. And if it would be"has to be used". (well, unless you use the "Get back to the interjectee" trick, in which case I_C_T1 would still be fine).
IF ~~ THEN BEGIN 28 // from: 36.1 32.2 31.2 30.2 27.1 27.0
SAY #82628 /* ~Pardon if I do not thank fully. Leave me now. I do not wish your sight.~ */
IF ~~ THEN REPLY ~OK, I'm replying~ DO ~EscapeArea()~
IF ~~ THEN REPLY ~bla1~ DO ~EscapeArea()~
IF ~~ THEN REPLY ~bla2~ DO ~EscapeArea()~
I_C_T2 could be used save, too ?