Author Topic: Restored creatures  (Read 3151 times)

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Restored creatures
« on: December 03, 2005, 08:30:34 PM »
MTOB4.DLG belongs to the unused MTOB4.CRE.  That original cre file referenced MTOB3.dlg for the dialog file, which, of course, was already used by MTOB3.CRE, who appears in AR0134.  In fact, he appears twice.  This code will replace the extra MTOB3 with MTOB4 and assign MTOB4 his correct dialog file.

COPY_EXISTING ~AR0134.ARE~ ~override/AR0134.ARE~ // Replaces the duplicated MTOB3.CRE with the unused MTOB4.CRE in AR0134
WRITE_ASCII ~0x2ac~ ~MTOB4~


COPY_EXISTING ~MTOB4.CRE~ ~override/MTOB4.CRE~ // Assigns MTOB4.CRE his proper dialog file
WRITE_ASCII ~0x2cc~ ~MTOB4~

Actually, he needs to be placed in the Splurging Sturgeon (AR0104).  Will edit the code later.


Fixed by devSin.
« Last Edit: February 14, 2006, 10:44:58 PM by icelus »
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Restored creatures
« Reply #1 on: December 03, 2005, 08:44:39 PM »
MTOB5.DLG is just like MTOB4, as in it belongs to an NPC that never got placed in the game, in this case in the Elfsong tavern (AR0706). 

COPY_EXISTING ~MTOB5.CRE~ ~override/MTOB5.CRE~ // Assigns MTOB5.CRE his proper dialog file
WRITE_ASCII ~0x2cc~ ~MTOB5~

Will code his placement later.


Fixed by devSin.
« Last Edit: February 14, 2006, 10:37:22 PM by icelus »
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Restored creatures
« Reply #2 on: December 03, 2005, 09:24:21 PM »
READ4.DLG goes with READ4.CRE, which was assigned READ3.DLG.  The other READs are monks in the Candlekeep library, though they're all coded as READ3s.  I think a few can be swapped out for READ4s.

COPY_EXISTING ~READ4.CRE~ ~override/READ4.CRE~ // Assigns READ4.CRE his proper dialog file
WRITE_ASCII ~0x2cc~ ~READ4~


Will swap them out later.


Fixed by devSin
« Last Edit: February 14, 2006, 10:41:43 PM by icelus »
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Unused creatures
« Reply #3 on: January 28, 2006, 04:51:45 PM »
There were only a few of these I found worthwhile to add. I insert directly into the area definition, so I'm just posting the areas and coordinates (you'll probably have to add a script name and area script to get these in-game).

Code: [Select]
HAFFG2.cre -- Halfling Woman (MABLEDALE)
AR4006.ARE
X: 357, Y: 257
Face: 9

Code: [Select]
HALFG2.cre -- Halfling Man (BUNSEN)
AR4013.ARE
X: 311, Y: 179
Face: 0

Code: [Select]
MTOB4.cre -- Commoner
AR0104.ARE
X: 518, Y: 252
Face: 2

Code: [Select]
MTOB5.cre -- Commoner
AR0705.ARE
X: 851, Y: 367
Face: 0

The traveler (TRAVEL.CRE -- Traveler (WADE)) makes mention of all the bandits, so I elected to add him by script to the Friendly Arm in Chapter 3. It requires a small update to his creature file, and updating the Friendly Arm area script:
Code: [Select]
COPY_EXISTING TRAVEL.CRE OVERRIDE
  SAY NAME1 ~Wade~
  SAY NAME2 ~Wade~
  SAY 0x198 #13673 // hostile
  SAY 0x19c #13671 // post high
  SAY 0x1a0 #13672 // post low
  WRITE_ASCII 0x280 WADE #18 // Script name

// Create FAI traveler when bandit subplot starts (Chapter 3)
<<<<<<<< .../bg1ub/eb_2301.baf
IF
Global("CHAPTER","GLOBAL",3)
!Exists("WADE")
!Dead("WADE")
THEN
RESPONSE #100
CreateCreature("TRAVEL",[691.398],0) // Traveler
END
>>>>>>>>
EXTEND_BOTTOM AR2301.BCS ~.../bg1ub/eb_2301.baf~

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Restored creatures
« Reply #4 on: January 29, 2006, 02:04:40 PM »
I wanted to get your opinion on these. The first patch changes the bartender for the Helm and Cloak so that it's the right guy (dialogue welcomes PC to Helm and Cloak and opens "Helm and Cloak" STO). For adding READ4, I sprinkled a few in the lower levels of Candlekeep. I wanted to leave most of the READ3, since they mention Rieltar and the other visitors, and it's an important thing for the player to hear about. For the last level, I replaced both READ3 creatures with READ4 -- this level is already above the level Rieltar is on, and I didn't want the library littered with people gabbing about the stupid Iron Throne. The patches for READ4 will only update the area if the correct resref is found, and only if the creature to be patched is in the right position (their default position). This should keep us safe from somebody who decided to rewrite Candlekeep.

Code: [Select]
COPY_EXISTING AR0116.ARE OVERRIDE // Restore Helm and Cloak bartender
  PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
    READ_LONG 0x54 actOff
    FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
      READ_ASCII actOff + 0x80 actor
      PATCH_IF !("%actor%" STRING_COMPARE_CASE "BART12") BEGIN
        WRITE_ASCII actOff + 0x80 BART9 #8
      END
      actOff += 0x110
    END
  END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING AR2608.ARE OVERRIDE // Add READ4 to Candlekeep library
              AR2610.ARE OVERRIDE
  PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
    PATCH_IF !("%SOURCE_RES%" STRING_COMPARE_CASE "AR2608") BEGIN
      actLoc = 1108
    END ELSE actLoc = 1272
    READ_LONG 0x54 actOff
    FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
      READ_ASCII actOff + 0x80 actor
      READ_SHORT actOff + 0x20 xPos
      PATCH_IF ((xPos == actLoc) && !("%actor%" STRING_COMPARE_CASE "READ3")) BEGIN
        WRITE_ASCII actOff + 0x80 READ4 #8
      END
      actOff += 0x110
    END
  END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING AR2609.ARE OVERRIDE // Add READ4 to Candlekeep library
  PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
    READ_LONG 0x54 actOff
    FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
      READ_ASCII actOff + 0x80 actor
      READ_SHORT actOff + 0x20 xPos
      PATCH_IF (((xPos == 547) || (xPos == 1293)) &&
                !("%actor%" STRING_COMPARE_CASE "READ3")) BEGIN
        WRITE_ASCII actOff + 0x80 READ4 #8
      END
      actOff += 0x110
    END
  END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING AR2611.ARE OVERRIDE // Add READ4 to Candlekeep library
  PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
    READ_LONG 0x54 actOff
    FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
      READ_ASCII actOff + 0x80 actor
      PATCH_IF !("%actor%" STRING_COMPARE_CASE "READ3") BEGIN
        WRITE_ASCII actOff + 0x80 READ4 #8
      END
      actOff += 0x110
    END
  END
BUT_ONLY_IF_IT_CHANGES

How do you think the creature additions should be handled? I have locations for just about every creature that has so far been listed, and the scripts will be easy enough, but should we update the script resref in the area def (BUT_ONLY) and then just compile the script?

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Restored creatures
« Reply #5 on: January 29, 2006, 02:52:57 PM »
The Helm and Cloak change is warranted, and the READ4 addition is pretty much what I'd planned, so yay. 

As for your last sentence--if you mean should the characters be added directly to the .are file or added via an area script, I'd probably lean more toward the latter.  It would probably require more coding, however...
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Restored creatures
« Reply #6 on: January 29, 2006, 02:58:08 PM »
I've also updated the wiki and added Creature Restorations to the .tp2.

It might be time to separate the wikied tp2 into individual sections...
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Restored creatures
« Reply #7 on: January 29, 2006, 02:59:28 PM »
I'm just wondering how far to go as far as compatibility. So, say I have a script to add HAFFG2 to one of the empty houses in Gullykin:
Code: [Select]
<<<<<<<< .../bg1ub/AR4006.baf
IF
Global("UB_HAFFG2_SPAWN","GLOBAL",0)
!Exists("HAFFG2")
!Dead("HAFFG2")
THEN
RESPONSE #100
CreateCreature("HAFFG2",[357.257],9)
ActionOverride("HAFFG2",Face(9))
SetGlobal("UB_HAFFG2_SPAWN","GLOBAL",1)
END
>>>>>>>>
COMPILE ~.../bg1ub/AR4006.baf~
Obviously, I have to give her a script name (fine since she's already updated with restored name for UB). How would you want to handle hooking it up, though? I can think of some (hopefully unlikely) cases:

The area has AR4006 as script resref, AR4006 doesn't exist (default BG/TotSC)
The area has AR4006 as script resref, AR4006 does exist (some mod did something here)
The area has something other than AR4006 as script resref, which may or may not exist (mod did a lot of stuff here)

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Restored creatures
« Reply #8 on: January 29, 2006, 03:03:00 PM »
For now, I'd say let's hold off on worrying about Scenario #3 and handle it on a case-by-case basis if need be.  Shame on anyone who adds a script resref to an area and doesn't use the area name as the name of the script.  Shame.

I think #1 and #2 could be handled by an ACTION_IF/ELSE code, right?  I think I did that when coding the original UB...
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Restored creatures
« Reply #9 on: January 29, 2006, 03:05:12 PM »
Absolutely. ACTION_IF NOT FILE_EXISTS override/script.bcs THEN COMPILE ELSE EXTEND should work. I'll go ahead and code all these up to account for one and two.

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Restored creatures
« Reply #10 on: January 29, 2006, 03:42:09 PM »
This is the code I have to:

Add HAFFG2 (Halfling Woman (Mabledale)) to an empty house in Gullykin. She's added to the downstairs level (both levels are unused), and the house is never identified (there are no special items or any reference that anyone should or shouldn't be located here).

Add HALFG2 (Halfling Man (Bunsen)) to an empty house in Gullykin. He's added to the main level (both levels are unused), and the house is never identified (there are no special items or any reference that anyone should or shouldn't be located here).

Add MTOB4 (Commoner) to the second level of the Splurging Sturgeon inn. There are already too many people in the main level, and there's only one female commoner, Mr. Shade, and a slime upstairs. I've placed him in a room on the opposite side of the area from Mr. Shade (he's in the room to the right of the room with the slime).

Add MTOB5 (Commoner) to the main level of the Elfsong Tavern. I didn't want to put him upstairs (with the proprietor, thugs, and merchants), as there really wasn't enough room for him (I didn't want him in the common area, since the player may be fighting Cyrdemac there). He's off to the side in the main level by the sofa/table (closer to the fireplace, actually; he's not blocking the chest or anything).

It turns out that, if the script doesn't exist, then WeiDU will simply create a new script when using EXTEND_BOTTOM. So I was able to avoid ACTION_IF checks entirely. I've added script names to the creatures used so they can be referenced in the scripts (to more or less replicate the standard BG spawn blocks); all these creatures are already updated (the halflings with new names, and the commoners with corrected dialogue). The checks aren't necessary, but I try to keep the code as close to the style used by BioWare. I also correct the area script references, but only if the script reference is empty (this shouldn't ever be the case, though, as all BG1 areas have the area name as the script resref by default).

I'm just using generic variable names with underscores, so they shouldn't conflict with anything, but I don't know if there's a different prefix you'd want to use. I'll let you add the code to the wiki, in case you have any comments, and you can update the comments and variable names to what you want.
Code: [Select]
COPY_EXISTING HAFFG2.CRE OVERRIDE // Halfling Woman (Mabledale), AR4006
HALFG2.CRE OVERRIDE // Halfling Man (Bunsen), AR4013
MTOB4.CRE OVERRIDE  // Commoner, AR0104
MTOB5.CRE OVERRIDE  // Commoner, AR0705
  WRITE_EVALUATED_ASCII 0x280 "%SOURCE_RES%" #18
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING AR0104.ARE OVERRIDE
AR4006.ARE OVERRIDE
AR4013.ARE OVERRIDE
  PATCH_IF (SOURCE_SIZE > 0x1cc) BEGIN
    READ_ASCII 0x94 script
    PATCH_IF !("%script%" STRING_COMPARE_CASE "") BEGIN
      WRITE_EVALUATED_ASCII 0x94 "%SOURCE_RES%" #8
    END
  END
BUT_ONLY_IF_IT_CHANGES

// Add patron to Splurging Sturgeon inn (upstairs)
<<<<<<<< .../bg1ub/ex_ar0104.baf
IF
Global("UB_MTOB4_SPAWN","GLOBAL",0)
!Exists("MTOB4")
!Dead("MTOB4")
THEN
RESPONSE #100
CreateCreature("MTOB4",[518.252],2)
ActionOverride("MTOB4",Face(2))
SetGlobal("UB_MTOB4_SPAWN","GLOBAL",1)
END
>>>>>>>>
EXTEND_BOTTOM AR0104.BCS ~.../bg1ub/ex_ar0104.baf~

// Add patron to Elfsong Tavern (main level)
<<<<<<<< .../bg1ub/eb_0705.baf
IF
Global("UB_MTOB5_SPAWN","GLOBAL",0)
!Exists("MTOB5")
!Dead("MTOB5")
THEN
RESPONSE #100
CreateCreature("MTOB5",[851.367],0)
SetGlobal("UB_MTOB5_SPAWN","GLOBAL",1)
END
>>>>>>>>
EXTEND_BOTTOM AR0705.BCS ~.../bg1ub/eb_0705.baf~

// Add Mabledale to home in Gullykin (downstairs)
<<<<<<<< .../bg1ub/eb_ar4006.baf
IF
Global("UB_HAFFG2_SPAWN","GLOBAL",0)
!Exists("HAFFG2")
!Dead("HAFFG2")
THEN
RESPONSE #100
CreateCreature("HAFFG2",[357.257],9)
ActionOverride("HAFFG2",Face(9))
SetGlobal("UB_HAFFG2_SPAWN","GLOBAL",1)
END
>>>>>>>>
EXTEND_BOTTOM AR4006.BCS ~.../bg1ub/eb_ar4006.baf~

// Add Bunsen to home in Gullykin (main level)
<<<<<<<< .../bg1ub/eb_ar4013.baf
IF
Global("UB_HALFG2_SPAWN","GLOBAL",0)
!Exists("HALFG2")
!Dead("HALFG2")
THEN
RESPONSE #100
CreateCreature("HALFG2",[311.179],0)
SetGlobal("UB_HALFG2_SPAWN","GLOBAL",1)
END
>>>>>>>>
EXTEND_BOTTOM AR4013.BCS ~.../bg1ub/eb_ar4013.baf~

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Restored creatures
« Reply #11 on: January 29, 2006, 03:48:22 PM »
It turns out that, if the script doesn't exist, then WeiDU will simply create a new script when using EXTEND_BOTTOM. So I was able to avoid ACTION_IF checks entirely.
Now that you mention it, I do recall that feature being added to WeiDU around the time of UB's release.

I'm just using generic variable names with underscores, so they shouldn't conflict with anything, but I don't know if there's a different prefix you'd want to use. I'll let you add the code to the wiki, in case you have any comments, and you can update the comments and variable names to what you want.

That's fine.  I kinda go back and forth between U! and UB.

All of this has been wikied, btw.
« Last Edit: January 29, 2006, 03:51:11 PM by icelus »
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline devSin

  • Moderator
  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Restored creatures
« Reply #12 on: January 29, 2006, 08:29:28 PM »
The update also takes care of the SS and Elfsong patrons, so those can be crossed off the list.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Restored creatures
« Reply #13 on: February 14, 2006, 08:56:46 PM »
Shamelessly stealing devSin's code, this should restore BART8, the Elfsong bartender:

Code: [Select]
COPY_EXISTING AR0705.ARE OVERRIDE // Restore Elfsong bartender
  PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
    READ_LONG 0x54 actOff
    FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
      READ_ASCII actOff + 0x80 actor
      PATCH_IF !("%actor%" STRING_COMPARE_CASE "BART11") BEGIN
        WRITE_ASCII actOff + 0x80 BART8 #8
      END
      actOff += 0x110
    END
  END
BUT_ONLY_IF_IT_CHANGES
<Moongaze> Luckily BWL has a very understanding and friendly admin.

 

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)?: