Jump to content

Semi confusing warning


JediMindTrix

Recommended Posts

The following block of weidu code returns a warning "Warning: no effects were added" (paraphrased). This is true, as effects were only altered or deleted, but I'm curious as to whether I'm doing something wrong.

 

 

//SPL Patching - Dark Taint and Hand of Murder fixes
COPY_EXISTING ~BHAAL2B.spl~ ~override~ //Dark Taint Fixes
LPF ALTER_EFFECT    //Level 1 - 9 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header = 1
  match_opcode = 40
  savebonus = (0 - 2)
END
LPF ALTER_EFFECT    //Level 10 - 12 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header = 2
  match_opcode = 40
  savebonus = (0 - 2)
END

LPF ALTER_EFFECT    //Level 13 - 14 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header = 3
  match_opcode = 40
  savebonus = (0 - 2)
END

LPF ALTER_EFFECT    //Level 15 - 16 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header = 4
  match_opcode = 40
  savebonus = (0 - 2)
END

LPF ALTER_EFFECT    //Level 17 - 20 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header = 5
  match_opcode = 40
  savebonus = (0 - 2)
END

LPF ALTER_EFFECT    //Level 21 - 25 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header = 8
  match_opcode = 40
  savebonus = (0 - 4)
END

LPF ALTER_SPELL_HEADER    //Level 25 Visual Effect Fix
INT_VAR
  match_icon = 1
  header = 8
  projectile = 237
STR_VAR
  resource = SPPR411B
END

LPF DELETE_SPELL_HEADER //Removes extra version of spell that partly breaks progression
INT_VAR
  min_level = 19
END
BUT_ONLY

 

Cheers!

Link to comment

I had the same problem and you will find the reason why here: http://forums.pocketplane.net/index.php/topic,29445.0.html

 

All integer variables except check_globals, check_headers, header and savebonus default to -1 and negative values result in no change to the corresponding field.

 

Briefly, here is the response from wisp:

 

 

 

In 239 you will be able to use the keyword UNDEFINED as a value when declaring functions. The variable will then be undefined in the function's scope, even if it is defined outside the function, unless the user passes a value for the variable when launching the function.

 

Link to comment

Trying to use undefined returns a "cannot convert to integer" error.

LPF ALTER_EFFECT    //Level 1 - 9 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header_type = 1
  header = 1
  multi_match = 1
  verbose = 1
  match_opcode = 40
  match_target = UNDEFINED
  match_power = UNDEFINED
  match_parameter1 = UNDEFINED
  match_parameter2 = UNDEFINED
  match_timing = UNDEFINED
  match_resist_dispel = UNDEFINED
  match_duration = UNDEFINED
  match_probability1 = UNDEFINED
  match_probability2 = UNDEFINED
  match_dicenumber = UNDEFINED
  match_dicesize = UNDEFINED
  match_savingthrow = UNDEFINED
  match_savebonus = UNDEFINED
  match_special = UNDEFINED
  match_resource = UNDEFINED
  savebonus = (0 - 2)
END

EDIT:

Even this returns a warning:

 

LPF ALTER_EFFECT    //Level 1 - 9 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header_type = 1
  header = 1
  multi_match = 1
  verbose = 1
  match_opcode = 40
  match_target = 2
  match_power = 6
  match_parameter1 = 0
  match_parameter2 = 0
  match_timing = 0
  match_resist_dispel = 1
  match_duration = 12
  match_probability1 = 100
  match_probability2 = 0
  match_dicenumber = 0
  match_dicesize = 0
  match_savingthrow = 2
  match_savebonus = 0
  match_special = 0
  match_resource = 0
  opcode = 40
  target = 2
  power = 6
  parameter1 = 0
  parameter2 = 0
  timing = 0
  resist_dispel = 1
  duration = 12
  probability1 = 100
  probability2 = 0
  dicenumber = 0
  dicesize = 0
  savingthrow = 0
  savebonus = (0 - 2)
  special = 0
  STR_VAR
  resource = 0
END
Link to comment

Trying to use undefined returns a "cannot convert to integer" error.

Pmhh...

Try using just this instead:

LPF ALTER_EFFECT    //Level 1 - 9 slow
INT_VAR
  check_globals = 0
  check_headers = 1
  header_type = 1
  header = 1
  multi_match = 1
  verbose = 1
  match_opcode = 40
  savebonus = ~-2~
END

YOU DON'T want to use the UNDEFINED, ever.

Link to comment

 

Copying and patching 1 file ...
[./override/BHAAL2B.spl] loaded, 3506 bytes
WARNING: no effects altered on BHAAL2B.spl
              ~BHAAL2B.spl~   ~override~ // Dark Taint, 0 effect(s) altered
WARNING: no effects altered on BHAAL2B.spl
              ~BHAAL2B.spl~   ~override~ // Dark Taint, 0 effect(s) altered
WARNING: no effects altered on BHAAL2B.spl
              ~BHAAL2B.spl~   ~override~ // Dark Taint, 0 effect(s) altered
WARNING: no effects altered on BHAAL2B.spl
              ~BHAAL2B.spl~   ~override~ // Dark Taint, 0 effect(s) altered
WARNING: no effects altered on BHAAL2B.spl
              ~BHAAL2B.spl~   ~override~ // Dark Taint, 0 effect(s) altered
WARNING: no effects altered on BHAAL2B.spl
              ~BHAAL2B.spl~   ~override~ // Dark Taint, 0 effect(s) altered
Copying and patching 1 file ...
[ascension/bhlspwnpwr/bh3b1.eff] loaded, 272 bytes
override/bh3b2.eff copied to ascension/backup/4/bh3b2.eff, 272 bytes
Copied [ascension/bhlspwnpwr/bh3b1.eff] to [override/bh3b2.eff]
Copying and patching 1 file ...
[ascension/bhlspwnpwr/bh3b1.eff] loaded, 272 bytes
override/bh3b3.eff copied to ascension/backup/4/bh3b3.eff, 272 bytes
Copied [ascension/bhlspwnpwr/bh3b1.eff] to [override/bh3b3.eff]
Copying and patching 1 file ...
[ascension/bhlspwnpwr/bh3b1.eff] loaded, 272 bytes
override/bh3b4.eff copied to ascension/backup/4/bh3b4.eff, 272 bytes
Copied [ascension/bhlspwnpwr/bh3b1.eff] to [override/bh3b4.eff]
Copying and patching 1 file ...
[ascension/bhlspwnpwr/bh3b1.eff] loaded, 272 bytes
override/bh3b5.eff copied to ascension/backup/4/bh3b5.eff, 272 bytes
Copied [ascension/bhlspwnpwr/bh3b1.eff] to [override/bh3b5.eff]
Copying and patching 1 file ...
[ascension/bhlspwnpwr/bh3b1.eff] loaded, 272 bytes
override/balth01a.eff copied to ascension/backup/4/balth01a.eff, 272 bytes
Copied [ascension/bhlspwnpwr/bh3b1.eff] to [override/balth01a.eff]
Processing quests and journals
[./override/bgee.sql] loaded, 49865 bytes
override/bgee.sql copied to ascension/backup/4/bgee.sql, 49865 bytes
Link to comment

As I did not want to wait for WeiDU 239 release, I wrote my own function. You can adapt it to your needs :

DEFINE_PATCH_FUNCTION ~GW_MODIFY_ST_BONUS~
    INT_VAR GW_oldbonus      = "-99"      // old bonus to check
            GW_newbonus      = "-99"      // new bonus to write
BEGIN

    PATCH_IF (GW_oe = 0) BEGIN            // Creatures : NO Extended Headers !
        SET abil_off = 0
        SET abil_num = 0
    END ELSE BEGIN
        READ_LONG  GW_oe abil_off
        READ_SHORT GW_oc abil_num
        READ_LONG  GW_fx fx_off
    END
    FOR (i = 0 ; i < abil_num ; ++i) BEGIN                                          // looks through headers
        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                                  // looks through effects
            READ_LONG (fx_off + 0x24 + (0x30 * (j + abil_fx_idx))) ST               // reads ST
            READ_LONG (fx_off + 0x28 + (0x30 * (j + abil_fx_idx))) savebonus        // reads ST bonus

            PATCH_IF ((GW_oldbonus = savebonus) OR (GW_oldbonus = "-99")) BEGIN
                PATCH_IF ((GW_newbonus != savebonus) AND (GW_newbonus != "-99")) BEGIN
                    WRITE_LONG (fx_off + 0x28 + (0x30 * (j + abil_fx_idx))) GW_newbonus
                END
            END
        END    // of looping through effects
    END        // of looping through heders

END    // of DEFINE_PATCH_FUNCTION

Before, I launch this one :

DEFINE_PATCH_FUNCTION ~GW_DEF_OFFSETS_FILE~
    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

    READ_ASCII 0 sig (3)
    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

You can use them. I did not invent anything. ;)

I use them to alter effects in Extended headers, for both itm and spl files.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...