WeiDU parsing: issue with require_predicate or component
Abdel_Adrian
Member Posts: 430
I'm trying to link certain components with ADD_KIT that are necessary for the custom kit. I'd like to install these components only if the kit was installed, but the way it's set up right now, these files will be added regardless of whether or not the kit was added. I get parsing issues if I try to add lines (i.e. COPY ~whatever~ ~override~) between BEGIN and END of ADD_KIT.
I'm trying something like:
BEGIN ~X~
SUBCOMPONENT ~Y~
REQUIRE_PREDICATE ~Z~
But this is where I'm lost. I don't know how to use REQUIRE_PREDICATE (or COMPONENT) other than for GAME_IS, and I'd really like these components to always install with the kit and not give a choice, seeing as they're necessary for the kit to work.
How do I use WeiDU to check if a component is installed and then automatically install a corresponding component? Thanks!
P.S. I've got Bladesinger and Priestess of Lloth kits complete now, just need to polish them up before release. I really appreciate any help.
Edit: not sure if I got it or not.
I used:
ACTION_IF FILE_EXISTS ~override/EMCLABLL.2da~
THEN BEGIN
I'm just not sure if ADD_KIT adds the custom CLAB file that you indicate the class should use.
I'm trying something like:
BEGIN ~X~
SUBCOMPONENT ~Y~
REQUIRE_PREDICATE ~Z~
But this is where I'm lost. I don't know how to use REQUIRE_PREDICATE (or COMPONENT) other than for GAME_IS, and I'd really like these components to always install with the kit and not give a choice, seeing as they're necessary for the kit to work.
How do I use WeiDU to check if a component is installed and then automatically install a corresponding component? Thanks!
P.S. I've got Bladesinger and Priestess of Lloth kits complete now, just need to polish them up before release. I really appreciate any help.
Edit: not sure if I got it or not.
I used:
ACTION_IF FILE_EXISTS ~override/EMCLABLL.2da~
THEN BEGIN
I'm just not sure if ADD_KIT adds the custom CLAB file that you indicate the class should use.
Post edited by Abdel_Adrian on
0
Comments
From what you said before the spoiler though, it seems like all the lines of COPY are already attached to the kit, I just don't think every component is at the moment. I think I can figure it out now.
BEGIN ~component name~
REQUIRE_COMPONENT ~relative_path_to/mymod.tp2~ ~320~ ~message if the component cannot be installed~
See the weidu doc - chapter 9.
THEN BEGIN
I'm going to try placing the COPY lines within ADD_KIT after the last SAY, like subtledoctor suggested, just haven't done so yet, but there are a few more complex lines that may not be as simple.
If both your kit and the related copied files are in the same component then follow @subtledoctor example, the additional files (your copy commands) will not be installed if the component fails, weidu will rollback every command of that component.
If for some reasons you want to test the presence of the kit in another component you can either detect a particular file, a preset variable or use a variation of the third example: ACTION_IF or PATCH_IF (MOD_IS_INSTALLED ~relative_path_to/mymod.tp2~ ~component-number as seen in the weidu.log~).
This is what I have right now for one of my kits, I haven't done enough testing to be sure it's doing exactly what I want, but it seems to be installing every part of the kit, all the COPY lines, and the EE functions:
REQUIRE_PREDICATE GAME_IS ~bgee bg2ee iwdee~ @25
INCLUDE ~Bladesinger/lib/fl#add_kit_ee.tpa~
ADD_KIT ~PRIEST_LLOTH~ /* this is the "internal" name of your kit, like BERSERKER or LATHANDER */
~PRIEST_LLOTH 0 0 1 1 0 1 0 0~ /* this line is appened to CLASWEAP.2DA */
~PRIEST_LLOTH 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~ /* this string is appened column-wise to WEAPPROF.2DA, starting with the third line*/
~PRIEST_LLOTH 3 7 6 8 9 8~ /* this line is appened to ABCLASRQ.2DA */
~PRIEST_LLOTH 0 1 0 1 0 -2~ /* this line is appened to ABCLSMOD.2DA */
~PRIEST_LLOTH 17 17 17 17 0 0~ /* this line is appened to ABDCDSRQ.2DA */
~PRIEST_LLOTH 15 15 15 15 0 0~ /* this line is appened to ABDCSCRQ.2DA */
~PRIEST_LLOTH 0 0 0 0 0 0 0 0 1~ /* this line is appened to ALIGNMNT.2DA */
~PRIEST_LLOTH 0 0 0 0 0 0~ /* this line goes to DUALCLAS.2DA */
~Bladesinger/2DA/EMCLABLL.2da~ /* this is the name of your abilities 2DA file, in the style of clabrn02.2da */
~K_C_H K_C_D K_C_G K_C_E K_C_HE K_C_HL K_C_HO~ /* These are the 2da files listed in KITTABLE.2DA that you want your kit to be a part of. List as many as you like. */
~0x01000000 3~ /* This is the "unusable" value you want for your kit and also the class value. These would normally appear at the end of KITLIST.2DA */
~Cl0~ /* This is the High Level Ability Abbreviation (see LUABBR.2DA) Normal values are Fi0, Pa0, etc. */
~CHAN09 * HELM07 BAG26 RING06 RING31 * BOOT01 AMUL20 BRAC10 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 HAMM07 SW1H27 STAF08~
SAY ~priestess of lloth~
SAY ~Priestess of Lloth~
SAY @250
COPY ~Bladesinger/Spells/EMCDSYM.spl~ ~override~
COPY ~Bladesinger/Spells/EMLLOTH.spl~ ~override~
COPY ~Bladesinger/Spells/EMMRES.spl~ ~override~
COPY ~Bladesinger/Spells/EMVENOM.spl~ ~override~
COPY ~Bladesinger/Spells/EMWEB.spl~ ~override~
COPY ~Bladesinger/ITM/EMLLOTH.itm~ ~override~ // Holy Symbol of Lloth
SAY NAME1 ~~
SAY NAME2 @136
SAY UNIDENTIFIED_DESC ~~
SAY DESC @137
ACTION_IF GAME_IS ~bgee~
THEN BEGIN
COPY ~Bladesinger/Spells/EMSPCLL1.spl~ ~override~
COPY ~Bladesinger/Spells/EMSPCLL2.spl~ ~override~
END
ACTION_IF GAME_IS ~bg2ee~
THEN BEGIN
COPY ~Bladesinger/Spells2/EMSPCLL1.spl~ ~override~
COPY ~Bladesinger/Spells2/EMSPCLL2.spl~ ~override~
END
LAF fl#add_kit_ee
INT_VAR
biography = ~-1~
briefdesc = 31255 // Normal briefdesc for clerics
fallen = 0
fallen_notice = ~-1~
STR_VAR
kit_name = PRIEST_LLOTH
clswpbon = ~0 0 3~
numwslot = ~2~
clascolr = ~25 83 66 28 23~
clasiskl = ~0 0 0 0 0 0 0~
clasthac = ~0~
thiefscl = ~0 0 0 0 0 0 0 0~
hpclass = ~HPPRS~
clsrcreq = ~0 1 0 0 0 0 0~
END