Skip to content

General mod Questions thread

1232426282970

Comments

  • The user and all related content has been deleted.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    kjeron said:


    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
  • GwendolyneGwendolyne Member Posts: 461
    Which WeiDU version are you using?
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Gwendolyne: No idea. How would I check?
  • GwendolyneGwendolyne Member Posts: 461
    First line of your setup-xxxxx.DEBUG file. ;)
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @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.
  • kjeronkjeron Member Posts: 2,367
    @semitigod If it's not adding anything, and not returning errors, then it likely is not supported in IWD2.
  • GwendolyneGwendolyne Member Posts: 461
    edited May 2018
    Don't know if it helps, but try the last one (v245) because it fixes a regression with CD functions introduced by a previous version (wrong offsets).
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    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.
  • GwendolyneGwendolyne Member Posts: 461
    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.

  • semiticgoddesssemiticgoddess Member Posts: 14,903
    edited May 2018
    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


    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~
  • BubbBubb Member Posts: 1,000
    @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~
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Bubb: Success! Thank you! My .d files still had some syntax errors, but once I sorted those out, the two dialogues compiled perfectly.
  • BubbBubb Member Posts: 1,000
    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.
  • lefreutlefreut Member Posts: 1,462
    edited May 2018
    Bubb said:

    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.
    Bubb said:

    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.
  • The user and all related content has been deleted.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @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.
  • kjeronkjeron Member Posts: 2,367
    @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.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    edited May 2018

    I tried out v245 just now. Looks like it's just not supported.

    Try this:
    
    	DEFINE_PATCH_FUNCTION	IWD2_CRE_REINDEX	RET	fx_off	fx_num	BEGIN
    		READ_LONG	0x5fa ab_off	READ_LONG	0x5fe	ab_num	SET	ab_size = (ab_num * 0x10 + 8)		READ_ASCII	ab_off	abilities	(ab_size)
    		READ_LONG	0x602	sng_off	READ_LONG	0x606	sng_num	SET	sng_size = (sng_num * 0x10 + 8)	READ_ASCII	sng_off	songs	(sng_size)
    		READ_LONG	0x60a	shp_off	READ_LONG	0x60e	shp_num	SET	shp_size = (shp_num * 0x10 + 8)	READ_ASCII	shp_off	shapes	(shp_size)
    		READ_LONG	0x612	slt_off																															READ_ASCII	slt_off	slots	(0x68)
    		READ_LONG	0x616	itm_off	READ_LONG	0x61a	itm_num	SET	itm_size = (itm_num * 0x14)			READ_ASCII	itm_off	items	(itm_size)
    		READ_LONG	0x61e	fx_off	READ_LONG	0x622	fx_num	SET	fx_size = (fx_num * 0x108)			READ_ASCII	fx_off	effects	(fx_size)
    		SET	offset = SOURCE_SIZE
    		PATCH_IF	offset	> ab_off	BEGIN	SET	offset = ab_off	END
    		PATCH_IF	offset	> sng_off	BEGIN	SET	offset = sng_off	END
    		PATCH_IF	offset	> slt_off	BEGIN	SET	offset = slt_off	END
    		PATCH_IF	offset	> itm_off	BEGIN	SET	offset = itm_off	END
    		PATCH_IF	offset	> fx_off	BEGIN	SET	offset = fx_off	END
    		SET	ab_off	= offset							WRITE_LONG	0x5fa	ab_off	WRITE_ASCIIE	ab_off	~%abilities%~
    		SET	sng_off	= ab_off + ab_size		WRITE_LONG	0x602	sng_off	WRITE_ASCIIE	sng_off	~%songs%~
    		SET	shp_off	= sng_off + sng_size	WRITE_LONG	0x60a	shp_off	WRITE_ASCIIE	shp_off	~%shapes%~
    		SET	slt_off	= shp_off + shp_size	WRITE_LONG	0x612	slt_off	WRITE_ASCIIE	slt_off	~%slots%~
    		SET	itm_off	= slt_off + 0x68			WRITE_LONG	0x616	itm_off	WRITE_ASCIIE	itm_off	~%items%~
    		SET	fx_off	= itm_off + itm_size	WRITE_LONG	0x61e	fx_off	WRITE_ASCIIE	fx_off	~%effects%~
    	END
    	DEFINE_PATCH_FUNCTION	IWD2_ADD_CRE_EFFECT
    		INT_VAR
    			opcode = 0
    			timing = 0
    			target = 0
    			parameter1 = 0
    			parameter2 = 0
    			parameter3 = 0
    			parameter4 = 0
    	//		parameter5 = 0
    	//		time_applied = 0	//	EE-only
    			power = 0
    			resist_dispel = 0
    			duration = 0
    			probability1 = 100
    			probability2 = 0
    			dicenumber = 0
    			dicesize = 0
    			savingthrow = 0
    			savebonus = 0
    			school = 0
    			special = 0
    	//		internal = 0
    			lowestefflvl = 0
    			highestefflvl = 0
    			casterx = ~-1~
    			castery = ~-1~
    			targetx = ~-1~
    			targety = ~-1~
    			restype = 0
    			sourceflags = 0
    			projectile = 0
    			sourceslot = ~-1~
    			casterlvl = 0
    	//		internalflags = 0
    			sectype = 0
    			insert_point = ~-1~
    		STR_VAR
    			resource = ~~
    			resource2 = ~~
    			resource3 = ~~	//	only label I changed, as vvcresource was misleading
    			effsource = ~~
    			effvar = ~~
    	BEGIN
    		READ_ASCII	0	sig	(8)
    		PATCH_IF	~%sig%~	STRING_EQUAL	~CRE V2.2~	BEGIN
    			LPF	IWD2_CRE_REINDEX	RET	fx_off	fx_num	END
    			READ_BYTE	0x33	fx_ver
    			PATCH_IF	fx_ver	= 0 	BEGIN
    				PATCH_IF	fx_num = 0	BEGIN
    					WRITE_BYTE	0x33	1
    				END	ELSE	BEGIN
    					PATCH_FAIL	~Needs converting to V2 effects.~	// No unmodded creature in IWD2 has V1 effects, shame on anyone that adds any.
    				END
    			END
    			PATCH_IF	(insert_point > fx_num) OR (insert_point < 0)	BEGIN
    				SET	insert_point = fx_num
    			END
    			INSERT_BYTES	(fx_off + insert_point * 0x108)	0x108
    			WRITE_ASCII		(fx_off + insert_point * 0x108)	~EFF V2.0~
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x8)		opcode
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0xc)		target
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x10)	power
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x14)	parameter1
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x18)	parameter2
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x1c)	timing
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x20)	duration
    			WRITE_SHORT		(fx_off + insert_point * 0x108 + 0x24)	probability1
    			WRITE_SHORT		(fx_off + insert_point * 0x108 + 0x26)	probability2
    			WRITE_ASCIIE	(fx_off + insert_point * 0x108 + 0x28)	~%resource%~	#8
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x30)	savingthrow
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x34)	savebonus
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x38)	dicenumber
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x3c)	dicesize
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x40)	special
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x44)	school
    	//		WRITE_LONG		(fx_off + insert_point * 0x108 + 0x48)	internal
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x4c)	lowestefflvl
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x50)	highestefflvl
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x54)	resist_dispel
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x58)	parameter3
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x5c)	parameter4
    	//		WRITE_LONG		(fx_off + insert_point * 0x108 + 0x60)	parameter5
    	//		WRITE_LONG		(fx_off + insert_point * 0x108 + 0x64)	time_applied
    			WRITE_ASCIIE	(fx_off + insert_point * 0x108 + 0x68)	~%resource2%~	#8
    			WRITE_ASCIIE	(fx_off + insert_point * 0x108 + 0x70)	~%resource3%~	#8
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x78)	casterx
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x7c)	castery
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x80)	targetx
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x84)	targety
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x88)	restype
    			WRITE_ASCIIE	(fx_off + insert_point * 0x108 + 0x8c)	~%effsource%~	#8
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x94)	sourceflags
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x98)	projectile
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0x9c)	sourceslot
    			WRITE_ASCIIE	(fx_off + insert_point * 0x108 + 0xa0)	~%effvar%~	#32
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0xc0)	casterlvl
    	//		WRITE_LONG		(fx_off + insert_point * 0x108 + 0xc4)	internalflags
    			WRITE_LONG		(fx_off + insert_point * 0x108 + 0xc8)	sectype
    			WRITE_LONG	0x622 (THIS + 1)
    		END
    	END
    
    	
    	COPY_EXISTING_REGEXP	~^.+\.CRE$~	override
    		LPF	IWD2_ADD_CRE_EFFECT
    			INT_VAR
    				opcode = 1
    				target = 1
    				power = 5
    				timing = 9
    				parameter1 = 5
    				parameter2 = 1
    				special = ~-1~
    				casterlvl = 5
    				projectile = 67
    				resist_dispel = 3
    			STR_VAR
    				resource = ~THISTHAT~
    				resource2 = ~thisthat~
    				resource3 = ~thatthis~
    				effsource = EVAL ~%SOURCE_RES%~
    		END	//	These were just random values for testing
    	BUT_ONLY
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @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.
  • [Deleted User][Deleted User] Posts: 0
    edited May 2018
    The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367

    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
  • [Deleted User][Deleted User] Posts: 0
    edited May 2018
    The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    @subtledoctor reverse the values used for relation 10 and 11.
    10 gets the negative number, 11 gets the positive number.


    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.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    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.
  • RaduzielRaduziel Member Posts: 4,714
    Ok, need some help as I'm out of ideas.

    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.
  • BubbBubb Member Posts: 1,000
    @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.
  • RaduzielRaduziel Member Posts: 4,714
    edited May 2018
    No, not at the summoning cap at all. New game, solo, not but the character in the party or by the party's side.

    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.




    Post edited by Raduziel on
Sign In or Register to comment.