Jump to content


Photo

Setting extra flags for a save?


  • Please log in to reply
2 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 11 March 2018 - 04:46 PM

How can I set extra flags for a saving throw with Weidu, like "Ignore Mirror Image"? They have numbers in double digits, which aren't correctly recognized.

 

By the way, thanks for the link to Weidu documentation I was given once or twice. I thought I had it and it just lacked the information, but then I realized my version was short and obsolete.



#2 Gwendolyne

Gwendolyne
  • Member
  • 258 posts

Posted 02 April 2018 - 12:09 AM

Many months ago, I wrote this WeiDU function for BG+ToBEX or EE :

 

DEFINE_PATCH_FUNCTION ~GW_DEF_OFFSETS_FILE~
    STR_VAR GW_file_sig = ""                 // file type
    RET GW_oe                                // Extended Header offset
        GW_oc                                // Extended Header count
        GW_al                                // Extended Header length (ability length)
        GW_fx                                // Feature blocks offset
        GW_fi                                // Equipping-Casting feature blocks index
        GW_fc                                // Equipping Feature Blocks count
        GW_min_size                          // Minimum size
BEGIN

    PATCH_IF ("%GW_file_sig%" STRING_COMPARE_CASE "") BEGIN SPRINT sig EVAL "%GW_file_sig%" END ELSE BEGIN READ_ASCII 0 sig (3) END
    PATCH_MATCH ~%sig%~ WITH
        ITM    BEGIN SET GW_oe = 0x64        // Extended Header offset
                     SET GW_oc = 0x68        // Extended Header count
                     SET GW_al = 0x38        // Extended Header length (ability length)
                     SET GW_fx = 0x6a        // Feature blocks offset
                     SET GW_fi = 0x6e        // Equipping feature blocks index
                     SET GW_fc = 0x70        // Equipping Feature Blocks count
                     SET GW_min_size = 0x71  // Minimum size
        END
        SPL    BEGIN SET GW_oe = 0x64        // Extended Header offset
                     SET GW_oc = 0x68        // Extended Header count
                     SET GW_al = 0x28        // Extended Header length (ability length)
                     SET GW_fx = 0x6a        // Feature Block Table offset
                     SET GW_fi = 0x6e        // Casting Feature Block offset
                     SET GW_fc = 0x70        // Casting Feature Block count
                     SET GW_min_size = 0x71  // Minimum size
        END
        CRE BEGIN   SET GW_oe = 0            // Extended Header offset
                    SET GW_oc = 0            // Extended Header count
                    SET GW_al = 0            // Extended Header length (ability length)
                    SET GW_fx = 0x2c4        // Effects offset
                    SET GW_fi = 0            // Casting Feature Block offset
                    SET GW_fc = 0x2c8        // Effects count
                    SET GW_min_size = 0x2d3  // Minimum size
        END
        DEFAULT
    END

END    // of DEFINE_PATCH_FUNCTION


DEFINE_PATCH_FUNCTION ~GW_EFFECTS_BYPASS_MIRROR_IMAGE~
BEGIN

    LPF ~GW_DEF_OFFSETS_FILE~ RET GW_oe GW_oc GW_al GW_fx GW_fi GW_fc GW_min_size END
    READ_LONG  GW_oe "abil_off"
    READ_SHORT GW_oc "abil_num"
    READ_LONG  GW_fx "fx_off"
    FOR (i = 0 ; i < abil_num ; ++i) BEGIN

        READ_SHORT ("%abil_off%" + 0x1e + GW_al*i) "abil_fx_num"
        READ_SHORT ("%abil_off%" + 0x20 + GW_al*i) "abil_fx_idx"
        FOR (j = 0 ; j < abil_fx_num ; ++j) BEGIN

            WRITE_LONG (fx_off + 0x24 + (0x30 * (j + abil_fx_idx))) THIS | BIT24  // add Bypass mirror image flag
        END
    END

END    // of DEFINE_PATCH_FUNCTION

 

The way to use it:

 

COPY myfile override

    list of patches

    LPF ~GW_EFFECTS_BYPASS_MIRROR_IMAGE~ END
BUT_ONLY

 



CARPE DIEM ....



In progress : Menace sur le Royaume de Diamant Éternel there.

#3 temnix

temnix
  • Member
  • 983 posts

Posted 02 April 2018 - 06:55 AM

By now I've long used the traditional "separate spell" method.