Posted by: Smoketest
« on: December 02, 2004, 08:34:16 PM »Thank you.
I could comment all of that out as I print it out, but (1) it would break syntax highlighting for the resulting file and (2) if you wanted a compile-able D file, wouldn't you just not specify --transitive?
A quick scan of GORODR1.D --transitive didn't show anything wrong -- can you point to a specific state number?
IF ~InPartySlot(LastTalkedToBy,0)
Global("zGarOdr1Job","GLOBAL",0)
Global("TalkedTozGarOdr1","GLOBAL",0)
Global("OdrenRitualDone","GLOBAL",0)~ THEN BEGIN 3 // from:
SAY #62356
IF ~~ THEN DO ~SetGlobal("TalkedTozGarOdr1","GLOBAL",1)~ EXTERN ~GORPOL1~ 0
END
IF ~~ THEN BEGIN GORPOL1 0 // from: (no mention of GORODR1:3.0)
SAY #62357
IF ~~ THEN EXTERN ~GORGAR1~ 0
END
IF ~~ THEN BEGIN GORGAR1 0 // from: (no mention of GORPOL1:0.0)
SAY #62358
IF ~~ THEN GOTO 4
END
IF ~~ THEN BEGIN 4 // from: GORGAR1:0.0
SAY #62360
IF ~~ THEN GOTO 5
END
IF ~~ THEN BEGIN 7 // from: 6.0 5.1 5.0
SAY #62373
IF ~~ THEN EXTERN ~GORPOL1~ 1
END
IF ~~ THEN BEGIN GORPOL1 1 // from: (no mention of GORODR1:7.0)
SAY #62374
IF ~True()~ THEN GOTO 8 // (no mention of target DLG; GORODR1 8)
IF ~IsValidForPartyDialog("Cernd")
GlobalGT("Chapter","GLOBAL",7)~ THEN EXTERN ~CERND25J~ 6
IF ~IsValidForPartyDialog("Keldorn")
GlobalGT("Chapter","GLOBAL",7)~ THEN EXTERN ~KELDO25J~ 8
IF ~IsValidForPartyDialog("Anomen")
GlobalGT("Chapter","GLOBAL",7)~ THEN EXTERN ~ANOME25J~ 28
END
IF ~~ THEN BEGIN ANOME25J 28 // from: GORGAR1:3.0 (should be GORPOL1:1.3)
SAY #70518
IF ~~ THEN GOTO 8 // (no mention of target DLG; GORODR1 8)
END
IF ~~ THEN BEGIN KELDO25J 8 // from: KELDO25J:8.0 ANOME25J:28.0 GORPOL1:1.0 GORPOL1:1.0 (? incorrect references, a duplication, and the wrong transition number in GORPOL1; should be GORPOL1:1.2)
SAY #70519
IF ~~ THEN GOTO 8 // (no mention of target DLG; GORODR1 8)
END
IF ~~ THEN BEGIN CERND25J 6 // from: 5.2 (should be GORPOL1:1.1)
SAY #70520
IF ~~ THEN GOTO 8 // (no mention of target DLG; GORODR1 8)
END
IF ~~ THEN BEGIN 8 // from: CERND25J:6.0 KELDO25J:8.0 ANOME25J:28.0 GORPOL1:1.0 GORPOL1:1.0 (duplicated GORPOL1 reference)
SAY #62375
IF ~~ THEN GOTO 9
END
To be really correct it would need to be two passes, which would slow things down by, perhaps, 30 percent.
If people want accurate from comments I can try to code that up.
IF ~InPartySlot(LastTalkedToBy,0)
Global("zGarOdr1Job","GLOBAL",0)
Global("TalkedTozGarOdr1","GLOBAL",0)
Global("OdrenRitualDone","GLOBAL",0)~ THEN BEGIN 3 // from:
SAY #62356 /* ~Ah! The Child of Bhaal has come! We had hoped that our call for aid would draw you here...praise to the Watcher for hearing our prayers!~ [ODREN10] */
IF ~~ THEN DO ~SetGlobal("TalkedTozGarOdr1","GLOBAL",1)~ EXTERN ~GORPOL1~ 0
END
/* comment begins here; externed dialogs begin
IF ~~ THEN BEGIN GORPOL1 0 // from:
SAY #62357 /* ~Praise be to Helm!~ */
IF ~~ THEN EXTERN ~GORGAR1~ 0
END
IF ~~ THEN BEGIN GORGAR1 0 // from:
SAY #62358 /* ~Does this mean we have a chance, Odren? Does this mean our duty is not lost to us?~ */
IF ~~ THEN GOTO 4
END
*/ // comment ends here; Odren's dialog continues
IF ~~ THEN BEGIN 4 // from: GORGAR1:0.0
SAY #62360 /* ~Be at peace, Sister Garlena. <CHARNAME> has yet to hear our story, let alone agreed to aid us. We get ahead of ourselves, here.~ */
IF ~~ THEN GOTO 5
END
Also notice that GORGAR1's state didn't display GORPOL1's externing transition info in the 'from' list. and GORPOL1 doesn't show the link from GORODR1 3.0. Not critical perhaps, but it would be nice for completeness.I'm forced to admit that I don't really understand what you guys are doing with this or why you want it, but I have coded it up anyway. Look for it in the next WeiDU.
WHILE (("%noloop%" = 0) AND (("%dual1%" BAND 0b00100000) = 0b00100000)) BEGIN //?C or C? from C
WHILE (("%noloop%" = 0 ) AND ("%class%" = 8)) BEGIN //FC from C
SET "level1" = ("%level1%" <= "%level2%") ? 0 : ("%level1%" - "%level2%")
SET "firstlast" = ("%level2%" >= "%firstlast%") ? 0 : ("%firstlast%" - "%level2%")
SET "noloop" = 1
END
WHILE (("%noloop%" = 0 ) AND (("%class%" = 14) OR ("%class%" = 15))) BEGIN //CM or CT from C
SET "level2" = ("%level2%" <= "%level1%") ? 0 : ("%level2%" - "%level1%")
SET "secondlast" = ("%level1%" >= "%secondlast%") ? 0 : ("%secondlast%" - "%level1%")
SET "noloop" = 1
END
SET "noloop" = 1
END
Its meaning was to store how the HPs are calculated in dual classes, for the purpose of maxing them. The problem with cleric to something is that the cleric class is sometimes in the first "level" field, sometimes in the second one, so different calculations are needed. PATCH_IF (("%dual1%" BAND 0b00100000) = 0b00100000) THEN BEGIN //?C or C? from C
PATCH_IF ("%class%" = 8) THEN BEGIN //FC from C
SET "level1" = ("%level1%" <= "%level2%") ? 0 : ("%level1%" - "%level2%")
SET "firstlast" = ("%level2%" >= "%firstlast%") ? 0 : ("%firstlast%" - "%level2%")
END ELSE BEGIN
SET "level2" = ("%level2%" <= "%level1%") ? 0 : ("%level2%" - "%level1%")
SET "secondlast" = ("%level1%" >= "%secondlast%") ? 0 : ("%secondlast%" - "%level1%")
END
END
This is both faster to write and loops are much less probable.I was looking through the WeiDU documentation and was surprised to find, that while there are the actions ADD_STATE_TRIGGER and ADD_TRANSITION_TRIGGER, there is no corresponding action to add stateActionStrings to existing dialog states. Would it be possible to have an action (called eg. ADD_ACTION_TEXT) that would enable us to add stateActionStrings to the DO blocks of existing states.
The purpose I personally would need this for is to add a SetGlobal() command into a state in Anomen's banter file in order to track whether a given banter has occurred or not. I would guess that the action would be useful mostly in these kinds of situations, ie. tracking whether an originally "unimportant" conversation has been had by an NPC in order to enable a banter or forcetalk option that is a reaction to that conversation.
Any chances of such an action being added to WeiDU?
DECOMPILE_BCS_SCRIPT and so on is way, way better than REPLACE_BCS_BLOCK ever was.