Posted by: domi_ash
« on: July 18, 2005, 03:40:08 PM »Quote
2) How do I make interjections?
Here is a small primer on interjections writting from this thread; There is also a tutorial on INTERJECT in WeiDU documentations by JC iirc: http://forums.gibberlings3.net/index.php?act=ST&f=62&t=2822&st=0#entry27965
Quote
Interjections in its simplest incarnation are CHAINs only "inserted" into the existing text.
Here is an example of a simple interjection and below is the explanation of what's going on:
Please, note, this example uses IsValidForPartyDialogue("Kivan") throughout. It is not a good command, use the combination of:
InParty(“Kivan”) !Dead(“Kivan”) !StateCheck("Kivan",STATE_SLEEPING)
INTERJECT_COPY_TRANS ~_KELDDA~ 0 X#KivanKeldath
== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Fair is your temple and full of hope, priest.~
== ~_KELDDA~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~And have you forsaken hope, my son?~
== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~I have hope but it lies beyond this plane, Keldath Ormlyr~
== ~_KELDDA~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Gaze upon the sun as it rises, elf. It is born anew every morn - here and everywhere in this world... on this plane. Rejoice, for you are blessed by its rays.~
END
INTERJECT_COPY_TRANS
that's the command that seeks out the specific "state" on the file named:
~_KELDDA~
Please, note that if you are interjecting after a STATE that has a single action woth one DO function after it, you should be using (ie a DO something and EXIT state)
INTERJECT_COPY_TRANS2
In SHORTHAND INTERJECT_COPY_TRANS will be I_C_T and guess what will I_C_T2 stands for?
And here is this state (or simply the number of the line after which you want to interject:
0
if you look into the _KELDDA.D you will see:
IF WEIGHT #3 /* Triggers after states #: 1 2 6 even though they appear after this state */
~True()
~ THEN BEGIN 0 // Here is your state number! IE, you will be asking to insert your lines after that particular phrase.
SAY #77961 /* ~Welcome! The traveling adventurer is never turned away from a house of Lathander, as we strive to aid all who make a difference in the Realms. If you are battle-worn we can extend a number of necromantic restorations, whatever your need. A small donation is all the compensation that we require. If you wish nothing then let me tell you of the madman Bassilus.~ */
//Here is where the shown code will stick in Kivan - Keldoth conversation
IF ~~ THEN REPLY #77962 /* ~What kind of aid can you give us?~ */ DO ~StartStore("_TEM3402",LastTalkedToBy(Myself))
~ EXIT
IF ~!Dead("bassilus")
~ THEN REPLY #77963 /* ~We don't require any help at the moment. ~ */ GOTO 8
IF ~Dead("bassilus")
~ THEN REPLY #77963 /* ~We don't require any help at the moment. ~ */ EXIT
END
X#KivanKeldath
simply the name of the interjection. They should be unique and start with your prefix, since WeiDU will transform it into a GLOBAL.
== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Fair is your temple and full of hope, priest.~
and here is the syntax - it is exactly the same as the CHAIN. Make sure that the condition IF-THEN is the same throughout. Please, note that traditionally J-files are used for handling interjections. All J file names are listed in PDIALOGUE.2DA file you can access via NI (in 2DA folder)
Where can you take the D files to look up their names (I already listed the states)?
It is done in a few stages:
1) open NI and find the CRE of the character which you interject with. F.ex: Elminster. You will find a bunch of CRE's for him; the ones that are from BG1 are the ones that have _ in front of them. Since I want to interject with Elminster in Chapter 3, I pick the _ELMIN3.CRE. When you open it up you will see that the dialogue assigned to him is _ELMIN3.DLG.
2) Write down the name of the dlg file.
3) open WeiDU. After the command line enter the command:
weidu _elmin3.dlg
the _elmin3.d will be created in the BG2 main folder.
EXTEND_BOTTOM
Is another useful command that allows you to add whatever you want after a STATE. For example, if I wanted to add PC replies after ~_KELDDA~ 0 it would look like:
EXTEND_BOTTOM ~_KELDDA~ 0
IF ~~ THEN REPLY ~Whatever~ EXIT
END
Other useful commands for D-files are:
ADD_TRANSACTION_TRIGGER
ADD_STATE_TRGGER
INTERJECT
JOURNAL
ADD_TRANS_ACTION
REPLACE_STATE_TRIGGER
Useful Reading:
Sim's Complete Scripting Guide (scripting!)
Ghreyfain's A Beginner's Guide to NPC Creation with WeiDU (explains file structure very well and gives simple examples of SAY dialogues)
Blue's and JC's Road to Banter (covers CHAIN in detail)
Japeth's State Weights (covers WEIGHTs)
JC's Another look at WEIGHTs (covers WEIGHTs)
Rastor's romance Authoring Tutorial (shows how to combine D and BAF to run a standard romance sequence with timered dialogues, dream scripts and flirts)
WeiDU Documentation (the bestselling mystery novel)