Jump to content

Actor name vs. script name in AREs


devSin

Recommended Posts

By request:

 

In the actors struct in ARE v1.0 files, setting offset 0x28 to 0x09 allows the actor name (as listed in the ARE file) to override the CRE script name. BioWare used this in several places in Baldur's Gate II (see AR2200, AR2400, and AR5003). This does not appear to have any effect on the creature whatsoever (even though IESDP lists it as "CRE attached to struct" flag, I think it's more of a visibility (0 for off, !0 for on) field). It lets you get away with using the same CRE file for multiple actors (say guards or commoners), but still be able to distinguish them individually.

 

Not tested: any other possible values for the field; whether the actor name truly overrides the script name (i.e., I don't know if it's still possible to refer to the CRE script name externally after setting the flag to 0x09).

Link to comment

Here's a bit more info, which DevSin's post inspired me to look for:

 

0x0028 consists of flags:

 

Bit 0 = CRE attached? (0 = yes, 1 = no)

Bit 1 = unknown

Bit 2 = unknown

Bit 3 = Copy Actor name to CRE Scriptname? (0 = no, 1 = yes)

 

For bit 0, a value of 1 denotes that a CRE has not yet been loaded and attached to the ARE file. Once an area is entered, the CRE is loaded and attached, and this bit is set to 0. Thus the reason DevSin saw 0x09 in some values; bit 0 was set. (I'm not sure this is accurate, as setting this bit to 0 before entering the area the first time still results in CREs being loaded and attached. However, all of Bioware's actors in unvisited areas have this bit set to 1 by default.)

 

I noticed in my savegame (AR2200, actor structures) that all bits of 0x0028 were clear, so I checked the loaded and attached CRE for a scriptname. I found that having bit 3 set before the CRE is loaded causes the game to copy the Actor name to the CRE's scriptname. Thus scripts still refer to the scriptname, but this allows CRE sharing, as DevSin pointed out. The original scriptname of the CRE, if any, is overwritten.

Link to comment

Haha, these new bits will certainly ruin dltcep's screen design.

Way to go.

 

Also, something like this happened in IWD and i thought IWD handles the scriptname specially (takes scriptname from area). Now i have to re-check if it was just this area bit.

It was a really good info.

Probably one of these bits change the actor's animation ID? The animation ID is also stored in the actor block.

Link to comment

Archived

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

×
×
  • Create New...