Jump to content

SPL/ITM: Extended header target type


igi

Recommended Posts

A value of 3 (currently laughably labelled 'dead character') in the target type field in the extended header for spells seems to have nothing to do with dead characters; instead it seems to override the range field. With a value of 1, the character will walk to be within the spell range before casting the spell, with a value of 3 the character just casts the spell from their current location - even if it's halfway across the map.

 

EDIT: This was tested with BG2:ToB btw - utterly untested on other engines.

EDIT: Also, to clarify a value of 0 ('invalid') means the no target can be selected and the spell will not be cast. A value of 2 ('Inventory/Crash') seems to crash in every circumstance I can think of, and is likely to be ranamed in the next IESDP update to just 'Crash'.

EDIT: Seems to have no effect on items (at least for melee abilities).

Link to comment

In Torment, 2 definitely causes a crash, but I can't find any difference in behavior for 3 sadly.

 

Makes some sense. Spells and items meant to raise dead targets for this game are named in the EXE, rather than dependent on a variable (no I really don't get why the hell they did that >_<)

Link to comment

I think we might be talking the same thing here...

 

Dead Character (or perhaps 'Dead Party Member') for value 3 makes sense to me.

BG2 Raise Dead scroll has this value set for the scroll to properly cast the spell. In BG vanilla the scroll Raise dead does not work because in the ability header it is set to target 1-Creature (according to DLTCEP) if that is changed to 3-Dead Character it works just fine in the game.

 

I don't know of any other uses for value 3 beyond getting the Raise Dead Scroll to work properly....

 

There must be something there that tells the engine that a dead party member is a valid target. Change the target value to 1 and neither the spell or scroll will work.

Link to comment
A value of 3 (currently laughably labelled 'dead character') in the target type field in the extended header for spells seems to have nothing to do with dead characters; instead it seems to override the range field.

 

I can confirm (from the code point of view) that 3 ignores the range calculation as well as the projectile field (uses projectile 1 as default).

 

2 and 6 are assert(false) [crash] in nearly all target type checks. (I think there is one case were only one of both is a crash, but it's probably irrelevant.)

There is a different codepath for 7 in most checks. I guess this could use some investigation.

Link to comment

No range/projectile is required for targeting dead characters.

I agree that no range/projectile is a bit closer to the technical description of the targeting type, but 'dead character' is closer to the practical description.

PST seems to have re-hardcoded this, just like they re-hardcoded treasure tables, etc.

I don't know why they chose to do that, it sucks...

Link to comment

I found the random treasure lists, of course they're hardcoded, but they are accessed the same way other 2da files are. As soon as I find the 2da functions it would probably be a simple task to strip the original 2da's from the exe, put them into a external 2da file and access them that way. But first I need to find the 2da functions. I need a break from area processing anyway so I'll see what I can find.

Link to comment

Well there may be hope. With one exception every single 2da file is referenced in the code. It looks like there is a huge function that loads them all at once. PST just ignores the hardcoded ones and uses its internal lists, but the code to at least load all the 2da's in the game are there so it may be possible to activate that code. The single exception is reverb.2da, I saw that string referenced once, but it looked like an INI setting. Even the ones that are not used, or leftover from BG1 are accessed.

Link to comment

Archived

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

×
×
  • Create New...