Jump to content


[Solved] Chanters in Candlekeep


  • Please log in to reply
104 replies to this topic

#61 Mad Mate

Mad Mate
  • Member
  • 191 posts

Posted 08 June 2015 - 05:16 PM

Won't we also get the erroneous Pick Pocket sounds that Ascension mentioned in TobEX?

No, you wont. I mean, not any less then sounds in slot 70 (70 HIDDEN_IN_SHADOWS), 71 (71 SPELL_DISRUPTED)...
They all share same slot as EXISTANCE1,2... sounds.
You can see in this post, explanation by Miloch, how this should work.
In short, PICKED_POCKET sounds are attached to joinables, and EXISTANCE to non-joinables.

It is small chance that chanter, town crier, cow or wolf will pick any pocket. ;)

He did code BGT and TobEX afterall? 

This has nothing to do with BGT. It affects all, BG2, BGT, all mod-added creatures.

So basically our problem is that we don't have an option to disable these sound changes in ToBEx? 
If we had this option within BWS, we could set it off by default so that our precious chanters could sing!  (I really miss those chanters!)

It is part of Core fixes of TOBex.
Is it that hard to edit ini file in notepad?

I guess, BWS could copy fixed TOBexCore.ini at the end of BWS install, if you have TOBex installed.


Edited by Mad Mate, 08 June 2015 - 05:30 PM.


#62 Bill Bisco

Bill Bisco
  • Member
  • 487 posts

Posted 08 June 2015 - 05:55 PM

Is it that hard to edit ini file in notepad?
I guess, BWS could copy fixed TOBexCore.ini at the end of BWS install, if you have TOBex installed.
That would be wonderful! Automatic is what people need!

Come to think of it. This should be a fixpack item for BWP.

Edited by Bill Bisco, 08 June 2015 - 05:58 PM.


#63 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 09 June 2015 - 05:17 AM

Thanks for investigating on this, guys.

 

It's a real shame ToBEx doesn't have a maintainer anymore...



#64 Bill Bisco

Bill Bisco
  • Member
  • 487 posts

Posted 09 June 2015 - 07:36 AM

I sent a pm to Leonardo Watson to include a modified ini for the FIxpack.  Hopefully he'll respond positively.



#65 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 10 June 2015 - 10:38 AM

Hmm, could someone check what they can get with different effects with opcode 294 ? Particularly interest would be a good Constant Value( aka frequency) for each of the chanters ... to speed up the chant starting times.

Say like:
BACKUP ~chanterspeed/backup~
AUTHOR ~The Imp~
BEGIN ~More frequent Chanter songs in BG1:EE and BGT.~

COPY_EXISTING ~voieas.cre~ ~override~
PATCH_IF (SOURCE_SIZE > 0x446) THEN BEGIN
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=294 target=1 timing=1 parameter2=1 END
END 
BUT_ONLY

COPY_EXISTING ~voinor.cre~ ~override~
PATCH_IF (SOURCE_SIZE > 0x446) THEN BEGIN
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=294 target=1 timing=1 parameter2=1 END
END 
BUT_ONLY

COPY_EXISTING ~voisou.cre~ ~override~
PATCH_IF (SOURCE_SIZE > 0x446) THEN BEGIN
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=294 target=1 timing=1 parameter2=1 END
END 
BUT_ONLY

COPY_EXISTING ~voiwes.cre~ ~override~
PATCH_IF (SOURCE_SIZE > 0x446) THEN BEGIN
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=294 target=1 timing=1 parameter2=1 END
END 
BUT_ONLY

COPY_EXISTING ~chante.cre~ ~override~
PATCH_IF (SOURCE_SIZE > 0x446) THEN BEGIN
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=294 target=1 timing=1 parameter2=1 END
END 
BUT_ONLY

Edited by The Imp, 07 July 2015 - 03:45 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#66 Bill Bisco

Bill Bisco
  • Member
  • 487 posts

Posted 07 July 2015 - 02:15 AM

Leonardo pmed me that he included a modified ini.  This issue should be resolved.



#67 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 07 July 2015 - 08:00 AM

Very very cool thread yeah! :coolthumb:

 

So methinks the 'proper' way for this to be fixed is via ToBEx (because it's the one making the radical change) - but since it's usually installed at the top of the load order, seems like something like a mass creature patcher can handle this pretty easy :D (*cough* Lolfixer *cough*)

 

Now if there was an easy way to distinguish between joinables and non-joinables :P


"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#68 K4thos

K4thos
  • Modder
  • 315 posts

Posted 07 July 2015 - 08:22 AM

Now if there was an easy way to distinguish between joinables and non-joinables :P

there is:

COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
    READ_ASCII 0x280 "DV"
    PATCH_IF (NOT FILE_CONTAINS_EVALUATED (~PDIALOG.2DA~ ~^%DV% ~)) BEGIN
        //do something here
    END
BUT_ONLY


#69 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 07 July 2015 - 08:49 AM

Coolio! :cheers: It stripped off most NPCs :D

 

That check didn't catch these though... (note the HAERs :unsure:)

    Line 106: BPIMOEN.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 108: BPJAHEIR.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 110: BPKHALID.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 112: BPMINSC.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 128: C6SAFA.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 174: COW.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 180: COWH.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 210: DPPLAY01.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 212: DPPLAY02.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 318: HAER10.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 322: HAER11.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 326: HAER13.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 330: HAER15.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 334: HAER19.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 400: IMOEN.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 424: JAHEIRD.CRE error: EXISTANCE_5 set for some reason! Please review!
    Line 626: QUAYLEM.CRE error: EXISTANCE_5 set for some reason! Please review!

Edited by Lollorian, 07 July 2015 - 08:51 AM.

"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#70 K4thos

K4thos
  • Modder
  • 315 posts

Posted 07 July 2015 - 09:11 AM

before you do this loop don't forget to use:

COPY_EXISTING ~PDIALOG.2DA~ ~override~
    PRETTY_PRINT_2DA //this will move all DV to the beginning of line and replace tabs with space

and try adding CASE_INSENSITIVE to FILE_CONTAINS_EVALUATED declaration as it's probably related to case problem. If this command doesn't support it (not sure) than use this code instead:

COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
    READ_ASCII 0x280 "DV"
    SET joinable = 0
    INNER_ACTION BEGIN
        COPY_EXISTING - ~PDIALOG.2DA~ ~override~
            PRETTY_PRINT_2DA
            REPLACE_EVALUATE CASE_INSENSITIVE ~^%DV% ~ BEGIN
                SET joinable = 1
            END ~~
    END
    PATCH_IF (joinable = 1 ) BEGIN
        //do something here if joinable
    END ELSE BEGIN
        //do something here if not joinable
    END
BUT_ONLY

should be 100% reliable although probably a little slower

 

edit: added missing ~~


Edited by K4thos, 07 July 2015 - 09:26 AM.


#71 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 07 July 2015 - 10:29 AM

Ok did some trial and error and found that FILE_CONTAINS_EVALUATED is case-insensitive :) The problem with Haer'Dalis was that READ_ASCII reads 8 bytes by default :lol:

 

(So death variable "HaerDalis" becomes "HaerDali" and Haer'Dalis becomes a non-joinable because "HaerDali" is not "HaerDalis" when Haer'Dalis is a joinable NPC :D Yeah screw Haer'Dalis!)

 

Spanking new working patcher code for review:

COPY_EXISTING ~PDIALOG.2DA~ ~override~
  PRETTY_PRINT_2DA
BUT_ONLY_IF_IT_CHANGES
 
COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~ 
  READ_ASCII 0x280 "DV" (32) NULL
 
  PATCH_IF (NOT FILE_CONTAINS_EVALUATED (~PDIALOG.2DA~ ~^%DV% ~)) BEGIN
    READ_LONG  0x1b8 ~soundreplace~
    READ_LONG  0x1bc ~soundreplace2~
    READ_LONG  0x1c0 ~soundreplace3~
    READ_LONG  0x1c4 ~soundreplace4~
    READ_LONG  0x1c8 ~soundreplace5~
    READ_LONG  0x1cc ~soundreplace6~
    
    PATCH_IF ("%soundreplace6%" > 0) THEN BEGIN
      PATCH_PRINT "%SOURCE_FILE% error: EXISTANCE5 set for some reason! Please review!"
    END ELSE PATCH_IF ("%soundreplace5%" > 0 AND "%soundreplace6%" == "-1") THEN BEGIN
      PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE4 -> EXISTANCE5"
      WRITE_LONG 0x1cc %soundreplace5%
      WRITE_LONG 0x1c8 ~-1~
    END
    PATCH_IF ("%soundreplace4%" > 0 AND "%soundreplace5%" == "-1") THEN BEGIN
      PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE3 -> EXISTANCE4"
      WRITE_LONG 0x1c8 %soundreplace4%
      WRITE_LONG 0x1c4 ~-1~
    END
    PATCH_IF ("%soundreplace3%" > 0 AND "%soundreplace4%" == "-1") THEN BEGIN
      PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE2 -> EXISTANCE3"
      WRITE_LONG 0x1c4 %soundreplace3%
      WRITE_LONG 0x1c0 ~-1~
    END
    PATCH_IF ("%soundreplace2%" > 0 AND "%soundreplace3%" == "-1") THEN BEGIN
      PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE1 -> EXISTANCE2"
      WRITE_LONG 0x1c0 %soundreplace2%
      WRITE_LONG 0x1bc ~-1~
    END
    PATCH_IF ("%soundreplace%" > 0 AND "%soundreplace2%" == "-1") THEN BEGIN
      PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : PICKED_POCKET -> EXISTANCE1"
      WRITE_LONG 0x1bc %soundreplace%
      WRITE_LONG 0x1b8 ~-1~
    END
  END
BUT_ONLY_IF_IT_CHANGES

This basically assumes that "joinables" are NPCs that have banter :P (I should probably also just skip the CRE if EXISTANCE5 is already set - it's the BIOGRAPHY entry for the CRE - which usually only joinables have)

 

I'll integrate this into the Lolfixer's Creature Resource Fixer component this weekend with checks for the relevant ToBEx component installed :cheers:


Edited by Lollorian, 07 July 2015 - 10:35 AM.

"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#72 Mad Mate

Mad Mate
  • Member
  • 191 posts

Posted 07 July 2015 - 02:54 PM

Great Lollorian!!!
You are coding god!
Just something should be checked first, from someone how knows to read code of TOBex.
From the time Fiann of the Silver Hand reported possible culprit of this problem, we all assumed that all slots moved 1 place up, from 69th to 74th.
But it is not necessary case. TOBex could move just 69th slot.
Relevant code is in TOBex's github and states:

//Correct 'periodic fidget' existance sound
if (pGameOptionsEx->GetOption("Sound_ExistenceFix")) {

 
//correct func parameter to determine number of available EXISTANCE sounds
char bytes[1] = {0x46};
vDataList.push_back( Data(0x8A3B4A, 1, bytes) );


//correct pointer to EXISTANCE soundset in m_header
bytes[0] = 0xAA;
vDataList.push_back( Data(0x8A3BB6, 1, bytes) );


vPatchList.push_back( Patch(vDataList) );
vDataList.clear();
}

If someone could read what it exactly does, it would be great...



#73 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 07 July 2015 - 06:35 PM

It tella BG2 that the existance sound headers dont start from PICKED_POCKET. I dont have a clue where the new headers are pointed at or how many existance sounds the engine expects now :P

Will experiment tonight :cheers:

"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#74 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 08 July 2015 - 07:37 AM

Tested it out :D And I fucking love the results!!! :lol:

 

Test Case: (Installed ToBEx, BG2Fixpack and BGT)

- Set CHANTE.CRE's PICKED_POCKET sound to CHANTE.CRE's hurt sound (strref #12392)

- Set CHANTE.CRE's EXISTANCE1-5 to strref 10677-10681 (the 5 chants of each chanter in Candlekeep)

- Loaded up my ToB quicksave

- CLUAConsole:CreateCreature('CHANTE') x 25

- PROFIT!1!

 

Baldr000.png

 

Results:

All 5 sounds played (and yes I loved the cacophony of chanting - almost spiritual-like :devil:)

 

Interesting notes:

- EXISTANCE5 played like ToBEx advertises

- The Chanter wasn't hurting (PICKED_POCKET didn't play)

 

Conclusion:

All 5 EXISTANCE sounds are being used now so the shifting the soundslots by 1 seems like the best way to 'fix' this

 

EDIT: Also, according to this, ToBEx moved the window that BG2 uses for EXISTANCE sounds from checking for 0-4 to 1-5 so yeah... +1 to shifting up :D


Edited by Lollorian, 08 July 2015 - 07:39 AM.

"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#75 Bill Bisco

Bill Bisco
  • Member
  • 487 posts

Posted 08 July 2015 - 08:15 AM

So what is different now from TobEx. Do we need to undo the modified ini for ToBEx now?

#76 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 08 July 2015 - 08:46 AM

Yes I'll be removing the ini patch :cheers:

 

New code with checks and other silly stuff :P

 

OUTER_SET existence_fix = 0
ACTION_IF (FILE_EXISTS "TobEx_ini/TobExCore.ini") AND (FILE_CONTAINS "TobEx_ini/TobExCore.ini" "Existence Sound Fix=1") THEN BEGIN
  PRINT "ToBEx Existence Sound Fix is set! Shifting creature EXISTANCE sounds where applicable..."
  OUTER_SET existence_fix = 1
  COPY_EXISTING ~PDIALOG.2DA~ ~override~
    PRETTY_PRINT_2DA
  BUT_ONLY_IF_IT_CHANGES
END
COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
  PATCH_IF (existence_fix == 1) THEN BEGIN
    READ_ASCII 0x280 "DV" (32) NULL
    PATCH_IF (NOT FILE_CONTAINS_EVALUATED (~PDIALOG.2DA~ ~^%DV% ~)) BEGIN
      READ_LONG  0x1b8 ~soundreplace~
      READ_LONG  0x1bc ~soundreplace2~
      READ_LONG  0x1c0 ~soundreplace3~
      READ_LONG  0x1c4 ~soundreplace4~
      READ_LONG  0x1c8 ~soundreplace5~
      READ_LONG  0x1cc ~soundreplace6~
      PATCH_IF ("%soundreplace6%" == "-1") THEN BEGIN
        PATCH_IF ("%soundreplace5%" > 0) THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE4 -> EXISTANCE5"
          WRITE_LONG 0x1cc %soundreplace5%
          WRITE_LONG 0x1c8 ~-1~
        END
        PATCH_IF ("%soundreplace4%" > 0 AND "%soundreplace5%" == "-1") THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE3 -> EXISTANCE4"
          WRITE_LONG 0x1c8 %soundreplace4%
          WRITE_LONG 0x1c4 ~-1~
        END
        PATCH_IF ("%soundreplace3%" > 0 AND "%soundreplace4%" == "-1") THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE2 -> EXISTANCE3"
          WRITE_LONG 0x1c4 %soundreplace3%
          WRITE_LONG 0x1c0 ~-1~
        END
        PATCH_IF ("%soundreplace2%" > 0 AND "%soundreplace3%" == "-1") THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE1 -> EXISTANCE2"
          WRITE_LONG 0x1c0 %soundreplace2%
          WRITE_LONG 0x1bc ~-1~
        END
        PATCH_IF ("%soundreplace%" > 0 AND "%soundreplace2%" == "-1") THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : PICKED_POCKET -> EXISTANCE1"
          WRITE_LONG 0x1bc %soundreplace%
          WRITE_LONG 0x1b8 ~-1~
        END
      END
    END
  END
BUT_ONLY_IF_IT_CHANGES

 

 

Also, have a look at the output from a ToBEx + BG2Fixpack + BGT setup:

Spoiler

 

EDIT: Deed done :D


Edited by Lollorian, 08 July 2015 - 08:56 AM.

"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#77 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 08 July 2015 - 10:20 AM

There was a nice little logic fail in the above code :lol: (it only shifted ONE slot and then moved on to the next CRE)

 

Revised code:

  PATCH_IF (existence_fix == 1) THEN BEGIN
    READ_ASCII 0x280 "DV" (32) NULL
    PATCH_IF (NOT FILE_CONTAINS_EVALUATED (~PDIALOG.2DA~ ~^%DV% ~)) BEGIN
      READ_LONG  0x1b8 ~soundreplace~
      READ_LONG  0x1bc ~soundreplace2~
      READ_LONG  0x1c0 ~soundreplace3~
      READ_LONG  0x1c4 ~soundreplace4~
      READ_LONG  0x1c8 ~soundreplace5~
      READ_LONG  0x1cc ~soundreplace6~
      PATCH_IF ("%soundreplace6%" == "-1") THEN BEGIN
        PATCH_IF ("%soundreplace%" > 0) THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : PICKED_POCKET -> EXISTANCE1"
          WRITE_LONG 0x1b8 ~-1~
          WRITE_LONG 0x1bc %soundreplace%
        END
        PATCH_IF ("%soundreplace2%" > 0) THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE1 -> EXISTANCE2"
          WRITE_LONG 0x1bc %soundreplace%
          WRITE_LONG 0x1c0 %soundreplace2%
        END
        PATCH_IF ("%soundreplace3%" > 0) THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE2 -> EXISTANCE3"
          WRITE_LONG 0x1c0 %soundreplace2%
          WRITE_LONG 0x1c4 %soundreplace3%
        END
        PATCH_IF ("%soundreplace4%" > 0) THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE3 -> EXISTANCE4"
          WRITE_LONG 0x1c4 %soundreplace3%
          WRITE_LONG 0x1c8 %soundreplace4%
        END
        PATCH_IF ("%soundreplace5%" > 0) THEN BEGIN
          PATCH_PRINT "%SOURCE_FILE% error: Soundset moved : EXISTANCE4 -> EXISTANCE5"
          WRITE_LONG 0x1c8 %soundreplace4%
          WRITE_LONG 0x1cc %soundreplace5%
        END
      END
    END
  END


"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#78 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 08 July 2015 - 02:10 PM

I can use that as a minimod to correct a current install, yes?

 

[edit]  Tested.  Works.  Yay.  Lovely to be vindicated.

 

[edit2]  Whoops.  Looks like it's moving stuff when it should be skipping that particular CRE altogether.

 

pre-patch

y3EXp92.jpg

 

post-patch

4joMyfy.jpg

 

I don't know enough about the coding to know why it didn't skip this one.


Edited by Fiann of the Silver Hand, 08 July 2015 - 03:01 PM.


#79 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 08 July 2015 - 03:23 PM

K.  Fixed it.  As I originally said, stuff only needs to be patched if a CRE (nonjoinable) has something in its PP slot, and the patching can just be a straight up move.  No reason to keep checking, just bump everything up.

 

COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
  PATCH_IF (existence_fix == 1) THEN BEGIN
    READ_ASCII 0x280 "DV" (32) NULL
    PATCH_IF (NOT FILE_CONTAINS_EVALUATED (~PDIALOG.2DA~ ~^%DV% ~)) BEGIN
      READ_LONG  0x1b8 ~pickedpocket~
      READ_LONG  0x1bc ~existence1~
      READ_LONG  0x1c0 ~existence2~
      READ_LONG  0x1c4 ~existence3~
      READ_LONG  0x1c8 ~existence4~
      PATCH_IF ("%pickedpocket%" > "0") THEN BEGIN
        WRITE_LONG 0x1cc %existence4%
        WRITE_LONG 0x1c8 %existence3%
        WRITE_LONG 0x1c4 %existence2%
        WRITE_LONG 0x1c0 %existence1%
        WRITE_LONG 0x1bc %pickedpocket%
        WRITE_LONG 0x1b8 ~-1~
      END
    END
  END
BUT_ONLY_IF_IT_CHANGES

Yep, this overwrites E5, but only joinables have this anyway, so it doesn't matter.


Edited by Fiann of the Silver Hand, 08 July 2015 - 03:26 PM.


#80 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 08 July 2015 - 06:20 PM

While I agree with the 'move the entire block' part, I'd be vary of the 'move only when PP is set' part :unsure:

The EXISTANCE2 in your prepatch example is equivalent to the EXISTANCE3 slot after the ToBEx patch. So moving it is probably best way to preserve any inherent properties slots may have (frequency for eg)

All that is imho btw :P I'll change the patch to move only when PP is set if that seems proper to people :)

Also I just thought about something - there would be script commands that call these slots yeah? We'll probably need to move them by 1 as well :lol: (down the endless hole we go now)

Btw, about overwriting E5 slots, there are NPCs that are not present in pdialog.2da for some reason - c6safa for example :unsure:

Edited by Lollorian, 08 July 2015 - 06:25 PM.

"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod