Author Topic: I_C_T vs I_C_T2 revisited.  (Read 9054 times)

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
I_C_T vs I_C_T2 revisited.
« on: September 13, 2007, 08:40:04 PM »
OK.

I understand that I_C_T is both

INTERJECT, where a dialogue state is inserted into an existing sequence of states and plays only once

and

COPY_TRANS, where the actions are passed from state to state throughout the series of states (dialogue).

This means that whatever actor speaks last does the actions gathered in the whole series. It allows the original dialogue to play out, set its variables, do its actions, with a dialogue state (or states) inserted into the sequence.

I understand that I_C_T2 does the same thing, except that it blocks the actions from passing to the actor doing the interjecting. This is important when the action is one that involves starting or finishing cutscenes, EscapeArea(), DestroySelf(), or other direct actions which could accidentally be transferred to the wrong actor.

Now.

I have over 400 entries using I_C_T2 which throw
Code: [Select]
WARNING: I_C_T2: the interjection point (_KAISH 27) has multiple exit transitions that have different actions!
First Action: ""
Other Action: TakePartyItem("_MISC1C")
The majority of them speak a single line, like thio:
Code: [Select]
I_C_T2 ~%tutu_scriptd%URLYLE1~ 1 X#CoranDur2
== ~%CORAN_JOINED%~ IF ~InParty("coran") InMyArea("coran") !StateCheck("coran",CD_STATE_NOTVALID) Global("P#CoranMatch","GLOBAL",1) !Global("P#CoranRomanceInactive","GLOBAL",1)~ THEN @26
END
or even set a variable
Code: [Select]
/* Bjornin, the hurt paladin in Beregost */
I_C_T2 ~%tutu_var%BJORNI~ 1 X#AjantisBjorninTalk1
== ~%AJANTIS_JOINED%~ IF ~InParty("ajantis") InMyArea("ajantis") !StateCheck("ajantis",CD_STATE_NOTVALID)~ THEN @5 DO ~SetGlobal("X#AjantisHelpBjornin","GLOBAL",1)~
END
and sometimes actively sidetrack the  dialogue completely

{can't find the code, but basically jump to a CHAIN}.

Somewhere in here I am getting a mental block.

When I am diagnosing the I_C_T2 error reporting multiple exit points, I am getting very confused as to how to figure out what should be recoded to I_C_

For example, Durlyle.
Cross reference pulls up this:
Code: [Select]

---------- Find in Files ----------
> Searching for the string 'URLYLE1'...

E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(1,32): ADD_TRANS_ACTION %tutu_scriptd%URLYLE1 BEGIN 61 63 64 END BEGIN
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(86,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 51 X#BranwenFlowers2
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(100,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 0 X#CoranDur1
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(104,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 1 X#CoranDur2
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(108,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 3 X#CoranDur3
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(112,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 4 X#CoranDur4
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(116,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 7 X#CoranDur5
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(120,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 8 X#CoranDur6
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(124,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 9 X#CoranDur7
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(128,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 10 X#CoranDur8
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(132,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 12 X#CoranDur9
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(136,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 20 X#CoranDur10
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(140,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 21 X#CoranDur11
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(144,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 29 X#CoranDur12
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(148,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 34 X#CoranDur13
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(152,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 35 X#CoranDur14
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(156,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 36 X#CoranDur15
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(160,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 37 X#CoranDur16
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(164,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 39 X#CoranDur17
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(168,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 51 X#CoranDur18
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(172,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 55 X#CoranDur19
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(179,19): == ~%tutu_scriptd%URLYLE1~ @40
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(181,19): == ~%tutu_scriptd%URLYLE1~ @42
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(183,19): == ~%tutu_scriptd%URLYLE1~ @43
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(188,34): ADD_TRANS_TRIGGER ~%tutu_scriptd%URLYLE1~ 58 ~OR(3) !InParty("coran") !Global("P#CoranMatch","GLOBAL",1) Global("P#CoranRomanceInactive","GLOBAL",1)~
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(189,34): ADD_TRANS_TRIGGER ~%tutu_scriptd%URLYLE1~ 59 ~OR(3) !InParty("coran") !Global("P#CoranMatch","GLOBAL",1) Global("P#CoranRomanceInactive","GLOBAL",1)~
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(191,30): EXTEND_BOTTOM ~%tutu_scriptd%URLYLE1~ 58
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(195,30): EXTEND_BOTTOM ~%tutu_scriptd%URLYLE1~ 59
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(259,23): I_C_T2 ~%tutu_scriptd%URLYLE1~ 51 FALDORNDURLYLE1
E:\TestBaldursGateTutu\BG1NPC\phase2\dlg\x#totsc.d(261,19): == ~%tutu_scriptd%URLYLE1~ IF ~InParty("faldorn") InMyArea("faldorn") !StateCheck("faldorn",CD_STATE_NOTVALID)~ THEN @57

In the entire vanilla decompiles _URLYLE1.D, there is only one state (state 6) which results in an EscapeArea. It can be approached from several points. There are several different Journal entries, as well, based on responses, but since those journal entries can be set by any actor, this should not be a problem.

Not all I_C_T2s listed generate errors. Only states
Code: [Select]
WARNING: I_C_T2: the interjection point (_URLYLE1 29) has multiple exit transitions that have different actions!
First Action: AddJournalEntry(82635,QUEST)
Other Action: AddJournalEntry(82639,QUEST)
WARNING: I_C_T2: the interjection point (_URLYLE1 29) has multiple exit transitions that have different actions!
First Action: AddJournalEntry(82636,QUEST)
Other Action: AddJournalEntry(82639,QUEST)
WARNING: I_C_T2: the interjection point (_URLYLE1 34) has multiple exit transitions that have different actions!
First Action: AddJournalEntry(82631,QUEST)
Other Action: ""
WARNING: I_C_T2: the interjection point (_URLYLE1 39) has multiple exit transitions that have different actions!
First Action: ""
Other Action: AddJournalEntry(82631,QUEST)

have these errors.

And here my logic runs dry. Am I supposed to backtrace each potential path, and use I_C_T on any that cannot result in an action like Enemy() or EscapeAreaDestroy()?  Does the transfer back to the original speaker make this only applicable to states which interject between the last speaker statement and the closing of the dialogue (if so, almost all I_C_Ts are ok, unless they fill in after the end of the dialogue, interjecting below the final state, right?

I guess i am looking for a conceptual leap that will allow me to look at a dialogue state sequence, and say "ICT this one. Nope - that one could end up wrong - leave it alone and live with the error in the log." (assuming that thgere is even such a thing as an "OK" error in the log - but research on back posts seems to indicate that sometimes this error is "ok". )
« Last Edit: September 14, 2007, 04:56:17 PM by cmorgan »

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs __C_T2 revisited.
« Reply #1 on: September 14, 2007, 07:17:11 AM »
it is not possible to sidetrack a dialogue via I_C_T.

The decision flow, after you get the warnings, is as follows:

Check the relevant state (E.G. for I_C_T* _URLYLE1 29 you should check state 29 of _URLYLE1.dlg) and see the actions for each transition.

If they don't affect the _current_ talker (notably, ActionOverride("minsc",LeaveParty()) doesn't affect the current talker), then move to I_C_T1.

If at least one of the actions affects the current talker, and they differ (E.G. one is DO ~DestroySelf()~ and the other is DO ~SetGlobal("something","GLOBAL",1)~), then you should either delete the interjection, move it to a different entry point, or do the C_T bit manually.

Here is an example. Suppose we have the following two dialogue:
Code: [Select]
BEGIN Minsc
IF ~~ THEN Minsc 0
SAY ~Hi, this is Boo!~
IF ~~ THEN DO ~ActionOverride("Edwin",LeaveParty())~ GOTO 1
IF ~InParty("Imoen")~ THEN EXTERN ImoenJ 123
END

IF ~~ THEN Minsc 1
SAY ~Right, Boo?~
IF ~~ THEN DO ~DestroySelf()~ EXIT
IF ~InParty("Korgan")~ THEN EXTERN KorganJ 123
END

And we want Vondo to interject into each of them. Code with I_C_T2 as you'd do:
Code: [Select]
I_C_T2 Minsc 0 minsc_0
== VondoJ IF ~InParty("Vondo")~ THEN ~Hi, Boo! I'm Vondo!~
END

I_C_T2 Minsc 1 minsc_1
== VondoJ IF ~InParty("Vondo")~ THEN ~Right!~
END

In both cases, we'd have the I_C_T2 warnings. State 0 doesn't have talker-affecting actions, while state 1 does.

State 0 can be painlessly transformed into I_C_T(1):
Code: [Select]
I_C_T Minsc 0 minsc_0
== VondoJ IF ~InParty("Vondo")~ THEN ~Hi, Boo! I'm Vondo!~
END

Whereas the State 1 interject will have to be deleted, moved to a different entry point, or restructured. There are two ways to restructure the dialogue: the first isn't mod compatible, whereas the second involves editing the interjection's dialogue (possibly touching other people's files):

The non-mod-compatible way is to use INTERJECT and manually copy the transitions at the end of the dialogue (using ActionOverride where needed):
Code: [Select]
INTERJECT Minsc 1 minsc_1
== VondoJ IF ~InParty("Vondo") THEN ~Right!~
IF ~~ THEN DO ~ActionOverride("Minsc",DestroySelf())~ EXIT
IF ~InParty("Korgan")~ THEN EXTERN KorganJ 123
END

The other way involves making sure the original speaker is the last one in the interjection as well:
Code: [Select]
I_C_T2 Minsc 1 minsc_1
== VondoJ IF ~InParty("Vondo")~ THEN ~Right!~
== Minsc IF ~InParty("Vondo")~ THEN ~Hell yeah!~
END

Note: the second solution was suggested by Jastey, see the discussion below.
« Last Edit: September 14, 2007, 09:47:23 AM by the bigg »
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

jastey*

  • Guest
Re: I_C_T vs __C_T2 revisited.
« Reply #2 on: September 14, 2007, 08:43:40 AM »
Quote
INTERJECT Minsc 1 minsc_1
== VondoJ IF ~InParty("Vondo") THEN ~Right!~
IF ~~ THEN DO ~ActionOverride("Minsc",DestroySelf())~ EXIT
IF ~InParty("Korgan")~ THEN EXTERN KorganJ 123
END

(Although correct coding-wise, I'd rather not see something like this. It's a superfluous mod-breaker for all other mods that would append to the dialogue state "Minsc 1". I know that's not the point of this discussion, but I felt like pointing it out nonetheless.)

-jastey

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs __C_T2 revisited.
« Reply #3 on: September 14, 2007, 09:03:42 AM »
Well, using I_C_T, while more mod-compatible, would get Vondo to DestroySelf() - and I'd prefer to skip a third-party interjection, rather than having a mod-breaking bug  ;)
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

jastey*

  • Guest
Re: I_C_T vs __C_T2 revisited.
« Reply #4 on: September 14, 2007, 09:36:08 AM »
Agreed, agreed, but since compatibility between mods is something that is thought important around here, I would still prefer seeing a workaround like:

I_C_T Minsc 1 minsc_1
== VondoJ IF ~InParty("Vondo") THEN ~Right!~
== Minsc ~Well then!~
END


(Again, I know this is not the purpose of this thread, but since compatibility between mods is a very important issue to me, I can't hold still. It just gives me the creeps if I see people copying the actions of the original dialogue state into their mod state, without using nifty things like COPY_TRANS, so I stating this here, hoping it will prevent others to do this mistake.)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs __C_T2 revisited.
« Reply #5 on: September 14, 2007, 09:43:59 AM »
Agreed, agreed, but since compatibility between mods is something that is thought important around here, I would still prefer seeing a workaround like:

I_C_T Minsc 1 minsc_1
== VondoJ IF ~InParty("Vondo") THEN ~Right!~
== Minsc ~Well then!~
END
Good point, I'll edit the above post.

However, since CMorgan is working on BG1NPC, I fear his hands are tied and he can't take advantage of this (since he'd be editing other's people dialogue, blah blah blah). OTOH, I don't believe that something like this happens in the original game.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

jastey*

  • Guest
Re: I_C_T vs __C_T2 revisited.
« Reply #6 on: September 14, 2007, 09:51:26 AM »
Bug-free coding goes for editorial rights, even for BG1NPC. :) (I should add, for me, something that potentially breaks other mods while there would have been a simple workaround is a bug.)

Quote
I don't believe that something like this happens in the original game
What exactly do you mean?

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs __C_T2 revisited.
« Reply #7 on: September 14, 2007, 09:54:45 AM »
What exactly do you mean?
That I don't think there are any places in the original game dialogs where we have two transitions with different actions, at least one of them being original-speaker specific. Of course, without actually testing this I can't be sure.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

jastey*

  • Guest
Re: I_C_T vs __C_T2 revisited.
« Reply #8 on: September 14, 2007, 09:58:04 AM »
Ah, OK. Thank you for adding my suggestion to your post. I'll stop hijacking this thread now.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: I_C_T vs __C_T2 revisited.
« Reply #9 on: September 14, 2007, 03:28:16 PM »
No, don't stop... I am finally getting it!!! And I really appreciate the patience, as I have had these things explained to me several times - I just am having some strange mental block between theoretical construct and practical application (which you folks have cleared up for me, I think ... ).

Since in all cases the dialogue is from the original BioWare speaker, I am going to I am going to split hairs and go for the "add dialogue" approach (and enlist outside help as well).

The "quick non-thinking" way is to decompile the dialogues and add an appropriate response to each of the 400 errors, using I_C_T. This means the widest compatibility, and the least thinking, but adds a bunch of (a little over 400) lines of commentary.

The "better, less intrusive and less wordy way" is to trace back which states popping the error incorporate indirect actions
Code: [Select]
IF ~~ THEN Minsc 0
SAY ~Hi, this is Boo!~
IF ~~ THEN DO ~ActionOverride("Edwin",LeaveParty())~ GOTO 1
IF ~InParty("Imoen")~ THEN EXTERN ImoenJ 123
END
as these can simply be moved straight to I_C_T with no additional dialogue change,

and add dialogue transferring back to the speaker to any state which pops the error message and has direct actions in the reply
Code: [Select]
IF ~~ THEN Minsc 1
SAY ~Right, Boo?~
IF ~~ THEN DO ~DestroySelf()~ EXIT
IF ~InParty("Korgan")~ THEN EXTERN KorganJ 123
END

I'll be right back with real life code, to make sure i am getting this correct:

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: I_C_T vs __C_T2 revisited.
« Reply #10 on: September 14, 2007, 04:30:42 PM »
OK. Here is my first example. Vanilla code, from EasyTutu, decompiled:
Code: [Select]
IF ~~ THEN BEGIN 29 // from: 34.1 27.2
  SAY #82753 /* ~I would have told the stories if you wished. We came from farther west than the light rises. The explorer chartered with us and we set to the seas. The elders speak of the great storm, though some say the storm came from within. We that belong were to be cast aside, and fought the explorers we did. Much was lost, but this island won. We live alone and are plagued by the beasts, but slaves to none and live as free.~ */
  IF ~~ THEN REPLY #82630 /* ~What do you mean when you say 'you belong?'~ */ DO ~AddJournalEntry(82639,QUEST)
~ GOTO 30
  IF ~~ THEN REPLY #82632 /* ~What happened to Balduran? It is his ship that supposedly wrecked here.~ */ DO ~AddJournalEntry(82635,QUEST)
~ GOTO 31
  IF ~~ THEN REPLY #82633 /* ~What happened on the ship that caused the wreck?~ */ DO ~AddJournalEntry(82636,QUEST)
~ GOTO 32
END

So, original behavior is to have two states with different journal entries. But, DO ~AddJournalEntry()~ can be done successfully by any character, right, so the I_C_T2 is wrong here, and it can be successfully moved directly to I_C_T with no problem:

Code: [Select]
I_C_T ~%tutu_scriptd%URLYLE1~ 29 X#CoranDur12
== ~%CORAN_JOINED%~ IF ~InParty("coran") InMyArea("coran") !StateCheck("coran",CD_STATE_NOTVALID) Global("P#CoranMatch","GLOBAL",1) !Global("P#CoranRomanceInactive","GLOBAL",1)~ THEN @32
END

Assuming the action AddJournal can be done by the interjector, this is good, becasue this results in the code
Code: [Select]
IF ~~ THEN BEGIN 29 // from: 34.1 27.2
  SAY #82753 /* ~I would have told the stories if you wished. We came from farther west than the light rises. The explorer chartered with us and we set to the seas. The elders speak of the great storm, though some say the storm came from within. We that belong were to be cast aside, and fought the explorers we did. Much was lost, but this island won. We live alone and are plagued by the beasts, but slaves to none and live as free.~ */
  IF ~~ THEN REPLY #82630 /* ~What do you mean when you say 'you belong?'~ */ DO ~AddJournalEntry(82639,QUEST)
~ GOTO 30
  IF ~~ THEN REPLY #82632 /* ~What happened to Balduran? It is his ship that supposedly wrecked here.~ */ DO ~AddJournalEntry(82635,QUEST)
~ GOTO 31
  IF ~~ THEN REPLY #82633 /* ~What happened on the ship that caused the wreck?~ */ DO ~AddJournalEntry(82636,QUEST)
~ GOTO 32
  IF ~Global("X#CoranDur12","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
Global("P#CoranMatch","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
~ THEN DO ~SetGlobal("X#CoranDur12","GLOBAL",1)~ EXTERN ~_CORANJ~ 97
END
and in _CORANJ
Code: [Select]
IF ~~ THEN BEGIN 97 // from:
  SAY #98444 /* ~How utterly *yawns* exci-i-i-ting... Excuse me, while I take a nap.~ */
  IF ~~ THEN REPLY #82630 /* ~What do you mean when you say 'you belong?'~ */ DO ~AddJournalEntry(82639,QUEST)
~ EXTERN ~_URLYLE1~ 30
  IF ~~ THEN REPLY #82632 /* ~What happened to Balduran? It is his ship that supposedly wrecked here.~ */ DO ~AddJournalEntry(82635,QUEST)
~ EXTERN ~_URLYLE1~ 31
  IF ~~ THEN REPLY #82633 /* ~What happened on the ship that caused the wreck?~ */ DO ~AddJournalEntry(82636,QUEST)
~ EXTERN ~_URLYLE1~ 32
END
and back in _URLYLE
Code: [Select]
IF ~~ THEN BEGIN 30 // from: 32.1 31.0 29.0
  SAY #82681 /* ~We belong. There is little more to it. if you were to stay, you would have to belong as well. We are a people that lives here as one. You are an outsider, as are the beasts. They are more obvious, but I think you are alike some ways. We have evil among our number alike, but we are respecting.~ */
  IF ~~ THEN REPLY #82632 /* ~What happened to Balduran? It is his ship that supposedly wrecked here.~ */ DO ~AddJournalEntry(82635,QUEST)
~ GOTO 31
  IF ~~ THEN REPLY #82633 /* ~What happened on the ship that caused the wreck?~ */ DO ~AddJournalEntry(82636,QUEST)
~ GOTO 32
  IF ~~ THEN REPLY #82637 /* ~I tire of tales. Take your ragged cloak and be gone.~ */ GOTO 28
END

IF ~~ THEN BEGIN 31 // from: 32.0 30.0 29.1
  SAY #82684 /* ~Balduran?! The explorer who shipped and collected, who would rather scuttle than free. The elders did not see his fate. None wished or cared. He can live among the beast for all that we care. We are better than they and he.~ */
  IF ~~ THEN REPLY #82630 /* ~What do you mean when you say 'you belong?'~ */ DO ~AddJournalEntry(82639,QUEST)
~ GOTO 30
  IF ~~ THEN REPLY #82633 /* ~What happened on the ship that caused the wreck?~ */ DO ~AddJournalEntry(82636,QUEST)
~ GOTO 32
  IF ~~ THEN REPLY #82637 /* ~I tire of tales. Take your ragged cloak and be gone.~ */ GOTO 28
END

IF ~~ THEN BEGIN 32 // from: 31.1 30.1 29.2
  SAY #82685 /* ~None are alive to tell. Ages have gone and the dead lay asleep. Tales are of no real truth, only symbols. We were bound, then we freed. Other's fought, but we live to grow. Beyond that is future, and none know that.~ */
  IF ~~ THEN REPLY #82632 /* ~What happened to Balduran? It is his ship that supposedly wrecked here.~ */ DO ~AddJournalEntry(82635,QUEST)
~ GOTO 31
  IF ~~ THEN REPLY #82630 /* ~What do you mean when you say 'you belong?'~ */ DO ~AddJournalEntry(82639,QUEST)
~ GOTO 30
  IF ~~ THEN REPLY #82637 /* ~I tire of tales. Take your ragged cloak and be gone.~ */ GOTO 28
END

But if any of these interjections had been directly into state 28,
Code: [Select]
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 DO ~TakePartyItem("_CLCK21")
SetGlobal("NotHelp","GLOBAL",1)
EraseJournalEntry(82745)
EraseJournalEntry(82747)
EraseJournalEntry(82748)
EscapeArea()
~ SOLVED_JOURNAL #82752 /* ~Durlyle's task
then the format would have to be

Code: [Select]
I_C_T ~%tutu_scriptd%URLYLE1~ 28 X#CoranDur2
== ~%CORAN_JOINED%~ IF ~InParty("coran") InMyArea("coran") !StateCheck("coran",CD_STATE_NOTVALID) Some More Conditions~ THEN @26 /* Yeah, whatever */
== ~%tutu_scriptd%URLYLE1~  IF ~InParty("coran") InMyArea("coran") !StateCheck("coran",CD_STATE_NOTVALID) Some More Conditions~ THEN @27 /* OK, don't let the door hit you on the way out. */
END

right?




« Last Edit: September 14, 2007, 04:55:42 PM by cmorgan »

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: I_C_T vs I_C_T2 revisited.
« Reply #11 on: September 14, 2007, 05:19:12 PM »
Quote
But if any of these interjections had been directly into state 28,
Principally, yes, but since here it is only one action after the SAY (not multiple reply options or actions), leaving it with I_C_T2 should be fine?

OK, I give up. Could someone explain to me once again when to use I_C_T and when I_C_T2? :'( I thought I_C_T2 gives back the actions to the original speaker, but can't be used for multiple actions/reply options? If so, I don't understand your example any more, the bigg (Would the code

"I_C_T2 Minsc 0 minsc_0
== VondoJ IF ~InParty("Vondo")~ THEN ~Hi, Boo! I'm Vondo!~
END"

in your example actually work?)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs I_C_T2 revisited.
« Reply #12 on: September 14, 2007, 05:30:10 PM »
CM: since state 28 in _URLYLE1 has a single transition, I_C_T2 is fine. If there were two transitions with conflicting actions, then you'd need the workaround.

Jas: I_C_T2 prints a warning if there are two different set of actions in the transition list, it doesn't fail outright. IIRC, it solves this by picking either the last or the first.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: I_C_T vs I_C_T2 revisited.
« Reply #13 on: September 14, 2007, 05:39:54 PM »
OK, but it fails in terms of "didn't do it correctly", meaning reply options / actions get lost. I think I see light again.

So: If there are multiple reply options, I_C_T2 can't be used; If the actions are speaker independent, I_C_T can be used without further concern; if there are multiple exits (that's the right term?), I_C_T has to be used with a return line. (Got it.)

(cmorgan: Not wanting to complictae things, but we have to be careful about interjections at points where a lot of NPCs are talking, and every interjection gives a line back to the original character.. But we have to see where this would apply to. )

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs I_C_T2 revisited.
« Reply #14 on: September 14, 2007, 05:47:44 PM »
IMHO, the rule of thumb (as opposed to what is actually stated in the readme) is:
Use I_C_T2 by default. If it prints warnings, then use I_C_T1 instead.
EDIT: Also, StartCutscene() (and maybe a couple of others) require I_C_T1 instead (since they need to be ran at the end of the dialogue).

Quote
So: If there are multiple reply options, I_C_T2 can't be used; If the actions are speaker independent, I_C_T can be used without further concern; if there are multiple exits (that's the right term?), I_C_T has to be used with a return line. (Got it.)
Not reply actions, but multiple (and different) actions.

Also, the right term is 'transition' (or, when talking about a CHAIN/INTERJECT/I_C_T*, epilogue).
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: I_C_T vs I_C_T2 revisited.
« Reply #15 on: September 14, 2007, 05:48:15 PM »
By george, I think I have it.

The above state 28 has *one* outcome IF ~~ THEN DO ~X~ EXIT in the actual state transitions.  So *THIS* exact example is what I_C_T2 was created for.

If it had more than one possible outcome, like

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 ~SetGlobal("MyGlobal","GLOBAL",1) EscapeArea()~
  IF ~SomeOtherCondition~ THEN DO ~TakePartyItem("_CLCK21") EscapeArea()~ SOLVED_JOURNAL #82752 /* ~Durlyle's task
  IF ~SomeCondition~ THEN DO ~EscapeArea()~ SOLVED_JOURNAL #82753 /* ~Durlyle's task not completed

then I would add the extra state as above and code it as I_C_T, so that the reply actions would pass through the added character, then back to the original speaker, and be accomplished.

(Told you I was having a mental block. Blaaaahhhhh!)


Many of the I_C_T2's  (Found 1032 I_C_T2s out of a total of 1261 occurrences of either I_C_T or I_C_T2 in 29 files in project, after moving all code to use the shortened format rather than long-form names) do not throw error messages, so are not a problem. And we know that the vast majority of these things "work" in the sense that no players report problems. But those 400 or so errors mean that at least some expected, coded behaviors are not being accomplished.

« Last Edit: September 14, 2007, 06:00:33 PM by cmorgan »

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: I_C_T vs I_C_T2 revisited.
« Reply #16 on: September 14, 2007, 05:51:51 PM »
And if it would be

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 ?

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs I_C_T2 revisited.
« Reply #17 on: September 14, 2007, 05:54:43 PM »
And if it would be

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 ?
"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).
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: I_C_T vs I_C_T2 revisited.
« Reply #18 on: September 14, 2007, 05:56:30 PM »
"has to be used"
Sorry, my "too" was referring to "I_C_T2 to be used for single action", not in the sense of "as well as I_C_T".
Thank you for clarification!

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: I_C_T vs I_C_T2 revisited.
« Reply #19 on: September 14, 2007, 06:07:43 PM »
I'm hanging out here for awhile with the thread open, to compare and contrast with decompiled code - I think I can get the number of times that a workaround is required way, way down. It does look like the original coders worked with the default "I_C_T2" for everything, and then selectively moved things back to I_C_T when a cutscene was not working, or hen something else resulted in an error.

Thank you both a great deal. I will try some repairs, and see how the resulting code decompiles.

Edit: In fact, I think I have the opposite - an example where we need to use a workaround (but it is already coded, by accident).

Code: [Select]
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()

The wrong use of I_C_T2, casuing the error,
Code: [Select]
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,
Code: [Select]
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.
« Last Edit: September 14, 2007, 06:19:15 PM by cmorgan »

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: I_C_T vs I_C_T2 revisited.
« Reply #20 on: September 14, 2007, 06:33:58 PM »
And a situation where things are messy...

of all of these:
Code: [Select]
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)

only one throws an error message:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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

Which has only one response.

But, I am assuming the error is not just in this state - one of the other I_C_T2s processed after ManyInt6 is picking up on the global automatically set to make an interjection play once. Each one of the ones on the list need to be

I_C_T with a pass-back dialogue state, in order to not interfere with the others being processed, right?

As a confirmation, every single one on the list already incorporates a "William is last speaker" line except one

Code: [Select]
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
.
« Last Edit: September 14, 2007, 06:38:31 PM by cmorgan »

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs I_C_T2 revisited.
« Reply #21 on: September 14, 2007, 06:49:47 PM »
Regarding the 'messy' post: it posts the warning pointing out which action is different (from a prior I_C_T2) rather than the current I_C_T2 being processed.
A fix (apart from using I_C_T1 and the go-back-to-original-speaker in each case) would be to recode them all as a giant I_C_T3/4:

Code: [Select]
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

Thanks to I_C_T4, you can code all of them as a giant chain-like construct (rather than splitting them up).
I_C_T4 leaves the actions to the original speakers (like I_C_T2), whereas I_C_T3 transfers the actions to the last speaker in the I_C_T chain.
Hence, with  I_C_T3 you need the back-to-original-speaker line like in I_C_T (they're currently commented out). You must make sure that in all chains the back-to-original is the last line.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: I_C_T vs I_C_T2 revisited.
« Reply #22 on: September 14, 2007, 07:08:58 PM »
That is absolutely so awesomely wicked cool...

and when I get to my own code this will do a safe and better way of mass interjecting, rather than breaking the original state and setting up a big separate CHAIN cloning the original transitions and terminations!!!!

For this project, I don't want to do the recode unless I have to, because it will mean resorting .tra files from the 10 separate sources, when I can bribe berelinde into adding one .tra line :) .  But I think I just found a massive set of interjections into the same state, where it is going to need to be redone this way in order to get it repaired (or lots of gratitous states will be needeed to play "catch" with the transitions). So I will definitely need to add a recode of several of these as I_C_T3 or I_C_T4 - this particular finding had all but one returning to the original, but many will not.

So, to make this a "jump into a state with multiple different transitions, with actions passed to the last speaker, playing tag":
Code: [Select]
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":
Code: [Select]
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

Gotta grab some dinner and feed the dogs, but wow - my brain is finally opening up to this . This is definitely fun.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: I_C_T vs I_C_T2 revisited.
« Reply #23 on: September 14, 2007, 09:09:02 PM »
Just to make sure I have this really down:

Original code:
Code: [Select]
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

Error report =
Code: [Select]
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()

is picking up that in one file we do this:
Code: [Select]
/* 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:
Code: [Select]
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

If we don't want to break up other mods, this has to be repaired by using I_C_T with passback, and making sure that all interjected states use ActionOverride, so that:

Code: [Select]
/* 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

Code: [Select]
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

right?

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: I_C_T vs I_C_T2 revisited.
« Reply #24 on: September 15, 2007, 05:21:51 AM »
Yes, moving all of them to I_C_T1 with callback is the easiest solution.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: