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.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~