Author Topic: Doublechecking available WeiDU manipulation in .d  (Read 7741 times)

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Doublechecking available WeiDU manipulation in .d
« on: January 26, 2010, 11:30:13 AM »
Hey, I think I can do this within .d files to compile, looking at the docs... am I misreading? (Would test but am at work and unable to)

.tp2
Code: [Select]
COMPILE ~myFile.d~

myFile.d
Code: [Select]
ACTION_IF FILE_EXISTS_IN_GAME ~C-ARANJ.DLG~ THEN BEGIN

  APPEND ~C-ARANJ~
  blah
  END

END

ACTION_IF FILE_EXISTS_IN_GAME ~C-ARN25J.DLG~ THEN BEGIN

  APPEND ~C-ARN25J~
  blah
  END

END

I know I can break it up this way in the .tp2 and use small individual files, but I am seeing how close I can get to creating dialog  in one big file. (I know, silly. But fun.)

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #1 on: January 26, 2010, 03:54:40 PM »
Code: [Select]
APPEND IF_FILE_EXISTS c-aranj
blah
END

APPEND IF_FILE_EXISTS c-arn25j
blah
END
I thought you were the dialogue expert (I'm certainly not) but I just did that sort of syntax in the last Aurora and it seemed to work (well it compiled anyway).

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Doublechecking available WeiDU manipulation in .d
« Reply #2 on: January 26, 2010, 05:20:47 PM »
Cheers!

Problem is, I forget the more unused stuff - not many folks do manipulation like this in .d. Part of that is just content management (is that ToB? Then add these files in - if not, use thses files), and part of that is allowing component choice (do you want to install the ToB lovetalks, or just the friendtalks?).  Even crossmod breaks it all down into little files and uses .tp2 manipulation.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Doublechecking available WeiDU manipulation in .d
« Reply #3 on: April 02, 2010, 11:16:49 AM »
Hmmm. Well I need to go look at your mod again, then. I just tried a compile for fun, using (within the .d)


Code: [Select]


APPEND BANOMEN

IF ~~ c-aranisdeadman
  SAY ~[ANOMEN] Indeed, I have seen the way his eyes devour you. My lady, I would gladly teach the cur his place among us, if you would let me be your Champion.~
  ++ ~[PC] Do you respect me so little that you would question my judgement? I have already chosen, and it is not you.~ + c-anomendumped
  + ~Global("c-aransex","GLOBAL",1)~ + ~[PC] I need no knight, Anomen, and I am afraid I have given Aran a good deal more than a token or favor. I am sorry, but I cannot return your affection. We should just be friends.~ + c-anomendumped
  + ~!Global("c-aransex","GLOBAL",1)~ + ~[PC] I need no knight, Anomen, and I am afraid I have fallen for Aran. I am sorry, but I cannot return your affection. We should just be friends.~ + c-anomendumped
  ++ ~[PC] You flatter me with your attentions, Anomen. But I love someone else. Could you not see this as a gesture of Courtly Love, and serve me chastely, loving from afar?~ + c-anomendumped
END

IF ~~ c-aranisnotworthy
  SAY ~[ANOMEN] The sellsword is not worthy of you. I would gladly serve you as Champion and Protector, sworn to your side. May I hope that you might change your mind?~
  ++ ~[PC] Do you respect me so little that you would question my judgement? I have already chosen, and it is not you.~ + c-anomendumped
  + ~Global("c-aransex","GLOBAL",1)~ + ~[PC] I need no knight, Anomen, and I am afraid I have given Aran a good deal more than a token or favor. I am sorry, but I cannot return your affection. We should just be friends.~ + c-anomendumped
  + ~!Global("c-aransex","GLOBAL",1)~ + ~[PC] I need no knight, Anomen, and I am afraid I have fallen for Aran. I am sorry, but I cannot return your affection. We should just be friends.~ + c-anomendumped
  ++ ~[PC] You flatter me with your attentions, Anomen. But I love someone else. Could you not see this as a gesture of Courtly Love, and serve me chastely, loving from afar?~ + c-anomendumped
END

IF ~~ c-anomendumped
  SAY ~[ANOMEN] My heart breaks with this news. I... I love you, <CHARNAME>, and it afflicts me to see you in another man's arms. But I will serve in what way you will allow. It is better to bear the pain now then to fight a hopeless cause.~
  IF ~~ THEN DO ~SetGlobal("AnomenRomanceActive","GLOBAL",3) RestParty()~ EXIT
END

END

ACTION_IF FILE_EXISTS_IN_GAME ~ar6111.are~ THEN BEGIN // ToB


/* ToB Interjections and commentary */

/* Joinables */

I_C_T BAERIE25 157 c-arn25bae157 /* It's a boy!  Oh, what a beautiful son we have - look at him wiggle his toes! */
== ~C-ARN25J~ IF ~Global("c-silencearan","GLOBAL",0) InParty("c-aran") InMyArea("c-aran") !StateCheck("c-aran",CD_STATE_NOTVALID)~ THEN ~[ARAN] That be a nice sight, there, Aerie. Congratulations. Just watch out where he points that other 'finger', eh? An' I might suggest a bit o' cloth, for when he gets an urge to... heh. Too late.~
END

and got

Quote
[aranw/c-arandialog.d] PARSE ERROR at line 516 column 1-9
Near Text: ACTION_IF
   syntax error

[aranw/c-arandialog.d]  ERROR at line 516 column 1-9
Near Text: ACTION_IF
   Parsing.Parse_error
ERROR: parsing [aranw/c-arandialog.d]: Parsing.Parse_error
ERROR: compiling [aranw/c-arandialog.d]!
Stopping installation because of error.

Unless I am doing something really silly.

The quickest way around it is to manipulate in the .tp2, so it is no big deal. I just need to test a bit and see if those work, so that I know.

Offline Mike1072

  • Planewalker
  • *****
  • Posts: 298
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #4 on: April 02, 2010, 11:41:24 AM »
D commands and TP2 commands are completely separate and cannot be used in place of one another.  The best way to figure out what options you have available to you is really to just read through the appropriate sections of the WeiDU readme.  I'd really recommend this to any modder who wants to do something but isn't completely familiar with the way to go about doing it.  You'll learn about commands you never knew existed.

I can't offer any specific help because I am not up-to-speed on the available D commands, but if I were trying to do something similar to what you are, I'd follow the same advice I gave above.  You'll probably find out that there either is a way to do what you want with D commands, or there isn't, and you'll have to use TP2 commands combined with your dialogue files.

Quote
I know I can break it up this way in the .tp2 and use small individual files, but I am seeing how close I can get to creating dialog  in one big file. (I know, silly. But fun.)
You could do this using inlined files.  You can stick as many separate .d (or other) files as you like into a single file, and then perform any TP2 commands you want with them.  You'd probably want to keep this file apart from your mod's main .tp2 and then INCLUDE it.

Offline berelinde

  • Planewalker
  • *****
  • Posts: 1188
  • Gender: Female
    • Gavin, cleric of Lathander, for Tutu
Re: Doublechecking available WeiDU manipulation in .d
« Reply #5 on: April 02, 2010, 03:24:41 PM »
Don't know what you find entertaining, but I hate digging through a huge file looking for one little thing.

Here's what *will* happen. You'll get a bug report saying that "Aran's trying to talk to me and all I'm getting is PID. Anomen just said something, so maybe it's some kind of reaction to that." No direct quotes, not even a clear paraphrase. If you've got your stuff in separate dialogue files, all you have to do is open up the one with NPC/NPC rections and finding it won't be too bad even without stellar reporting. If you've got all your stuff in one file, digging through 6 separate Anomen reactions, 18 PC/NPC talks, a couple hundred interjections, and several dozen banters is going to be a real drag.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Doublechecking available WeiDU manipulation in .d
« Reply #6 on: April 02, 2010, 06:52:08 PM »
Right, Mike1072, I understand, and have gone through them before, but I remember when we went through the parser rules, there were actions that were undocumented that allowed file manipulation within .d

For v210, dlexer.mll + dparser.mly

ADD_STATE_TRIGGER
A_S_T
ADD_TRANS_ACTION
ADD_TRANS_TRIGGER
A_T_T
ALTER_TRANS
TRIGGER
ACTION
REPLY
EPILOGUE
APPEND
APPENDI
APPEND_EARLY
BEGIN
BRANCH
CHAIN
CHAIN2
CHAIN3
COPY_TRANS
COPY_TRANS_LATE
DO
END
EQUALS
EQUALSEQUALS
EXTEND
EXTEND_BOTTOM
EXTEND_BOTTOM_REGEXP
EXTEND_TOP
EXTEND_TOP_REGEXP
EXTERN
EXIT
FLAGS
GOTO
IF
IF_FILE_EXISTS
INTERJECT
INTERJECT_COPY_TRANS
I_C_T
INTERJECT_COPY_TRANS2
I_C_T2
INTERJECT_COPY_TRANS3
I_C_T3
INTERJECT_COPY_TRANS4
I_C_T4
JOURNAL
PLUS
REPLACE
REPLACE_ACTION_TEXT
R_A_T
REPLACE_ACTION_TEXT_PROCESS
REPLACE_ACTION_TEXT_PROCESS_REGEXP
R_A_T_P_R
REPLACE_ACTION_TEXT_REGEXP
REPLACE_SAY
REPLACE_STATE_TRIGGER
R_S_T
REPLACE_TRIGGER_TEXT
R_T_T
REPLACE_TRIGGER_TEXT_REGEXP
REPLACE_TRANS_ACTION
REPLACE_TRANS_TRIGGER
REPLY
SAY
SET_WEIGHT
SOLVED_JOURNAL
STRING_CONCAT
THEN
UNSOLVED_JOURNAL
WEIGHT
EOF

all seem to be looked at -


wait a sec. ACTION_IF is not on that list.

I bet the syntax is


ACTION IF_FILE_EXISTS ~ar6111.are~

<<do .d stuff like all the ToB stuff>>

END

I will play around some more.  I remember some reason that required multiple .d in bg1npc, too, other than this, that might stop a 100% in one file. (Which can be worked around too by .tra manipulation into a single set of references in one file and then adding USING )

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #7 on: April 02, 2010, 06:59:59 PM »
Like Miloch said in the first response, IF_FILE_EXISTS is valid constraints (it's not an action).

It's up to you to figure if it works with I_C_T, however.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Doublechecking available WeiDU manipulation in .d
« Reply #8 on: April 02, 2010, 08:28:32 PM »
Bleh. I missed that distinction completely.

I wonder what ACTION actually does in the .d setting? Monday night's quest, I think :)


(Yep, berelinde, I think you are right on that. I really want to get one big translation file, but I think the most manageable way to do it is smaller files. I am just poking about in the corners to see what is possible, rather than practical.)
« Last Edit: April 02, 2010, 08:31:03 PM by cmorgan »

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #9 on: April 02, 2010, 09:49:25 PM »
It's a transition structure keyword (to instruct ALTER_TRANS which property of the specified transition to modify).

Offline Mike1072

  • Planewalker
  • *****
  • Posts: 298
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #10 on: April 02, 2010, 10:15:35 PM »
devSin knows all the fancy words.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Doublechecking available WeiDU manipulation in .d
« Reply #11 on: April 02, 2010, 10:27:55 PM »
 8) I should have done better research -

http://www.weidu.org/~thebigg/README-WeiDU.html#htoc18

... what is really an indication of my approaching senility is i am one of the few folks who has actually used ALTER_TRANS outside of Fixpack folks. That's what I hate about doing this in bits and pieces. I have to remember the details!

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #12 on: April 02, 2010, 11:17:15 PM »
devSin knows all the fancy words.
I was actually going to go back and cut it way down, but I forgot, sorry.

So go get a job if you're tired of eating at word soup kitchen. :P

... what is really an indication of my approaching senility is i am one of the few folks who has actually used ALTER_TRANS outside of Fixpack folks.
Truly, I think Qwinn is the only one to use it. Maybe Miloch now that he seems to have gone nuts with code. But it didn't exist when most of the BG2 fixpack was done, so I don't know much about it beyond seeing it in PST fixpack.
« Last Edit: April 02, 2010, 11:54:58 PM by devSin »

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #13 on: April 05, 2010, 12:38:03 PM »
I don't do a whole lot with .d either, but I_C_T IF_FILE_EXISTS should work according to the docs ("behaves like INTERJECT... behaves like CHAIN... If the entryFilename file is missing and there is IF_FILE_EXISTS, the whole CHAIN [INTERJECT] is not compiled").

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #14 on: April 05, 2010, 12:40:56 PM »
docs != reality. ALWAYS refer to the source.
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 Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #15 on: April 05, 2010, 12:45:55 PM »
I don't read French, or OCaml or whatever. If it don't work with INTERJECT/ICT, it's a WeiDU bug ;D.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Doublechecking available WeiDU manipulation in .d
« Reply #16 on: April 05, 2010, 01:26:39 PM »
So the check for this behavior is to build some wild construction in .d like

I_C_T3 (IF_FILE_EXISTS ~c-aranj.dlg~ AND IF_FILE_EXISTS ~b!gavj.dlg~) BAERIE25 157
== ~C-ARN25J~ IF ~Global("c-silencearan","GLOBAL",0) InParty("b!gavin2") InMyArea("b!gavin2") !StateCheck("b!gavin2",CD_STATE_NOTVALID) InParty("c-aran") InMyArea("c-aran") !StateCheck("c-aran",CD_STATE_NOTVALID)~ THEN ~[ARAN] That be a nice sight, there, Aerie. Congratulations. Just watch out where he points that other 'finger', eh? An' I might suggest a bit o' cloth, for when he gets an urge to... heh. Too late. Gavin, you done got experience in this area... lend us a hand , or a cloth, or somethin', eh?~
END

CHAIN (IF_FILE_EXISTS ~ar6111.are~) IF ~conditions~ THEN ~c-arn25j~ statename
~[ARAN] Hey, this is a new state on the ToB joined file. It is showing up because if_file_exists works within a chain, so we could write soa and tob materials in the same .d file if we wanted.~
== ~C-ARN25B~ ~[ARAN] And this is a new state on the ToB banter file.~
== ~C-ARN25P~ ~[ARAN] And this is a new state on the ToB post file.~
EXIT

I will recheck docs and this thread before running the test tonight. I may have abandoned the idea for now, but it would be nice to know if it works.

(Yes, I know there are much better ways of coding this - crossmod with berelinde could handle the I_C_Ts even without goint to true crossmod, because WeiDu and the game don't choke on missing DVs - but I am making sure Crossmod folks could actually check at the .d level)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #17 on: April 05, 2010, 01:42:54 PM »
Oooooook, looks like IFE should be added to INTERJECT and INTERJECT_COPY_TRANS* prologues.

EDIT: gitted but not compiled to beta.
« Last Edit: April 05, 2010, 02:06:46 PM 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).

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #18 on: April 05, 2010, 02:11:47 PM »
So the check for this behavior is to build some wild construction in .d like
Well you've reached the depths of my (rather shallow) knowledge, since I've only used it as in the first example. No clue whether you can use .d IF_FILE_EXISTS with ANDs and file extensions like you could in .tp2 code. But you could probably do most if not all your checks using just .dlg files anyway (and thus leave the extensions off, since that's the syntax that worked for me).

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Doublechecking available WeiDU manipulation in .d
« Reply #19 on: April 05, 2010, 04:09:12 PM »
Hey, the bigg, not necessarily - in fact, I say "don't do it!"

It would be better to leave this territory uncharted, if it does not work that way now. We could just change the docs, and say "does not work like INTERJECT".  It would be far better to say "don't do this", then create new structures that will confuse and mislead people, when we already have clear, simple, explainable behavior -

.tp2 = file manipulation
.d = dialog manipulation

.tp2 calls one file for SoA
.tp2 calls separate file for ToB,  uses A_I F_E_I_G

I think this exploration is better off *not8 proceeding down that road, or you will get messed around with and get thinsg like

.d
Code: [Select]
I_C_T3 (IF_FILE_EXISTS ~c-aranj.dlg~) AND ( IF_FILE_EXISTS ~b!gavj.dlg~) DO  BAERIE25 157 newstate
ELSE
(IF_FILE_EXISTS ~c-aranj.dlg~) BUT NOT  ( IF_FILE_EXISTS ~b!gavj.dlg~) DO   BAERIE25 157 newstate2
END

or much, much worse -

let's bail on this whole idea.

The entry

CHAIN  [ IF  [ WEIGHT  #weight  ] stateTriggerString  THEN  ] [ IF_FILE_EXISTS  ] entryFilename entryLabel chainText   list chainEpilogue

and

 [ ==  [ IF_FILE_EXISTS   ] fileName  [ IF transTriggerString  THEN  ] sayText = sayText  ...  ]


would need to be changed, is all. And the EXTERN docs, too. I have never seen this construction used, at all - most folks are much happier manipulating up at the .tp2 level, for a ton of reasons. The only reason to suipport it is to help people consolidate things into one file, and we don't need to do that.

 But if it turns out it needs to be used, my form above is wrong anyways... it should be in another order, and it looks like it only checks for the first file called. So

CHAIN
IF
WEIGHT #-1  ~Global("c-silencearan","GLOBAL",0) InParty("b!gavin2") InMyArea("b!gavin2") !StateCheck("b!gavin2",CD_STATE_NOTVALID) InParty("c-aran") InMyArea("c-aran") !StateCheck("c-aran",CD_STATE_NOTVALID)~ THEN
IF_FILE_EXISTS ~b!GavJ~ mynewstate
~[GAVIN] Err... don't put words in my mouth.~
== ~C-ARN25J~ IF ~Global("c-silencearan","GLOBAL",0) InParty("b!gavin2") InMyArea("b!gavin2") !StateCheck("b!gavin2",CD_STATE_NOTVALID) InParty("c-aran") InMyArea("c-aran") !StateCheck("c-aran",CD_STATE_NOTVALID)~ THEN ~[ARAN] well, this is alot of mess for no gain. Let's call this crap a dead fish, drop it, an' run for th' nearest bar. After all, this is better done with a series of CHAIN or I_C_T that are screened at the .tp2 level.~
END
« Last Edit: April 05, 2010, 04:27:29 PM by cmorgan »

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #20 on: April 05, 2010, 04:13:55 PM »
Hey, the bigg, not necessarily - in fact, I say "don't do it!"
Too late.
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: Doublechecking available WeiDU manipulation in .d
« Reply #21 on: April 05, 2010, 04:32:57 PM »
OK. If it is done, when you get it set up, please run out a windows beta and I will test out the

CHAIN IF_FILE_EXISTS
INTERJECT IF_FILE_EXISTS
I_C_T IF_FILE_EXISTS
I_C_T2 IF_FILE_EXISTS
I_C_T3 IF_FILE_EXISTS
==  IF_FILE_EXISTS


Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #22 on: April 05, 2010, 04:39:25 PM »
run out a windows beta
Already done. However, no need to test it - all but INTERJECT IFE and ICT* IFE have been in for more than four years, and even those were just disabled in the grammar, but enabled in code.

Now I'll go feel old in that corner
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: Doublechecking available WeiDU manipulation in .d
« Reply #23 on: April 05, 2010, 05:39:50 PM »
Aaaahhh.... I understand. (Don't feel old - feel accomplished, seasoned, veteran, well-trained, ready for the Big Show, expert, versatile,  or anything but old - because if you, my friend, are old, then I am dust.)

Just to be sure, the way I understand current syntax, the IF_FILE_EXISTS within .d looks only for the single target file which is also the initial file at the start, or the garget file anywhere else down the chain. So, instead of all those stupid
 ( I_F_E ~file1~ ) AND !(  I_F_E ~file2~ ) things are garbage to be thrown out - the synatx woks as


CHAIN
IF
WEIGHT #-1
 ~
InParty("b!gavin2")
 InMyArea("b!gavin2")
 !StateCheck("b!gavin2",CD_STATE_NOTVALID)
 InParty("c-aran")
 InMyArea("c-aran")
 !StateCheck("c-aran",CD_STATE_NOTVALID)
~ THEN

IF_FILE_EXISTS ~b!GavJ~
my_new_state_with_Gavin_if_he_is_installed

~[GAVIN] Err... don't put words in my mouth.~

== ~C-ARN25J~ ~[ARAN] OK, I will anyways.~

== IF_FILE_EXISTS ~B!HALDJ~ IF ~IsValidForDialog("b!haldimir'sDV")~ THEN ~[HALDAMIR] Hey, I am installed on this game too? I was hoping for an IWD cameo, instead.~

==  ~C-ARN25J~ IF ~IsValidForDialog("b!haldimir'sDV")~ THEN  ~[ARAN] OK, I am commenting to Haldamir. But I can't check to see if he is present. But luckily, WeiDu does not throw a parse error over non-existent DVs.~

END
IF ~InParty("c-aran")~ THEN EXTERN ~C-ARANJ~  state_in_Aran
IF ~InParty("b!haldimir'sDV")~ THEN EXTERN IF_FILE_EXISTS ~B!HALDJ~ state_in_haldimir


would be the syntax, because the IF_FILE_EXISTS is used as both the target file for testing if the file is present, and for setting up what file is modified - it looks like that from the thread you linked.


If this is the case, then Crossmod folks could really work up any "multiple I_C_Ts or CHAINs about a single event" into a single CHAIN. That might help them. But for an individual modder, the Crossmod stuff still trumps, because it is designed to go at the end of all NPCs - if someone used the Aran + Gavin = Haldimir stuff, none of the material would show as Aran wouldn't be a ble to detect and adapt post-install (obvious, but i am pointing it out for anyone following up on future searches/research...)


Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: Doublechecking available WeiDU manipulation in .d
« Reply #24 on: April 05, 2010, 06:50:36 PM »
Ah, so is that how we got 4 variants of I_C_T? (Dunno really what the first does, let alone the other 3 versions...)

As far as crossmod, that is indeed what I used it for in Aurora (e.g., only does the APPEND if Fade's dialogue exists) since the Crossmod folks lied to me about when a new release would be out. But it seems that's what it's intended for anyway...

 

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)?: