Author Topic: TP2  (Read 12376 times)

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
TP2
« on: March 31, 2008, 02:37:35 PM »
This is the current released version's .tp2 file, which is basically just v15's with updated translations.

Code: [Select]
the .tp2 contains too many characters to post here
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: TP2
« Reply #1 on: March 31, 2008, 02:38:07 PM »
And this is from Andy's beta version of v16 from last July.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #2 on: April 02, 2008, 09:18:48 AM »
Sweet.

For the big drama components, I've not looked at the Boo quest (I don't have a V12 to look at for rollbacks). The other two likely problem areas are Corrected Bams and Scripts, and Restored Minor Dialogues.

For the first:
Code: [Select]
///////////////////////////////
///////////////////////////////
// Corrected BAMs and Scripts//
///////////////////////////////
///////////////////////////////

BEGIN @50
DESIGNATED 16

/* Remove evil-aligned weaponry */
COPY_EXISTING c6elhan.cre override   /* Remove Elhan's evil-aligned Shazzellim scimitars */
              suelhan.cre override
  REPLACE_CRE_ITEM sw1h22 #0 #0 #0 NONE        WEAPON1 EQUIP
  REPLACE_CRE_ITEM sw1h22 #0 #0 #0 NONE        SHIELD
  REPLACE_CRE_ITEM amul21 #0 #0 #0 UNSTEALABLE AMULET
IF sw1h50
BUT_ONLY

ACTION_IF NOT MOD_IS_INSTALLED setup-bg2fixpack.tp2 0 THEN BEGIN

  /* Corrected Avatars */
  COPY_EXISTING clone1.cre override     /* Ellesime clone in Chateau Irenicus */
    WRITE_LONG 0x28 0x7F31
  BUT_ONLY

  /* Nilthiri */
  COPY_EXISTING drshnl01.bcs override
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~HPLT(Myself,10)~ ~False()~
    COMPILE_BAF_TO_BCS
  BUT_ONLY

  COPY_EXISTING troll01.bcs ~override/drshnl11.bcs~
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~ChangeAnimationNoEffect("TROLL02")~ ~ChangeAnimationNoEffect("%DEST_RES%")~
    COMPILE_BAF_TO_BCS

  EXTEND_TOP drshnl01.bcs ~override/drshnl11.bcs~

  COPY_EXISTING ~drshnl01.cre~ ~override/drshnl21.cre~
    WRITE_ASCII 0x250 ~~ #8
    WRITE_BYTE  0x270 0xff
    WRITE_ASCII 0x2cc ~~ #8

  COPY_EXISTING drshnl01.cre ~override/drshnl11.cre~
    WRITE_SHORT 0x24  0x01
    WRITE_SHORT 0x46  0x0a
    WRITE_SHORT 0x48  0x0a
    PATCH_FOR_EACH resistance IN 0x5a 0x5b 0x5f 0x60 0x61 0x62 0x63 BEGIN
      WRITE_BYTE resistance 0x64
    END
    WRITE_BYTE  0x23c 0x09
    WRITE_BYTE  0x270 0xff
    WRITE_ASCII 0x248 drshnl21
    WRITE_ASCII 0x250 ~~ #32
    WRITE_ASCII 0x2cc ~~ #8
    REPLACE_CRE_ITEM trolldie #0 #0 #0 NONE LRING
    REPLACE_CRE_ITEM trolldie #0 #0 #0 NONE RRING

  COPY_EXISTING troll02.bcs ~override/drshnl21.bcs~
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~ReallyForceSpell(Myself,TROLL_CHANGE)~ ~ReallyForceSpellRES("drshnl21",Myself)~
    COMPILE_BAF_TO_BCS

  COPY_EXISTING drshnl01.cre override
    WRITE_ASCII  0x248 drshnl11
    WRITE_ASCII  0x258 drshnl01
    ADD_CRE_ITEM monhp1 #0 #0 #0 NONE AMULET

  COPY_EXISTING spin955.spl ~override/drshnl21.spl~
    READ_LONG   0x64 ho
    READ_LONG   0x68 eo
    FOR (READ_SHORT 0x68 hc; hc; hc -= 0x01) BEGIN
      READ_SHORT  ho + 0x28 * hc - 0x08 ei
      FOR (READ_SHORT  ho + 0x28 * hc - 0x0a ec; ec; ec -= 0x01) BEGIN
        READ_SHORT  eo + 0x30 * (ei + ec) - 0x30 opcode
        READ_ASCII  eo + 0x30 * (ei + ec) - 0x1c resref
        PATCH_IF opcode = 0x97 && ~%resref%~ STRING_EQUAL_CASE troll01 BEGIN
          WRITE_ASCII  eo + 0x30 * (ei + ec) - 0x1c drshnl21
        END
      END
    END

  /* Assigns amalas.bcs as his override script */
  COPY_EXISTING ruffian.cre override
    WRITE_ASCII 0x248 amalas #8
  BUT_ONLY

  /* Corrected Inventory BAMs */
  COPY_EXISTING famfair.itm override    /* Fairy Dragon Familiar */
                fampsd.itm  override    /* Pseudodragon Familiar */
    WRITE_ASCII 0x3a fampsd #8
  BUT_ONLY

  ACTION_IF GAME_IS ~tob~ THEN BEGIN
    COPY_EXISTING famfai25.itm override /* Fairy Dragon Familiar (ToB) */
                  fampsd25.itm override /* Pseudodragon Familiar (ToB) */
      WRITE_ASCII 0x3a fampsd #8
    BUT_ONLY
  END

END

In general add #8 to WRITE_ASCII unless it's a death variable, then #18. BUT_ONLY constrain everything. Using MOD_IS_INSTALLED will keep redundancy from ever causing problems. Elhan can't die or have his weapons stolen; the net in game effect of swapping Shazzelim is a potential to stall if he gets silenced by a Rakshasa and can't initiate one of his dialogues, so you'll probably want to give him something else to cover for that.

/edited for randomness
« Last Edit: April 02, 2008, 04:51:54 PM by Nythrun »

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #3 on: April 02, 2008, 09:25:16 AM »
For Restored Minor Dialogues, was there some fracas with the Planar Sphere halflings? I vaguely remember one, but I'm not seeing it after a (cursory) inspection.
Code: [Select]
////////////////////////////
////////////////////////////
// Restored Minor Dialogs //
////////////////////////////
////////////////////////////

BEGIN @54
DESIGNATED 18

COMPILE ~ub/dialogs/u!minor.d~
        ~ub/dialogs/obshal03.d~
USING   ~ub/tra/%s/ubdialog.tra~

COPY_EXISTING obshal04.cre override
  WRITE_ASCII 0x0250 ~~ #8 // Shouldn't have OBSHAL01 script
BUT_ONLY

<<<<<<<<.../ub/halflings/fixer.baf
IF
  See([2])
  Global("TALKED","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("TALKED","LOCALS",1)
    StartDialogueNoSet(LastSeenBy(Myself))
END
>>>>>>>>

EXTEND_TOP obshal01.bcs ~.../ub/halflings/fixer.baf~

EXTEND_TOP obshal03.bcs ~.../ub/halflings/fixer.baf~

<<<<<<<<.../ub/halflings/fixer.d
REPLACE obshal01
  IF
    ~~ 1
  SAY #33115
    IF
      ~~ EXIT
  END
  IF
    ~~ 2
  SAY #33116
    IF
      ~~ EXIT
  END
  IF
    ~~ 3
  SAY #33117
    IF
      ~~ EXIT
  END
END

REPLACE obshal03
  IF
    ~NumTimesTalkedTo(0)~ 0
  SAY #33118
    + ~~ + #33119 + 2
    + ~~ + #33120 + 1
    + ~~ + #33122 + 3
    + ~InParty("MINSC")~ + #33133 EXTERN ~MINSCJ~ 63
  END
  IF
    ~~ 1
  SAY #33121
    IF
      ~~ EXIT
  END
  IF
    ~~ 2
  SAY #33123
    IF
      ~~ EXIT
  END
  IF
    ~~ 3
  SAY #33124
    IF
      ~~ EXIT
  END
  IF
    ~~ 4
  SAY #33135
    IF
      ~~ EXIT
  END
END
>>>>>>>>

COMPILE ~.../ub/halflings/fixer.d~

// Replaces duplicate DOCSOL02 with DOCSOL03 in Docks Barracks
COPY_EXISTING ar0332.are override
  READ_LONG 0x54 act_off
  FOR (READ_SHORT 0x58 act_num; act_num; act_num -= 0x01) BEGIN
    READ_ASCII act_off + 0x110 * act_num - 0x90 cre
    PATCH_IF ~%cre%~ STRING_EQUAL_CASE docsol02 BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x90 docsol03
      SET act_num = 0x01
    END
  END
BUT_ONLY

//Simyaz and the Silver Sword in the Underdark.
<<<<<<<<ub/udsimyaz_reaction.d
REPLACE_TRIGGER_TEXT udsimyaz ~ReactionGT(LastTalkedToBy,FRIENDLY_UPPER)~ ~Reaction(LastTalkedToBy,FRIENDLY_UPPER)~
>>>>>>>>

COMPILE ~ub/udsimyaz_reaction.d~

ACTION_IF NOT MOD_IS_INSTALLED setup-bg2fixpack.tp2 0 THEN BEGIN
 
  //Glaicas Charm bug fix
  COPY_EXISTING ar1303.bcs override
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~^    \(ActionOverride("kpglai01",\|\)ApplySpell("kpglai01",WIZARD_TRUE_DISPEL_MAGIC)\()\|\)$~ ~    \1ApplySpell("kpglai01",FORCE_DISPEL_MAGIC)\2~
    COMPILE_BAF_TO_BCS
  BUT_ONLY
 
  //Imoen213 script
  COPY_EXISTING imoen213.cre override
     WRITE_ASCII 0x248 ~imoen2~ #8
  BUT_ONLY
 
  // Count Claylan and Lady Alicia
  COPY_EXISTING wcust01.cre override
                wcust02.cre override
    WRITE_ASCIIE 0x280 ~%SOURCE_RES%~ #18
  BUT_ONLY
 
  //devSin's code for load hints
  ACTION_IF GAME_IS ~tob~ THEN BEGIN // ToB-only stuff check
    APPEND loadh25.2da  ~79          34572~
    UNLESS ~^79[         ]+~
    APPEND loadhint.2da ~75          34572~
    UNLESS ~^75[         ]+~
    APPEND loadhint.2da ~76          72818~
    UNLESS ~^76[         ]+~
  END

END

Dumping more stuff into an "only if no Fixpack" ghetto. Writing to absolute offsets in areas is not so great. No need for a full decomp on Simyaz (won't really matter, but hey). The Glaicus match should be stricter so it doesn't has stuff when some (non-Fixpack) has already ActionOverride() his dispel. WRITE_ASCII #8; BUT_ONLY. /b won't work in UNLESS regexps after numerals because OCAML regexp has not been updated since it was used to construct the Great Pyramids of Egypt.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #4 on: April 02, 2008, 09:31:15 AM »
What the heck, we're rolling on.
Code: [Select]
///////////////////////
///////////////////////
// Item Restorations //
///////////////////////
///////////////////////

BEGIN @30
DESIGNATED 12

/* Prebek's Home */
COPY_EXISTING ar0407.are override
  READ_ASCII  0x94 area_script
  PATCH_IF NOT FILE_EXISTS_IN_GAME ~%area_script%.bcs~ BEGIN
    SPRINT area_script ar0407
    WRITE_ASCII 0x94 ar0407 #8
  END
BUT_ONLY

EXTEND_TOP ~%area_script%.bcs~ ~ub/items/u!0407.baf~ /* Prebek's Home, Shazzellim, Container 3, Item 1 */


/* Places Arbane's Sword on Eldarin */
/* Suna Seni still has hers
COPY_EXISTING reeldar.cre override
  ADD_CRE_ITEM sw1h27 #0 #0 #0 NONE WEAPON2
BUT_ONLY
*/

/* Wolfskin Bag */
COPY_EXISTING bag01.itm override
  READ_LONG  0x18 flags
  WRITE_LONG 0x18 flags | 0x01
  SAY NAME1 @31
  SAY NAME2 @31
  SAY UNIDENTIFIED_DESC @32
  SAY IDENTIFIED_DESC   @32
BUT_ONLY

/* Wolfskin Bag - related .sto file */
COPY_EXISTING bag01.sto override
  WRITE_SHORT 0x22 0x0a          /* Change bag capacity from 5 to 10 */
  SAY STORE_NAME @31
BUT_ONLY

/* The Copper Coronet, places the Wolfskin Bag on the Beastmaster */
COPY_EXISTING beast.cre override
  ADD_CRE_ITEM bag01 #0 #0 #0 NONE INV1

/* Shazzellim */
COPY_EXISTING sw1h50.itm  override
  READ_LONG  0x1e unusability
  WRITE_LONG 0x1e unusability | 0x04  /* Restrict Good-aligned */
  SAY IDENTIFIED_DESC @33             /* Altered description for Shazzellim */
BUT_ONLY

/* Bala's Axe */
COPY_EXISTING ax1h07.itm override
  WRITE_SHORT 0x42 0x28
BUT_ONLY

EXTEND_BOTTOM ar0413.bcs ~ub/items/u!0413.baf~ /* Planar Sphere, Engine Room, Bala's Axe, Container 1 */

/* Wraithform */
COPY ~ub/items/spwi315.spl~  override /* Wraithform spell file */
     ~ub/items/u!scrl03.itm~ override /* Wraithform scroll item file */
  SAY NAME1 #12020
  SAY NAME2 #12020
  SAY UNIDENTIFIED_DESC #12144
  SAY IDENTIFIED_DESC   #12144

COPY_EXISTING scrolls.sto override // The Pen and Parchment Store
  ADD_STORE_ITEM u!scrl03 BEFORE scrl1t #1 #0 #0 IDENTIFIED #5

/* Boots of the West */
COPY ~ub/items/misc8j.itm~ override
  SAY NAME1             #43877
  SAY NAME2             #43877
  SAY UNIDENTIFIED_DESC #43878
  SAY IDENTIFIED_DESC   #43878

/* Umar Hills, places the Boots of the West on Derrick */
COPY_EXISTING valran01.cre override
  ADD_CRE_ITEM misc8j #0 #0 #0 NONE BOOTS

/* Boots of Hastened Departure */
COPY_EXISTING boot09.itm override
  SAY NAME2           @97
  SAY IDENTIFIED_DESC @98
  READ_LONG 0x64 ho
  FOR (READ_SHORT 0x68 hc; hc; hc -= 0x01)
    READ_ASCII ho + 0x38 * hc - 0x34 icon
    PATCH_IF ~%icon%~ STRING_EQUAL ~~ || ~%icon%~ STRING_EQUAL_CASE none BEGIN
      WRITE_ASCII ho + 0x38 * hc - 0x34 cboot09 #8
    END
  END
BUT_ONLY

/* Adds the Boots of Hastened Departure to Greyhand */
ACTION_IF FILE_EXISTS_IN_GAME greyhand.cre THEN BEGIN
  COPY_EXISTING greyhand.cre override
    REPLACE_CRE_ITEM boot09 #0 #0 #0 NONE BOOTS
  BUT_ONLY
END

ACTION_IF NOT MOD_IS_INSTALLED setup-bg2fixpack.tp2 0 THEN BEGIN

  // wallag's stuff now available -from fixpack
  <<<<<<<< .../ub/baf/ar1403.baf
  IF
    Global("CDDropStuff","AR1403",0)
  THEN
  RESPONSE #100
    SetGlobal("CDDropStuff","AR1403",1)
    ActionOverride("shabod01",DropInventory())
    Continue()
  END
  >>>>>>>>
  EXTEND_TOP ~ar1403.bcs~ ~.../ub/baf/ar1403.baf~
 
  // make wallag a permanent corpse
  COPY_EXISTING shabod01.cre override
    READ_BYTE  0x10 flags
    WRITE_BYTE 0x10 flags || 0x04
  BUT_ONLY

END

Simple solution to OMG YOU CHANGED TEH NONEXISTENT AREA SCRIPT EVERYTHINGS RUINED mess; it won't actually make anyone happy. Do you want to give Eldarin a copy of Arbane without taking away Suna Seni's? Wolfskin Bag should probably be unsellable (selling stores is bad). Adding Wraithfom is going to push a third level spell off of the selection menu for sorcerers (this level is already full) - not sure what you want done about that, if anything. Boots of the West need to be copied to misc8j.itm rather than just misc8j or your patches are wasted.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #5 on: April 02, 2008, 09:33:23 AM »
Blah blah blah
Code: [Select]
///////////////////////////////
///////////////////////////////
// Corrected Character Names //
///////////////////////////////
///////////////////////////////

BEGIN @53
DESIGNATED 17

/* Malaaq, the genie */
COPY_EXISTING idjinni.cre  override
  SAY NAME1 @36
  SAY NAME2 @36
BUT_ONLY

/* Hendron, Lady Delcia's guard */
COPY_EXISTING kpsold01.cre override
  SAY NAME1 @37
  SAY NAME2 @37
BUT_ONLY

/* Hannah, the circus attendant */
COPY_EXISTING kftown01.cre override
  SAY NAME1 #20626
  SAY NAME2 #20641
BUT_ONLY

/* Lellyn, Mazzy's fallen compatriot */
COPY_EXISTING lellyn.cre   override
  SAY NAME1 @38
  SAY NAME2 @38
BUT_ONLY

/* The omnipresent Town Crier Neckeith */
/*
COPY_EXISTING townc01.cre  override
  SAY NAME1 @57
  SAY NAME2 @57
BUT_ONLY
*/

/* Shadow Thief Assassin */
COPY_EXISTING stass1.cre   override
  SAY NAME1 @58
  SAY NAME2 @58
BUT_ONLY

/* Shadow Thief Archer */
COPY_EXISTING starcher.cre override
              arnfgt03.cre override
              flyfgt03.cre override
              arnwar01.cre override
              irethf04.cre override
  SAY NAME1 @59
  SAY NAME2 @59
BUT_ONLY

/* Shadow Thief Footpad */
COPY_EXISTING arnwar04.cre override
  SAY NAME1 @60
  SAY NAME2 @60
BUT_ONLY

/* Shadow Thief Thug */
COPY_EXISTING arnfgt04.cre override
              arnwar02.cre override
  SAY NAME1 @61
  SAY NAME2 @61
BUT_ONLY

/* Shadow Thief Guard */
COPY_EXISTING flyfgt02.cre override
  SAY NAME1 @62
  SAY NAME2 @62
BUT_ONLY

/* Shadow Thief Inquisitor */
COPY_EXISTING flyfgt04.cre override
  SAY NAME1 @63
  SAY NAME2 @63
BUT_ONLY

/* Shadow Thief Battlemage */
COPY_EXISTING irethf05.cre override
  SAY NAME1 @64
  SAY NAME2 @64
BUT_ONLY

/* Amon of the Purple Brotherhood */
COPY_EXISTING sevpat02.cre override
  SAY NAME1 @65
  SAY NAME2 @65
BUT_ONLY

/* Alatelo De Bonito */
COPY_EXISTING sevdru01.cre override
  WRITE_SHORT 0x273 0x01            /* Changes class from Innocent to Mage */
BUT_ONLY

ACTION_IF NOT MOD_IS_INSTALLED setup-bg2fixpack.tp2 0 THEN BEGIN

  /* Apprentice Torturer Douglas */
  COPY_EXISTING arnboy01.cre override
    SAY NAME1 #38998
    SAY NAME2 #38998
  BUT_ONLY

  /* Crazyface, Korgan's old cohort */
  COPY_EXISTING korcrazy.cre override
    SAY NAME1 #30508
    SAY NAME2 #30509
  BUT_ONLY

  /* Pimlico Guard */
  COPY_EXISTING korpimg1.cre override
    SAY NAME1 #30490
    SAY NAME2 #30490
  BUT_ONLY

  /* Maheer, the Blacksmith */
  COPY_EXISTING shop03.cre   override
    SAY NAME1 #23302
    SAY NAME2 #23303
  BUT_ONLY

  /* Derrick, the ranger */
  COPY_EXISTING valran01.cre override
    SAY NAME1 #2190
    SAY NAME2 #2190
  BUT_ONLY

  /* Post Spellhold Imoen Biography */
  ACTION_FOR_EACH imoen_cre IN imoen211.cre imoen215.cre imoen15.cre BEGIN
    ACTION_IF FILE_EXISTS_IN_GAME ~%imoen_cre%~ THEN BEGIN
      COPY_EXISTING ~%imoen_cre%~ override
        WRITE_LONG 0x1cc 0xb16
      BUT_ONLY
    END
  END

END

There's only one town crier, so it looks odd seeing the same character in every city. You can skip the regexp on the Imoen Bio. BUT_ONLY plz.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #6 on: April 02, 2008, 09:36:25 AM »
I cannot shut up
Code: [Select]
//////////////////////////////////
//////////////////////////////////
// Corrected "Xzar's Creations" //
//////////////////////////////////
//////////////////////////////////

BEGIN @52
DESIGNATED 9

<<<<<<<<.../ub/ding0/prebek/d0xgolem.baf
IF
  !Allegiance("XAPPREN1",ENEMY)
  !Allegiance("XAPPREN2",ENEMY)
  !Dead("XAPPREN1")
  !Dead("XAPPREN2")
THEN
  RESPONSE #100
    NoAction()
END
>>>>>>>>

COMPILE ~.../ub/ding0/prebek/d0xgolem.baf~

COPY ~ub/xzar/xgolem1.cre~ override
  SAY NAME1 #12886
  SAY NAME2 #12886
  WRITE_ASCII 0x248 d0xgolem
  WRITE_ASCII 0x268 wtasight

COPY_EXISTING ar0407.are override
  READ_LONG 0x54 act_off
  FOR (READ_SHORT 0x58 act_num; act_num; act_num -= 0x01) BEGIN
    READ_ASCII act_off + 0x110 * act_num - 0x90 cre
    PATCH_IF          ~%cre%~ STRING_EQUAL_CASE icgob01 BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 Ghast   #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 xghast1 #8
    END ELSE PATCH_IF ~%cre%~ STRING_EQUAL_CASE icgob02 BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 ~Flesh Golem~ #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 xgolem  #8
    END ELSE PATCH_IF ~%cre%~ STRING_EQUAL_CASE icgob03 BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 Ghast   #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 xghast2 #8
    END
  END
BUT_ONLY



Looks like you're compiling an xgolem script and then adding a creature expecting an d0xgolem script? Absolute offsets in .are patches = bad.

Bleh, gotta go.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #7 on: April 02, 2008, 11:10:43 AM »
Couple more while I've got time:
Code: [Select]
/////////////////////////
/////////////////////////
// Restored Encounters //
/////////////////////////
/////////////////////////

BEGIN @29
DESIGNATED 7

/* Vampire Encounters */
EXTEND_BOTTOM vampsttp.bcs ~ub/encount/U!vamps.baf~

COPY_EXISTING vvbodhi.cre override
  REPLACE_CRE_ITEM minhp20 #0 #0 #0 NONE RRING
BUT_ONLY

/* The Muggers in the Slums */
COPY_EXISTING mugger3.cre override
  WRITE_ASCII 0x280 mugger3 #18    /* Correct the death variable */
BUT_ONLY

/* The Slums */
EXTEND_BOTTOM ar0400.bcs ~ub/encount/u!0400.baf~

COMPILE ~ub/encount/slumvic.baf~

/* Reputation Trap */
EXTEND_TOP amntrp01.bcs ~ub/encount/U!gtrap.baf~

COMPILE ~ub/encount/repthf1.d~
USING   ~ub/tra/%s/ubdialog.tra~

/* Restored Hell Hound Encounters */
COPY_EXISTING ar0412.are override /* Planar Sphere Elemental Rooms */
  READ_LONG 0x54 act_off
  FOR (READ_SHORT 0x58 act_num; act_num; act_num -= 0x01) BEGIN
    READ_ASCII act_off + 0x110 * act_num - 0x90 cre
    PATCH_IF          ~%cre%~ STRING_EQUAL_CASE icsalcol && act_num = 0x0c BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 ~Winter Wolf~ #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 obsice03
    END ELSE PATCH_IF ~%cre%~ STRING_EQUAL_CASE icsalcol && act_num = 0x0d BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 ~Snow Troll~  #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 obsice01
    END ELSE PATCH_IF ~%cre%~ STRING_EQUAL_CASE icsalcol && act_num = 0x0e BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 ~Snow Troll~  #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 obsice01
    END ELSE PATCH_IF ~%cre%~ STRING_EQUAL_CASE icsalfir && act_num = 0x0f BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 ~Hell Hound~  #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 obsfir05
    END ELSE PATCH_IF ~%cre%~ STRING_EQUAL_CASE icsalfir && act_num = 0x10 BEGIN
      WRITE_ASCII act_off + 0x110 * act_num - 0x110 ~Hell Hound~  #32
      WRITE_ASCII act_off + 0x110 * act_num - 0x090 obsfir05
    END
  END
BUT_ONLY

COMPILE ~ub/hounds/houndtrp.baf~  /* Unseeing Eye Cult area, Hellhound Ambush trigger */

/* The Greyhand Encounter */
COMPILE ~ub/greyhand/u!gryhnd.d~
        ~ub/greyhand/u!gryhnd.baf~
USING   ~ub/tra/%s/ubdialog.tra~

COPY ~ub/greyhand/greyhand.cre~ override
  SAY NAME1 @56
  SAY NAME2 @56

COPY_EXISTING ar1600.are override /* Adds Greyhand to Brynnlaw */
  READ_LONG    0x54 act_off
  READ_SHORT   0x58 act_num
  WRITE_SHORT  0x58 act_num + 0x01
  INSERT_BYTES act_off + 0x110 * act_num + 0x00 0x110
  WRITE_ASCII  act_off + 0x110 * act_num + 0x00 Greyhand
  WRITE_SHORT  act_off + 0x110 * act_num + 0x20 0xa87
  WRITE_SHORT  act_off + 0x110 * act_num + 0x22 0xac
  WRITE_SHORT  act_off + 0x110 * act_num + 0x24 0xa87
  WRITE_SHORT  act_off + 0x110 * act_num + 0x26 0xac
  WRITE_LONG   act_off + 0x110 * act_num + 0x30 0x6000
  WRITE_LONG   act_off + 0x110 * act_num + 0x34 0x03
  WRITE_LONG   act_off + 0x110 * act_num + 0x38 0xffffffff
  WRITE_LONG   act_off + 0x110 * act_num + 0x40 0xffffffff
  WRITE_ASCII  act_off + 0x110 * act_num + 0x80 greyhand
  PATCH_FOR_EACH off IN
    0x5c 0x60 0x68 0x70 0x78 0x7c 0x84 0x88 0xa0 0xa8 0xb0 0xb8 0xbc 0xc0 0xc4 0xcc
  BEGIN
    READ_LONG  off set
    WRITE_LONG off set > act_off ? set + 0x110 : set < 0x11c ? 0x11c : set
  END

// Restored Olive Jellies in Ust Natha
COPY_EXISTING jeloch01.cre ~override/jeloli01.cre~
  SAY NAME1 ~Olive Slime~
  SAY NAME2 ~Olive Slime~
  WRITE_LONG  0x014 0x1a4
  WRITE_SHORT 0x028 0x7901
  WRITE_BYTE  0x273 0x96
  WRITE_ASCII 0x280 jeloli01
  REPLACE_CRE_ITEM jellol1 #0 #0 #0 NONE WEAPON1 EQUIP

COPY_EXISTING ghoul1.itm ~override/jellol1.itm~
  PATCH_FOR_EACH description IN 0x08 0x0c 0x50 0x54 BEGIN
    WRITE_LONG description 0x286c
  END
  WRITE_LONG  0x18 0x20
  WRITE_ASCII 0x3a ~~ #8
  READ_LONG   0x64 ho
  FOR (READ_SHORT 0x68 hc; hc; hc -= 0x01) BEGIN
    WRITE_ASCII ho + 0x38 * (hc - 0x01) + 0x04 ~~ #8
    WRITE_SHORT ho + 0x38 * (hc - 0x01) + 0x0e 0x14
    WRITE_SHORT ho + 0x38 * (hc - 0x01) + 0x16 0x02
    WRITE_SHORT ho + 0x38 * (hc - 0x01) + 0x18 0x00
    WRITE_SHORT ho + 0x38 * (hc - 0x01) + 0x2a 0x6c
  END

ACTION_IF MOD_IS_INSTALLED setup-bg2fixpack.tp2 110 THEN BEGIN
  COPY_EXISTING ar2200.bcs override
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~CreateCreature("[^"]*",\[4422\.3524\],6)~ ~CreateCreature("jeloli01",[4422.3524],6)~
      REPLACE_TEXTUALLY ~CreateCreature("[^"]*",\[4052\.3574\],6)~ ~CreateCreature("jeloli01",[4052.3574],6)~
    COMPILE_BAF_TO_BCS
  BUT_ONLY
END

//AR2400 spawns
COPY_EXISTING ar2400.are   override
  READ_LONG 0xc0 rest_off
  WRITE_LONG rest_off + 0x40 0x2796
  FOR (i1 = 0x48; i1 < 0x78; i1 += 0x08) BEGIN
    WRITE_ASCII rest_off + i1 umbhul01
  END
  WRITE_ASCII rest_off + 0x78 uddwarf #32
  WRITE_SHORT rest_off + 0x98 0x07
BUT_ONLY



Old Bohdi patch is very dangerous. WRITE_ASCII #. Area patches shouldn't use absolute offsets. No need to clog up in game scripts when you can clog your own .tp2. Is there a reason not to use the olive slime animation?
« Last Edit: April 12, 2008, 06:28:10 PM by Nythrun »

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #8 on: April 02, 2008, 11:11:52 AM »
Code: [Select]
///////////////////////////
///////////////////////////
// Restored Hell Minions //
///////////////////////////
///////////////////////////

/* AUTHOR ~SimDing0, simding0@pocketplane.net~ */

BEGIN @66
DESIGNATED 10

COPY_EXISTING hellslay.cre override
  WRITE_ASCII 0x250 helljon #8
BUT_ONLY

COPY_EXISTING jondem01.cre override
              jondem03.cre override
  WRITE_ASCIIE 0x248 ~%SOURCE_RES%~ #8
  WRITE_ASCII  0x250 demgaj #8
BUT_ONLY

COPY_EXISTING jondem02.cre override
              jondem04.cre override
  WRITE_SHORT  0x028 0x7f2e
  SAY          NAME1 #39382
  SAY          NAME2 #39382
  WRITE_ASCIIE 0x248 ~%SOURCE_RES%~ #8
  WRITE_ASCII  0x250 demptj #8
  WRITE_BYTE   0x27b 0x13
BUT_ONLY

ACTION_IF GAME_IS ~tob~ THEN BEGIN
  COPY_EXISTING jondem01.cre override
                jondem03.cre override
                jondem05.cre override
    WRITE_SHORT 0x28 0xe0f1
  BUT_ONLY
END



WRITE_ASCII # is a lovely motif.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #9 on: April 02, 2008, 11:12:33 AM »
Code: [Select]
///////////////////////////
///////////////////////////
// Gorf the Squisher Fix //
///////////////////////////
///////////////////////////

/* AUTHOR ~Gebhard Blucher, g_blucher@yahoo.com~ */

BEGIN @71
DESIGNATED 11
FORBID_COMPONENT setup-bg2fixpack.tp2 0 ~~

COMPILE ~ub/gorf/gorf.baf~



Skip if Fixpack.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #10 on: April 02, 2008, 11:14:40 AM »
Code: [Select]
////////////////////////////////
////////////////////////////////
// Restored Crooked Crane Inn //
////////////////////////////////
////////////////////////////////

BEGIN @28
DESIGNATED 6

COMPILE ~ub/crane/u!ccrane.d~
USING   ~ub/tra/%s/ubdialog.tra~

/* Corrected Crooked Crane, Level One */
COPY_EXISTING ar0021.are override
  READ_ASCII 0x94 area_script
  PATCH_IF NOT FILE_EXISTS_IN_GAME ~%area_script%.bcs~ BEGIN
    SPRINT area_script ar0021
    WRITE_ASCII 0x94 ar0021 #8
  END
BUT_ONLY

EXTEND_BOTTOM ~%area_script%.bcs~ ~ub/crane/AR0021.baf~

/* Crooked Crane, Level Two */
EXTEND_BOTTOM ar0022.bcs ~ub/crane/u!0022.baf~



If that doesn't make Baronius happy....

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #11 on: April 02, 2008, 11:54:02 AM »
By the way, this is posted more in the spirit of "take anything that looks appealing and adapt it" than it is "do everything my way"  ;)

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #12 on: April 02, 2008, 12:48:10 PM »
You may also want to use FILE_EXISTS_IN_GAME sarev25.bcs rather than FILE_EXISTS ~override/sarev25.bcs~ as people do have an unfortunate habit of needlessly biffing files.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: TP2
« Reply #13 on: April 02, 2008, 04:00:18 PM »
Awww heck:

#18 for DVs, or #32? Do we not need to clear the whole space?

    WRITE_ASCII 0x280 ~x#belgin~ #32 //DV

(I think it is both DV and SPRITE_IS_DEAD, but for whatever reason, one of the first Big Moddarz suggestions was to use #8 for scripts etc. and #32 for death variables.)

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: TP2
« Reply #14 on: April 02, 2008, 04:16:49 PM »
Unless your script name is 18 characters or longer (i.e., not 17 or less), it doesn't actually matter. But there's nothing wrong with #32.

Unless you have mongo script names, however, WRITE_ASCIIT is all kinds of hot.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #15 on: April 02, 2008, 05:00:41 PM »
The script name field is 32 bytes long - but in order for SPRITE_IS_DEAD to not truncate the script name, it needs to be no more than 18 characters. There aren't any files in Baldur's Gate where that's a problem, so if there ever ends up being a difference, it's because a modder goofed somewhere.

What you don't want to do is WRITE_ASCII offset ~abc~ on top of a ~1234~ field and end up with ~abc4~, so it's always safer to wipe more than less - my disuse of WRITE_ASCIIT is purely cosmetic and has nothing to do with the engine's ability to stop reading at a null.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: TP2
« Reply #16 on: April 02, 2008, 06:46:14 PM »
Cool - so

#18 is safe, unless someone creates a dv of C-MyPersonalNPClongDV  (in which case they should be locked up)

#32 is the full field but does no real harm

and both can be avoided by using a terminating null via

WRITE_ASCII_TERMINATE

and the undocumented but easily-picked-up-from-reading-other-folks-code-and-devsin's-posts

WRITE_ASCIIT

We might want to toss the WRITE_ASCIIT and WRITE_ASCIIE in the main ReadMe - or not; I don't know how many folks using those won't have already bugged the experts/read the posts/figured it out. Even I can figure out and copy/use    WRITE_ASCIIE 0x280 ~%DEST_RES%~ #32 // death variable


Sorry. Nothing for you, Icelus - I am still digesting these suggestions for my own info. Returning you to your regularly scheduld bughunt...

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: TP2
« Reply #17 on: April 02, 2008, 07:11:09 PM »
Thank you immensely, Nythrun!  I'll try to comment on some of your edits soon, but overall... holycrapthanks!
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: TP2
« Reply #18 on: April 02, 2008, 07:50:38 PM »
Which version of the .tp2 did you use, just out of curiosity?

Elhan can't die or have his weapons stolen; the net in game effect of swapping Shazzelim is a potential to stall if he gets silenced by a Rakshasa and can't initiate one of his dialogues, so you'll probably want to give him something else to cover for that.
I'll look into that.  If it becomes a huge ordeal, I'll just remove that component.

Quote from: Nythrun
For Restored Minor Dialogues, was there some fracas with the Planar Sphere halflings?
Once upon a time I believe there was, but I think I fixed it a few versions back.

Quote from: Nythrun
Writing to absolute offsets in areas is not so great.
Yeah, I know, but back in the day WHILE loops and stuff were fairly new and I've never been able to wrap my head around them.

Quote from: Nythrun
The Glaicus match should be stricter so it doesn't has stuff when some (non-Fixpack) has already ActionOverride() his dispel.
I think it's time to remove Glaicas altogether from UB.  Same with Gorf.

Quote from: Nythrun
Do you want to give Eldarin a copy of Arbane without taking away Suna Seni's? Wolfskin Bag should probably be unsellable (selling stores is bad). Adding Wraithfom is going to push a third level spell off of the selection menu for sorcerers (this level is already full) - not sure what you want done about that, if anything. Boots of the West need to be copied to misc8j.itm rather than just misc8j or your patches are wasted.
About Eldarin/Suna Seni/Arbane--I honestly can't remember.  The other night I looked back over the change logs, and for whatever reason I shifted the sword around several times.  I think it was a "don't let a character give you an item that they don't already have in their inventory" type thing or something.  Good idea about Wolfskin Bag and the Boots.  Wraithform is an issue that will need to be looked into, definitely.

Quote from: Nythrun
There's only one town crier, so it looks odd seeing the same character in every city.
Ah.  That's probably why they genericked it up, then.  Good call.

Quote from: Nythrun
Old Bohdi patch is very dangerous.  [...] Is there a reason not to use the olive slime animation?
Bodhi patch?  Do you mean the chase component?  As for the slimes--um, well, I think that was added post-icelus, so I don't know the details behind it.  If your edits have restored an animation, then kudos.  :D

Quote from: Nythrun
By the way, this is posted more in the spirit of "take anything that looks appealing and adapt it" than it is "do everything my way"
I will take any help I can get.  :)

Quote from: Nythrun
You may also want to use FILE_EXISTS_IN_GAME sarev25.bcs rather than FILE_EXISTS ~override/sarev25.bcs~ as people do have an unfortunate habit of needlessly biffing files.
Will do.  :)
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #19 on: April 08, 2008, 04:32:58 PM »
I'd worked off of the v14 that I had lying around - though I did punch in the stuff you'd included in the beta v16s.

Given the lack of bug reports about Elhan, I'd not worry too much (and dumping an unstealable amulet of power on him is the laziest solution ever ;) )

"Letting CamDawg deal with it in the Fixpack" tends to produce favorable outcomes :)

Bohdi patch was the old
Code: [Select]
COPY_EXISTING ~vvbodhi.cre~ ~override/vvbodhi.cre~
WRITE_ASCII   ~0x40c~       ~MINHP20~
which breaks her .cre when installed after two other mods that I can think of.

Sorry, I've been kind of unreliable lately :(

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: TP2
« Reply #20 on: April 12, 2008, 06:30:44 PM »
I'd forgotten that Fixpack is removing the non-existent Olive Slime references in Ust Natha - added something to put them back in :)

BG2 TWIXPACK: FIRST WE CRUSH YOUR MODS. THEN WE TAKE YOUR DREAMS.

Offline Salk

  • Planewalker
  • *****
  • Posts: 848
Re: TP2
« Reply #21 on: July 19, 2008, 06:13:00 AM »
Well, three long months have passed and I can't help but wonder what is in the way to version 17.

Most of the .tp2 job seems to be done already by Nythrun, right?

What's stopping a release?

If it's just a matter of testing, I am sure there would be many volunteers ready.  :pirate


Offline temujin

  • Planewalker
  • *****
  • Posts: 78
Re: TP2
« Reply #22 on: November 25, 2008, 11:02:54 PM »
Well, three long months have passed and I can't help but wonder what is in the way to version 17.

Most of the .tp2 job seems to be done already by Nythrun, right?

What's stopping a release?

You'll have to excuse Icelus.  He's currently preoccupied with an extremely important politics thread over at G3 arguing with a bunch of republicans over some guy that he thinks will turn America into a Shangri-la.

So I say give him a few more weeks and wait for the thread to die down a bit as he's American, and Americans usually have a habit of getting a little too excited after the elections.

Please put yourself in Ice's shoes.  There are far, far more important topics to discuss like communism, socialism, religion, catholic priest sex scandals, population of the United States, its founding fathers, etc than bugfixing some roleplaying game mod.  Unfinished Business is secondary.  These important matters *must* be discussed for the greater good!

Please try to be a little more considerate, Salk.  :nono:  :nono:  ;)









Or in the meantime you can do what I did and download the latest version, replace some of the components with Nythrun's fixes and hope nothing screws up.  Ignorance is bliss, baby!   8)

Offline Salk

  • Planewalker
  • *****
  • Posts: 848
Re: TP2
« Reply #23 on: November 27, 2008, 09:18:54 AM »
It would be enough to have Nythrun back but she's also disappeared...

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: