Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

problems with Weidu CLONE_EFFECT and IWDEE

subtledoctorsubtledoctor Member Posts: 11,466
edited September 2015 in IWD:EE Mods
I don't know where to post this, in modding or bugs. Either way I'm tagging @CamDawg because he was deeply involved with both the IWDEE development and the CLONE_EFFECT Weidu macro.

Try running this in a .tp2:
BEGIN ~test mod~

LAF RES_NUM_OF_SPELL_NAME
STR_VAR
spell_name = ~CLERIC_PROTECT_FROM_EVIL~
RET
spell_res
spell_num
END

COPY_EXISTING ~%spell_res%.spl~ ~override/d5_%spell_num%.spl~

COPY_EXISTING ~#bonecir.spl~ ~override~
LPF CLONE_EFFECT STR_VAR match_resource=EVAL ~%spell_res%~ resource=EVAL ~d5_%spell_num%~ END
BUT_ONLY
CLONE_EFFECT chokes on #BONECIR.spl, and I don't know why. (And I don't know how many other spells might cause it to choke as well.) But it's quite annoying, because this means I can't run CLONE_EFFECT inside a COPY_EXISTING_REGEXP GLOB ~.*\.spl~. Which can be severely limiting.

Comments

  • subtledoctorsubtledoctor Member Posts: 11,466
    edited September 2015
    I'm guessing it has something to do with the regexp in the early section of the macro, where "abil_num" is SET, missing this spell. When I copied
        PATCH_IF (check_headers = 0) BEGIN
    SET abil_num = 0
    END ELSE BEGIN
    READ_LONG 0x64 abil_off ELSE 0
    READ_SHORT 0x68 abil_num ELSE 0
    END
    and added it below, in between the first two lines of the later section -
      PATCH_IF (SOURCE_SIZE >= min_size) BEGIN // sanity check
    FOR (index = (0 - check_globals) ; index < abil_num ; ++index) BEGIN // we start at -1 for global effects
    then the macro runs on .SPL files. But, doing this will cause it to break on .CRE files. It is definitely fixable ( @Wisp ) but I don't have time at the moment.

  • argent77argent77 Member Posts: 2,809
    #BONECIR.SPL contains an incorrect resource signature, which might be the cause for the error. It's "SPL\x03" instead of "SPL ".

  • subtledoctorsubtledoctor Member Posts: 11,466
    Ah! Okay. Is that recorded at some offset? I missed it when looking at the file in NI.

    If I can isolate that (presumably easy) then I'll run a quick check in Weidu to find any other similar offenders. Easy enough to just fix them before running the macro.

    (Of course then I have other problems, since I'm running the macro ~450,000 times, which took 40 minutes last night. (In the code above, replace ~CLERIC_PROTECT_FROM_EVIL~ with an array with 300 items, and replace ~#bonecir.spl~ with REGEXP GLOB ~.*\.spl~, and you see the problem.) I need to figure out a way to do this in a more targeted fashion!)

  • argent77argent77 Member Posts: 2,809
    You can easily miss it with the wrong text font in NI. I'm using "Consolas" which shows placeholder symbols for unprintable characters on my system. I've seen only a single spell resource so far (#BONECIR.SPL) with an incorrect signature while browsing through the list.

  • WispWisp Member Posts: 1,102
    @subtledoctor
    Output from CLONE_EFFECT would have been to the effect of
    WARNING: CLONE_EFFECT does not support file type SPL\unprintable_character

    subtledoctor
Sign In or Register to comment.