Negative values must be entered as expressions or string (they are still not usable in the "ALTER_/CLONE_/DELETE_" functions, since those use negative values for other purposes). String variables must have delimeters, and an EVAL if they themselves contain variables.
COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
LPF ADD_CRE_EFFECT
INT_VAR // integer variables
opcode = (0 - 1) // expression
target = "-1" // various delimeters
parameter1 = %-1%
parameter2 = ~-1~
timing = ~~~~~-1~~~~~
STR_VAR // string variables
resource = ~USSTSD01~ // Primary resource field, same as used in Spells/Items
resource2 = EVAL ~%file%~ // extra Resource field only used by a few opcodes
vvcresource = "USSTSD02" // extra Resource field only used by a few opcodes
effsource = %USSTSD03% // parent resource field, only used in specific situations, but must always be in ALLCAPS when it used.
effvar = ~~~~~scriptvariablename~~~~~ // only used by opcode 187 AFAIK
END
"sourceslot" is not one that you will ever likely need to use.
No such luck. I tweaked the parameters and WeiDU runs fine, but it doesn't add any effects to any critters; they don't show up in "Stats" in Near Infinity, and the "Effects" field is still zero.
COPY_EXISTING_REGEXP ~.*\.cre~ ~override~ LPF ADD_CRE_EFFECT INT_VAR // integer variables opcode = 402 // expression target = 1 // various delimeters parameter1 = 0 parameter2 = 0 timing = 9 STR_VAR // string variables resource = ~USSTSD01~ // Primary resource field, same as used in Spells/Items END
Is it possible this command doesn't work in IWD2 to begin with? Even when I try a simpler code, like giving all critters +1 AC, no effects show up on the .cre files in Near Infinity. WeiDU will say it patched 1645 creatures and they'll be there in the override folder, but none of the .cre files shows any difference.
COPY_EXISTING_REGEXP ~.*\.cre~ ~override~ LPF ADD_CRE_EFFECT INT_VAR // integer variables opcode = 0 // expression target = 1 // various delimeters parameter1 = 1 parameter2 = 0 timing = 9 // STR_VAR // string variables // resource = ~USSTSD01~ // Primary resource field, same as used in Spells/Items END
@Gwendolyne: It was 242. I downloaded WeiDU v243, pasted the contents of the .zip file into my IWD2 directory, then copied the WeiDU.exe file and renamed the copy as Setup-testWeiDu, my standard testing .exe. But when I run the new .exe file (which I notice is now 972 kilobites, when it used to be lower), I get the same result: WeiDU runs fine, but there is no change to the .cre files.
I tried out v245 just now. Looks like it's just not supported.
I can modify most of the stuff I want through other means, but what I'd really like is to use a current HP opcode and a max HP opcode to force all critters to have half HP, which would reduce the +80 HP from Heart of Fury mode (which otherwise is independent of base HP values from .cre files). Theoretically, I could try patching all critters to have a custom item in whatever empty item slot might be available, but it might just be best to accept an 80-HP difference in HoF mode.
I checked the source files and you are right: the function does not support IWD2 CRE file format. I don't have time the incoming next days, but it might not be very difficult to adapt it to CRE v2.2. It is just a matter of offsets and sizes to be modified.
I've got a new problem and I'm stumped. I'm getting an error when I'm trying to compile a pair of .d file which contain links to each other, both in the form of vanilla game links and new links which I've added. WeiDU says "Cannot resolve external symbolic label" when I run it, so apparently the links I'm adding have some syntax error I cannot see.
In case it helps, here is the .d file I'm working with. I've put the portions I've edited in bold so they stand out from the vanilla entries.
BEGIN ~61ISAIR~
IF WEIGHT #0 ~ NumberOfTimesTalkedTo(0) ~ THEN BEGIN 0 SAY #29432 IF ~~ THEN EXTERN ~60MADAE~ 0 END
IF ~~ THEN BEGIN 1 SAY #29434 IF ~~ THEN REPLY #29435 GOTO 2 IF ~~ THEN REPLY #29436 GOTO 3 IF ~~ THEN REPLY #29437 GOTO 3 IF ~~ THEN REPLY #29438 EXTERN ~60MADAE~ 1 IF ~~ THEN REPLY #29439 EXTERN ~60MADAE~ 2 IF ~ ClassEx(Protagonist,FIGHTER) ~ THEN REPLY #29440 GOTO 4 IF ~ ClassEx(Protagonist,BARBARIAN) ~ THEN REPLY #29440 GOTO 4 IF ~ ClassEx(Protagonist,DRUID) ~ THEN REPLY #29441 EXTERN ~60MADAE~ 2 IF ~ ClassEx(Protagonist,RANGER) ~ THEN REPLY #29441 EXTERN ~60MADAE~ 2 IF ~ ClassEx(Protagonist,PALADIN) ~ THEN REPLY #29442 EXTERN ~60MADAE~ 3 IF ~ ClassEx(Protagonist,CLERIC) Alignment(Protagonist,MASK_GOOD) ~ THEN REPLY #29443 EXTERN ~60MADAE~ 3 IF ~ ClassEx(Protagonist,THIEF) ~ THEN REPLY #29444 GOTO 5 IF ~ ClassEx(Protagonist,BARD) ~ THEN REPLY #29445 GOTO 6 IF ~ ClassEx(Protagonist,MAGE) ~ THEN REPLY #29446 GOTO 7 IF ~ Kit(Protagonist,CLERIC_SELUNE) ~ THEN REPLY #29447 EXTERN ~60MADAE~ 4 IF ~ Kit(Protagonist,CLERIC_TEMPUS) ~ THEN REPLY #29448 GOTO 8 IF ~ Kit(Protagonist,CLERIC_BANE) ~ THEN REPLY #29449 EXTERN ~60MADAE~ 5 IF ~ ClassEx(Protagonist,MONK) ~ THEN REPLY #29451 EXTERN ~60MADAE~ 6 IF ~~ THEN REPLY #29453 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy() ~ EXIT END
IF ~~ THEN BEGIN 2 SAY #29454 IF ~~ THEN REPLY #29455 EXTERN ~60MADAE~ 7 IF ~~ THEN REPLY #29456 EXTERN ~60MADAE~ 8 IF ~~ THEN REPLY #29457 GOTO 10 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 3 SAY #29459 IF ~~ THEN REPLY #29460 EXTERN ~60MADAE~ 7 IF ~~ THEN REPLY #29461 EXTERN ~60MADAE~ 7 IF ~~ THEN REPLY #29462 EXTERN ~60MADAE~ 10 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 4 SAY #29463 IF ~~ THEN REPLY #29455 EXTERN ~60MADAE~ 7 IF ~~ THEN REPLY #29456 EXTERN ~60MADAE~ 8 IF ~~ THEN REPLY #29457 GOTO 10 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 5 SAY #29464 IF ~~ THEN REPLY #29455 EXTERN ~60MADAE~ 7 IF ~~ THEN REPLY #29456 EXTERN ~60MADAE~ 8 IF ~~ THEN REPLY #29457 GOTO 10 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 6 SAY #29465 IF ~~ THEN REPLY #29466 EXTERN ~60MADAE~ 8 IF ~~ THEN REPLY #29467 EXTERN ~60MADAE~ 9 IF ~~ THEN REPLY #29468 EXTERN ~60MADAE~ 10 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 7 SAY #29469 IF ~~ THEN REPLY #29470 GOTO 11 IF ~~ THEN REPLY ~the player says something about their investigation of the mythal~ + MageIntimidateStart IF ~~ THEN REPLY #29471 GOTO 11 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 8 SAY #29472 IF ~~ THEN REPLY #29473 EXTERN ~60MADAE~ 11 IF ~~ THEN REPLY #29474 EXTERN ~60MADAE~ 8 IF ~~ THEN REPLY #29475 GOTO 11 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 9 SAY #29476 IF ~~ THEN REPLY #29477 GOTO 11 IF ~~ THEN REPLY #29478 GOTO 11 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 10 SAY #29479 IF ~~ THEN REPLY #29480 GOTO 15 IF ~~ THEN REPLY #29481 GOTO 16 IF ~ SubRace(Protagonist,HUMAN_AASIMAR) ~ THEN REPLY #29482 GOTO 16 IF ~ SubRace(Protagonist,HUMAN_TIEFLING) ~ THEN REPLY #29482 GOTO 16 IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 17 END
IF ~~ THEN BEGIN 11 SAY #29483 IF ~~ THEN EXTERN ~60MADAE~ 14 END
IF ~~ THEN BEGIN 12 SAY #29484 IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN 13 SAY #29485 IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN 14 SAY #29486 IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN 15 SAY #29487 IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN 16 SAY #29488 IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN 17 SAY #29489 IF ~~ THEN EXTERN ~60MADAE~ 15 END
IF ~~ THEN BEGIN 18 SAY #29490 IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN 19 SAY #29491 IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF WEIGHT #6 ~ NumTimesTalkedToGT(0) GlobalLT("Final_Battle_Progress","GLOBAL",1) ~ THEN BEGIN 20 SAY #29492 IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",1)~ EXTERN ~60MADAE~ 18 END
IF WEIGHT #5 ~ NumTimesTalkedToGT(0) Global("Final_Battle_Progress","GLOBAL",1) !Global("Pool_Tainted","GLOBAL",1) ~ THEN BEGIN 21 SAY #29493 IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",2)~ EXTERN ~60MADAE~ 19 END
IF ~~ THEN BEGIN 22 SAY #29494 IF ~~ THEN DO ~Enemy()~ EXIT END
IF WEIGHT #4 ~ NumTimesTalkedToGT(0) Global("Final_Battle_Progress","GLOBAL",1) Global("Pool_Tainted","GLOBAL",1) ~ THEN BEGIN 23 SAY #29495 IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",2)~ EXTERN ~60MADAE~ 20 END
IF ~~ THEN BEGIN 24 SAY #29496 IF ~~ THEN DO ~Enemy()~ EXIT END
IF WEIGHT #3 ~ NumTimesTalkedToGT(0) Global("Final_Battle_Progress","GLOBAL",2) ~ THEN BEGIN 25 SAY #29497 IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21 END
IF WEIGHT #2 ~ NumTimesTalkedToGT(0) Global("Final_Battle_Progress","GLOBAL",3) ~ THEN BEGIN 26 SAY #29498 IF ~~ THEN EXTERN ~64ORRICK~ 68 END
IF ~~ THEN BEGIN 27 SAY #29499 IF ~~ THEN EXTERN ~60MADAE~ 23 END
IF WEIGHT #1 ~ NumTimesTalkedToGT(0) Global("Ready_To_Retreat","GLOBAL",0) ~ THEN BEGIN 28 SAY #32053 IF ~~ THEN EXIT END IF ~~ THEN BEGIN MageIntimidateStart SAY ~isair says something about the mythal~ + ~CheckSkillGT(Protagonist,30,Knowledge_Arcana)~ + ~the player says something intimidating about the mythal dying~ + SuccessfulMageIntimidate1 + ~CheckSkillLT(Protagonist,30,Knowledge_Arcana)~ + ~the player says something unconvincing~ + FailedMageIntimidate END
IF ~~ THEN BEGIN SuccessfulMageIntimidate1 SAY ~isair says something about the mythal~ + ~CheckSkillGT(Protagonist,25,Bluff)~ + ~another thing about the mythal dying~ + SuccessfulMageIntimidate2 + ~CheckSkillLT(Protagonist,25,Bluff)~ + ~something unconvincing about the mythal dying~ + FailedMageIntimidate END
IF ~~ THEN BEGIN SuccessfulMageIntimidate2 SAY ~isair says something about the mythal~ + ~CheckSkillGT(Protagonist,20,Intimidate)~ + ~another thing about the mythal dying~ + SuccessfulMageIntimidate3 + ~CheckSkillLT(Protagonist,20,Intimidate)~ + ~something unconvincing about the mythal dying~ + FailedMageIntimidate END
IF ~~ THEN BEGIN SuccessfulMageIntimidate3 SAY ~isair says something about the mythal~ + ~~ + ~the player announces the collapse of the mythal~ + MythalTriggerMageIntimidate END
IF ~~ THEN BEGIN FailedMageIntimidate SAY ~isair is unconvinced about the mythal~ + ~~ + ~the player says something~ + FailedMageIntimidateFight END
IF ~~ THEN BEGIN NoArmyIntimidateI SAY ~isair says their existing army is strong or something~ + ~CheckSkillGT(Protagonist,20,Bluff)~ + ~the player says something convincing about the weakness of the legion~ + SuccessfulNoArmyIntimidate1 + ~CheckSkillLT(Protagonist,20,Bluff)~ + ~the player says something unconvincing~ + FailedNoArmyIntimidate END
IF ~~ THEN BEGIN FailedNoArmyIntimidate SAY ~isair rebuts the argument~ + ~~ + ~the player says something~ + FailedNoArmyIntimidateFight END
IF ~~ THEN BEGIN SuccessfulNoArmyIntimidate1 SAY ~isair continues to disagree but admits some losses~ + ~CheckSkillGT(Protagonist,25,Intimidate)~ + ~the player says something convincing about the party's or Ten Towns' strength~ + SuccessfulNoArmyIntimidate2 + ~CheckSkillLT(Protagonist,25,Intimidate)~ + ~the player says something unconvincing~ + FailedNoArmyIntimidate END
IF ~~ THEN BEGIN SuccessfulNoArmyIntimidate2 SAY ~isair is more discouraged~ + ~CheckSkillGT(Protagonist,30,Intimidate)~ + ~the player continues to be convincing~ + SuccessfulNoArmyIntimidate3 + ~CheckSkillLT(Protagonist,30,Intimidate)~ + ~the player says something unconvincing~ + FailedNoArmyIntimidate END
IF ~~ THEN BEGIN SuccessfulNoArmyIntimidate3 SAY ~isair realizes they're in a bad position~ + ~~ + ~the player says something~ + MythalTriggerNoArmyIntimidate END
IF ~~ THEN BEGIN QuestionMotivesStartI SAY ~isair defends their motives~ + ~CheckSkillGT(Protagonist,30,Diplomacy)~ + ~the player says something convincing about ethics~ EXTERN ~60MADAE~ SuccessfulQuestionMotivesM + ~CheckSkillLT(Protagonist,30,Bluff)~ + ~the player says something unconvincing~ EXTERN ~60MADAE~ FailedQuestionMotivesM END
IF ~~ THEN BEGIN FailedQuestionMotivesI SAY ~isair is unconvinced and ready to fight~ + ~~ + ~some player response~ + FailedQuestionMotivesFight END
IF ~~ THEN BEGIN SuccessfulQuestionMotivesI SAY ~isair is hesitant as well~ + ~~ + ~the player says something convincing~ + SuccessfulQuestionMotivesI2 END
IF ~~ THEN BEGIN SuccessfulQuestionMotivesI2 SAY ~isair is hesitant again~ + ~~ + ~the player says something convincing~ + SuccessfulQuestionMotivesM2 END
IF ~~ THEN BEGIN SuccessfulQuestionMotivesI3 SAY ~isair is hesitant again~ + ~~ + ~the player says something convincing~ + MythalTriggerQuestionMotives END
IF ~~ THEN BEGIN FailedMageIntimidateFight SAY ~Enough of this stupidity. Would it be all right if I killed them now, sister?~ IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN FailedQuestionMotivesFight SAY ~Enough of this stupidity. Would it be all right if I killed them now, sister?~ IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN FailedNoArmyIntimidateFight SAY ~Enough of this stupidity. Would it be all right if I killed them now, sister?~ IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0) Enemy()~ EXTERN ~60MADAE~ 16 END
IF ~~ THEN BEGIN MythalTriggerMageIntimidate SAY ~Madae... what was that? What's happening to me?~ IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21 END
IF ~~ THEN BEGIN MythalTriggerQuestionMotives SAY ~Madae... what was that? What's happening to me?~ IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21 END
IF ~~ THEN BEGIN MythalTriggerNoArmyIntimidate SAY ~Madae... what was that? What's happening to me?~ IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21 END
@semiticgod Since the .d files reference eachother, they need to be compiled together. Instead of running two different COMPILE operations, try combining them into one, like so: COMPILE ~testWeiDu/dlg/61ISAIR.d~ ~testWeiDu/dlg/60MADAE.d~
Let me preface my question with this: I have several different skins for my spell menu mod - some of the games the mod can be installed on do not include the required BAM assets for the given skin. I want to ship my mod with the required BAM assets so that it is game-independent; a problem arises, however, because the BAM assets I am using are V2. When I try to make the assets portable the game simply crashes when I try to use them - I assume this is because the linked PVRZ files are not present in the target game. I believe I have two options: either go through some trouble with the WeiDU installer to properly install these assets, or convert them to BAM V1 and simply throw them in the override folder.
My question is this: Would there be any downsides to converting these assets to V1, like a loss in quality? If that is the case, I would be willing to go through the hoops of installing the V2 versions...
As an aside, if I do decide to install the V2 versions, how would I go about doing so? The PVRZ link seems a bit complicated at a glance.
My question is this: Would there be any downsides to converting these assets to V1, like a loss in quality? If that is the case, I would be willing to go through the hoops of installing the V2 versions...
Loss of quality yes as if I remember correctly BAM V1 use a palette with only 256 colors. And also with BAM V2, you can have transparency.
As an aside, if I do decide to install the V2 versions, how would I go about doing so? The PVRZ link seems a bit complicated at a glance.
You need to create your bams instead of reusing the one in the game as the PVRZ they use is often shared with other bams. This way, you can choose the index you want for the PVRZ file. And then you have some weidu functions (LPF UPDATE_PVRZ_INDICES) that can be used to automatically reindex your bams to avoid any collision.
You can look at EEUITweaks or LeUI-IWDEE for example.
@subtledoctor: Well, in IWD2 at least, the Learn Spell opcode has a parameter that lets you toggle between arcane and divine spells. I don't know if it works, but it shows up in Near Infinity.
You might just try copying the ability from a mage scroll onto a priest scroll (you know, a mage scroll's twin abilities to Cast Spell and Learn Spell) and then setting the opcode's parameter 1 or parameter 2 from zero to "1" to see if it works. Maybe the other IE games have the same functionality and it's just never been tried out.
@subtledoctor The button is hardcoded to only function for those with a mage spellbook. Getting it to appear for others won't do anything when you click it, not even expend the scroll.
However, someone with a mage spellbook is not limited to learning just wizard spells, they can also learn priest/innate spells this way. The feedback will always display failure, but IIRC it's automatically successful for non-wizard spells.
The Cleric/Mage and Fighter/Cleric/Mage are the only priests that could learn priest spells through scrolls that way.
@kjeron: Thank you! I don't understand most of it besides the last few lines starting at COPY_EXISTING_REGEXP, but I think that last section will let me apply all of the effects that I'm looking for.
I thought using 11 for the RELATION would achieve this... but in testing, it doesn't work.
I ran into this same issue - it required 3 entries in SPLPROT: rowX stat range 10 // too many bits rowY stat value 11 // not enough bits rowZ 0x103 rowX rowY // too many or not enough
rowZ is the one you would use in opcode 318.
(range): This value will depend on how many bits you are using for these checks. It is: (all bits [-1]) - (all bits being used) + (value) If you are using bits0-2 (Proficiency), bits used = BIT0+BIT1+BIT2 = 7 stat != 1 would be (-1 - 7 + 1) = -7 or 0xfffffff9 stat != 2 would be (-1 - 7 + 2) = -6 or 0xfffffffa stat != 3 would be (-1 - 7 + 3) = -5 or 0xfffffffb stat != 4 would be (-1 - 7 + 4) = -4 or 0xfffffffc stat != 5 would be (-1 - 7 + 5) = -3 or 0xfffffffd stat != 6 would be (-1 - 7 + 6) = -2 or 0xfffffffe
stat != 0 would be (-1 - 7 + 0) = -8 or 0xfffffff8, and would not need a rowY or rowZ stat != 7 would just use rowY, without the need for rowX or rowZ
EDIT - probably also have to evaluate all the values of (%splprot_rows% + x) beforehand, too...
EDIT2 - With my custom proficiency system this needs to go up to 4. And I don't care about 0 or 1 (I think). So 9 rows added per weapon stat, or 180 rows.
Yes and yes. Fortunately, SPLPROT is generous with it's rows, unlike SPLSTATE.
That code appears to work just fine in-game on my end. Equip Axe with ** = 3/2 APR Equip Axe with *** = 2 APR Equip Axe with **** = 5/2 APR I assume that's what you were going for here.
With 2 exceptions: Bows and Darts have duplicated immunities which show up in the combat log (because they use opcode 324, instead of opcode 318), not sure what the intent is here, but the 2 sets of immunities may be interfering with each other.
I made some spells that summons creatures previously, but now I'm having a bad time with one.
1) The spell is given as it should
2) The spell appears on the innate menu
3) The spell can be cast
4) The creature that was supposed to appear does not appear.
It is a skeleton with a scimitar that gives it some properties. The same spell structure was used for the other summon spells (that work perfectly), so my guess is that the issue is somewhere in the .cre or .itm files.
@Raduziel I'm not sure what's wrong on your end, but it seems to work fine for me, and I can't see anything glaringly wrong in the files. Here's what I did to test it: 1. Unzipped your zip into my override folder 2. Used C:AddSpell("RAMYRK3") on charname 3. Cast the spell from charname's innates menu
I tried the spell in BGEE, BG2EE, and IWDEE; in every game it works. It is very strange that it doesn't work for you. This might be a dumb question, but are you sure you are not at your summoning cap? That would prevent the creature from spawning... just a thought.
Comments
COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
LPF ADD_CRE_EFFECT
INT_VAR // integer variables
opcode = 402 // expression
target = 1 // various delimeters
parameter1 = 0
parameter2 = 0
timing = 9
STR_VAR // string variables
resource = ~USSTSD01~ // Primary resource field, same as used in Spells/Items
END
Is it possible this command doesn't work in IWD2 to begin with? Even when I try a simpler code, like giving all critters +1 AC, no effects show up on the .cre files in Near Infinity. WeiDU will say it patched 1645 creatures and they'll be there in the override folder, but none of the .cre files shows any difference.
COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
LPF ADD_CRE_EFFECT
INT_VAR // integer variables
opcode = 0 // expression
target = 1 // various delimeters
parameter1 = 1
parameter2 = 0
timing = 9
// STR_VAR // string variables
// resource = ~USSTSD01~ // Primary resource field, same as used in Spells/Items
END
I can modify most of the stuff I want through other means, but what I'd really like is to use a current HP opcode and a max HP opcode to force all critters to have half HP, which would reduce the +80 HP from Heart of Fury mode (which otherwise is independent of base HP values from .cre files). Theoretically, I could try patching all critters to have a custom item in whatever empty item slot might be available, but it might just be best to accept an 80-HP difference in HoF mode.
In case it helps, here is the .d file I'm working with. I've put the portions I've edited in bold so they stand out from the vanilla entries.
BEGIN ~61ISAIR~
IF WEIGHT #0 ~ NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0
SAY #29432
IF ~~ THEN EXTERN ~60MADAE~ 0
END
IF ~~ THEN BEGIN 1
SAY #29434
IF ~~ THEN REPLY #29435 GOTO 2
IF ~~ THEN REPLY #29436 GOTO 3
IF ~~ THEN REPLY #29437 GOTO 3
IF ~~ THEN REPLY #29438 EXTERN ~60MADAE~ 1
IF ~~ THEN REPLY #29439 EXTERN ~60MADAE~ 2
IF ~ ClassEx(Protagonist,FIGHTER)
~ THEN REPLY #29440 GOTO 4
IF ~ ClassEx(Protagonist,BARBARIAN)
~ THEN REPLY #29440 GOTO 4
IF ~ ClassEx(Protagonist,DRUID)
~ THEN REPLY #29441 EXTERN ~60MADAE~ 2
IF ~ ClassEx(Protagonist,RANGER)
~ THEN REPLY #29441 EXTERN ~60MADAE~ 2
IF ~ ClassEx(Protagonist,PALADIN)
~ THEN REPLY #29442 EXTERN ~60MADAE~ 3
IF ~ ClassEx(Protagonist,CLERIC)
Alignment(Protagonist,MASK_GOOD)
~ THEN REPLY #29443 EXTERN ~60MADAE~ 3
IF ~ ClassEx(Protagonist,THIEF)
~ THEN REPLY #29444 GOTO 5
IF ~ ClassEx(Protagonist,BARD)
~ THEN REPLY #29445 GOTO 6
IF ~ ClassEx(Protagonist,MAGE)
~ THEN REPLY #29446 GOTO 7
IF ~ Kit(Protagonist,CLERIC_SELUNE)
~ THEN REPLY #29447 EXTERN ~60MADAE~ 4
IF ~ Kit(Protagonist,CLERIC_TEMPUS)
~ THEN REPLY #29448 GOTO 8
IF ~ Kit(Protagonist,CLERIC_BANE)
~ THEN REPLY #29449 EXTERN ~60MADAE~ 5
IF ~ ClassEx(Protagonist,MONK)
~ THEN REPLY #29451 EXTERN ~60MADAE~ 6
IF ~~ THEN REPLY #29453 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()
~ EXIT
END
IF ~~ THEN BEGIN 2
SAY #29454
IF ~~ THEN REPLY #29455 EXTERN ~60MADAE~ 7
IF ~~ THEN REPLY #29456 EXTERN ~60MADAE~ 8
IF ~~ THEN REPLY #29457 GOTO 10
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 3
SAY #29459
IF ~~ THEN REPLY #29460 EXTERN ~60MADAE~ 7
IF ~~ THEN REPLY #29461 EXTERN ~60MADAE~ 7
IF ~~ THEN REPLY #29462 EXTERN ~60MADAE~ 10
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 4
SAY #29463
IF ~~ THEN REPLY #29455 EXTERN ~60MADAE~ 7
IF ~~ THEN REPLY #29456 EXTERN ~60MADAE~ 8
IF ~~ THEN REPLY #29457 GOTO 10
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 5
SAY #29464
IF ~~ THEN REPLY #29455 EXTERN ~60MADAE~ 7
IF ~~ THEN REPLY #29456 EXTERN ~60MADAE~ 8
IF ~~ THEN REPLY #29457 GOTO 10
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 6
SAY #29465
IF ~~ THEN REPLY #29466 EXTERN ~60MADAE~ 8
IF ~~ THEN REPLY #29467 EXTERN ~60MADAE~ 9
IF ~~ THEN REPLY #29468 EXTERN ~60MADAE~ 10
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 7
SAY #29469
IF ~~ THEN REPLY #29470 GOTO 11
IF ~~ THEN REPLY ~the player says something about their investigation of the mythal~ + MageIntimidateStart
IF ~~ THEN REPLY #29471 GOTO 11
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 8
SAY #29472
IF ~~ THEN REPLY #29473 EXTERN ~60MADAE~ 11
IF ~~ THEN REPLY #29474 EXTERN ~60MADAE~ 8
IF ~~ THEN REPLY #29475 GOTO 11
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 9
SAY #29476
IF ~~ THEN REPLY #29477 GOTO 11
IF ~~ THEN REPLY #29478 GOTO 11
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 10
SAY #29479
IF ~~ THEN REPLY #29480 GOTO 15
IF ~~ THEN REPLY #29481 GOTO 16
IF ~ SubRace(Protagonist,HUMAN_AASIMAR)
~ THEN REPLY #29482 GOTO 16
IF ~ SubRace(Protagonist,HUMAN_TIEFLING)
~ THEN REPLY #29482 GOTO 16
IF ~~ THEN REPLY #29458 DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 17
END
IF ~~ THEN BEGIN 11
SAY #29483
IF ~~ THEN EXTERN ~60MADAE~ 14
END
IF ~~ THEN BEGIN 12
SAY #29484
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN 13
SAY #29485
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN 14
SAY #29486
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN 15
SAY #29487
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN 16
SAY #29488
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN 17
SAY #29489
IF ~~ THEN EXTERN ~60MADAE~ 15
END
IF ~~ THEN BEGIN 18
SAY #29490
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN 19
SAY #29491
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF WEIGHT #6 ~ NumTimesTalkedToGT(0)
GlobalLT("Final_Battle_Progress","GLOBAL",1)
~ THEN BEGIN 20
SAY #29492
IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",1)~ EXTERN ~60MADAE~ 18
END
IF WEIGHT #5 ~ NumTimesTalkedToGT(0)
Global("Final_Battle_Progress","GLOBAL",1)
!Global("Pool_Tainted","GLOBAL",1)
~ THEN BEGIN 21
SAY #29493
IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",2)~ EXTERN ~60MADAE~ 19
END
IF ~~ THEN BEGIN 22
SAY #29494
IF ~~ THEN DO ~Enemy()~ EXIT
END
IF WEIGHT #4 ~ NumTimesTalkedToGT(0)
Global("Final_Battle_Progress","GLOBAL",1)
Global("Pool_Tainted","GLOBAL",1)
~ THEN BEGIN 23
SAY #29495
IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",2)~ EXTERN ~60MADAE~ 20
END
IF ~~ THEN BEGIN 24
SAY #29496
IF ~~ THEN DO ~Enemy()~ EXIT
END
IF WEIGHT #3 ~ NumTimesTalkedToGT(0)
Global("Final_Battle_Progress","GLOBAL",2)
~ THEN BEGIN 25
SAY #29497
IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21
END
IF WEIGHT #2 ~ NumTimesTalkedToGT(0)
Global("Final_Battle_Progress","GLOBAL",3)
~ THEN BEGIN 26
SAY #29498
IF ~~ THEN EXTERN ~64ORRICK~ 68
END
IF ~~ THEN BEGIN 27
SAY #29499
IF ~~ THEN EXTERN ~60MADAE~ 23
END
IF WEIGHT #1 ~ NumTimesTalkedToGT(0)
Global("Ready_To_Retreat","GLOBAL",0)
~ THEN BEGIN 28
SAY #32053
IF ~~ THEN EXIT
END
IF ~~ THEN BEGIN MageIntimidateStart
SAY ~isair says something about the mythal~
+ ~CheckSkillGT(Protagonist,30,Knowledge_Arcana)~ + ~the player says something intimidating about the mythal dying~ + SuccessfulMageIntimidate1
+ ~CheckSkillLT(Protagonist,30,Knowledge_Arcana)~ + ~the player says something unconvincing~ + FailedMageIntimidate
END
IF ~~ THEN BEGIN SuccessfulMageIntimidate1
SAY ~isair says something about the mythal~
+ ~CheckSkillGT(Protagonist,25,Bluff)~ + ~another thing about the mythal dying~ + SuccessfulMageIntimidate2
+ ~CheckSkillLT(Protagonist,25,Bluff)~ + ~something unconvincing about the mythal dying~ + FailedMageIntimidate
END
IF ~~ THEN BEGIN SuccessfulMageIntimidate2
SAY ~isair says something about the mythal~
+ ~CheckSkillGT(Protagonist,20,Intimidate)~ + ~another thing about the mythal dying~ + SuccessfulMageIntimidate3
+ ~CheckSkillLT(Protagonist,20,Intimidate)~ + ~something unconvincing about the mythal dying~ + FailedMageIntimidate
END
IF ~~ THEN BEGIN SuccessfulMageIntimidate3
SAY ~isair says something about the mythal~
+ ~~ + ~the player announces the collapse of the mythal~ + MythalTriggerMageIntimidate
END
IF ~~ THEN BEGIN FailedMageIntimidate
SAY ~isair is unconvinced about the mythal~
+ ~~ + ~the player says something~ + FailedMageIntimidateFight
END
IF ~~ THEN BEGIN NoArmyIntimidateI
SAY ~isair says their existing army is strong or something~
+ ~CheckSkillGT(Protagonist,20,Bluff)~ + ~the player says something convincing about the weakness of the legion~ + SuccessfulNoArmyIntimidate1
+ ~CheckSkillLT(Protagonist,20,Bluff)~ + ~the player says something unconvincing~ + FailedNoArmyIntimidate
END
IF ~~ THEN BEGIN FailedNoArmyIntimidate
SAY ~isair rebuts the argument~
+ ~~ + ~the player says something~ + FailedNoArmyIntimidateFight
END
IF ~~ THEN BEGIN SuccessfulNoArmyIntimidate1
SAY ~isair continues to disagree but admits some losses~
+ ~CheckSkillGT(Protagonist,25,Intimidate)~ + ~the player says something convincing about the party's or Ten Towns' strength~ + SuccessfulNoArmyIntimidate2
+ ~CheckSkillLT(Protagonist,25,Intimidate)~ + ~the player says something unconvincing~ + FailedNoArmyIntimidate
END
IF ~~ THEN BEGIN SuccessfulNoArmyIntimidate2
SAY ~isair is more discouraged~
+ ~CheckSkillGT(Protagonist,30,Intimidate)~ + ~the player continues to be convincing~ + SuccessfulNoArmyIntimidate3
+ ~CheckSkillLT(Protagonist,30,Intimidate)~ + ~the player says something unconvincing~ + FailedNoArmyIntimidate
END
IF ~~ THEN BEGIN SuccessfulNoArmyIntimidate3
SAY ~isair realizes they're in a bad position~
+ ~~ + ~the player says something~ + MythalTriggerNoArmyIntimidate
END
IF ~~ THEN BEGIN QuestionMotivesStartI
SAY ~isair defends their motives~
+ ~CheckSkillGT(Protagonist,30,Diplomacy)~ + ~the player says something convincing about ethics~ EXTERN ~60MADAE~ SuccessfulQuestionMotivesM
+ ~CheckSkillLT(Protagonist,30,Bluff)~ + ~the player says something unconvincing~ EXTERN ~60MADAE~ FailedQuestionMotivesM
END
IF ~~ THEN BEGIN FailedQuestionMotivesI
SAY ~isair is unconvinced and ready to fight~
+ ~~ + ~some player response~ + FailedQuestionMotivesFight
END
IF ~~ THEN BEGIN SuccessfulQuestionMotivesI
SAY ~isair is hesitant as well~
+ ~~ + ~the player says something convincing~ + SuccessfulQuestionMotivesI2
END
IF ~~ THEN BEGIN SuccessfulQuestionMotivesI2
SAY ~isair is hesitant again~
+ ~~ + ~the player says something convincing~ + SuccessfulQuestionMotivesM2
END
IF ~~ THEN BEGIN SuccessfulQuestionMotivesI3
SAY ~isair is hesitant again~
+ ~~ + ~the player says something convincing~ + MythalTriggerQuestionMotives
END
IF ~~ THEN BEGIN FailedMageIntimidateFight
SAY ~Enough of this stupidity. Would it be all right if I killed them now, sister?~
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN FailedQuestionMotivesFight
SAY ~Enough of this stupidity. Would it be all right if I killed them now, sister?~
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN FailedNoArmyIntimidateFight
SAY ~Enough of this stupidity. Would it be all right if I killed them now, sister?~
IF ~~ THEN DO ~SetGlobal("Ready_To_Retreat","GLOBAL",0)
Enemy()~ EXTERN ~60MADAE~ 16
END
IF ~~ THEN BEGIN MythalTriggerMageIntimidate
SAY ~Madae... what was that? What's happening to me?~
IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21
END
IF ~~ THEN BEGIN MythalTriggerQuestionMotives
SAY ~Madae... what was that? What's happening to me?~
IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21
END
IF ~~ THEN BEGIN MythalTriggerNoArmyIntimidate
SAY ~Madae... what was that? What's happening to me?~
IF ~~ THEN DO ~SetGlobal("Final_Battle_Progress","GLOBAL",3)~ EXTERN ~60MADAE~ 21
END
I don't think my TP2 code is the problem:
BEGIN "convert dialog to d"
COMPILE ~testWeiDu/dlg/61ISAIR.d~
COMPILE ~testWeiDu/dlg/60MADAE.d~
Since the .d files reference eachother, they need to be compiled together. Instead of running two different COMPILE operations, try combining them into one, like so:
COMPILE ~testWeiDu/dlg/61ISAIR.d~ ~testWeiDu/dlg/60MADAE.d~
My question is this: Would there be any downsides to converting these assets to V1, like a loss in quality? If that is the case, I would be willing to go through the hoops of installing the V2 versions...
As an aside, if I do decide to install the V2 versions, how would I go about doing so? The PVRZ link seems a bit complicated at a glance.
You can look at EEUITweaks or LeUI-IWDEE for example.
You might just try copying the ability from a mage scroll onto a priest scroll (you know, a mage scroll's twin abilities to Cast Spell and Learn Spell) and then setting the opcode's parameter 1 or parameter 2 from zero to "1" to see if it works. Maybe the other IE games have the same functionality and it's just never been tried out.
The button is hardcoded to only function for those with a mage spellbook. Getting it to appear for others won't do anything when you click it, not even expend the scroll.
However, someone with a mage spellbook is not limited to learning just wizard spells, they can also learn priest/innate spells this way. The feedback will always display failure, but IIRC it's automatically successful for non-wizard spells.
The Cleric/Mage and Fighter/Cleric/Mage are the only priests that could learn priest spells through scrolls that way.
rowX stat range 10 // too many bits
rowY stat value 11 // not enough bits
rowZ 0x103 rowX rowY // too many or not enough
rowZ is the one you would use in opcode 318.
(range): This value will depend on how many bits you are using for these checks.
It is: (all bits [-1]) - (all bits being used) + (value)
If you are using bits0-2 (Proficiency), bits used = BIT0+BIT1+BIT2 = 7
stat != 1 would be (-1 - 7 + 1) = -7 or 0xfffffff9
stat != 2 would be (-1 - 7 + 2) = -6 or 0xfffffffa
stat != 3 would be (-1 - 7 + 3) = -5 or 0xfffffffb
stat != 4 would be (-1 - 7 + 4) = -4 or 0xfffffffc
stat != 5 would be (-1 - 7 + 5) = -3 or 0xfffffffd
stat != 6 would be (-1 - 7 + 6) = -2 or 0xfffffffe
stat != 0 would be (-1 - 7 + 0) = -8 or 0xfffffff8, and would not need a rowY or rowZ
stat != 7 would just use rowY, without the need for rowX or rowZ
10 gets the negative number, 11 gets the positive number. Yes and yes. Fortunately, SPLPROT is generous with it's rows, unlike SPLSTATE.
Equip Axe with ** = 3/2 APR
Equip Axe with *** = 2 APR
Equip Axe with **** = 5/2 APR
I assume that's what you were going for here.
With 2 exceptions:
Bows and Darts have duplicated immunities which show up in the combat log (because they use opcode 324, instead of opcode 318), not sure what the intent is here, but the 2 sets of immunities may be interfering with each other.
I made some spells that summons creatures previously, but now I'm having a bad time with one.
1) The spell is given as it should
2) The spell appears on the innate menu
3) The spell can be cast
4) The creature that was supposed to appear does not appear.
It is a skeleton with a scimitar that gives it some properties. The same spell structure was used for the other summon spells (that work perfectly), so my guess is that the issue is somewhere in the .cre or .itm files.
Thanks in advance.
I'm not sure what's wrong on your end, but it seems to work fine for me, and I can't see anything glaringly wrong in the files. Here's what I did to test it:
1. Unzipped your zip into my override folder
2. Used C:AddSpell("RAMYRK3") on charname
3. Cast the spell from charname's innates menu
I tried the spell in BGEE, BG2EE, and IWDEE; in every game it works. It is very strange that it doesn't work for you. This might be a dumb question, but are you sure you are not at your summoning cap? That would prevent the creature from spawning... just a thought.
Thanks for testing, @Bubb !
Edit: I did a second test and all other summoning for all the other kits are working perfectly, only this one is being a problem.