Jump to content

igi's research topics


Avenger

Recommended Posts

1. Miscast magic in bg1/bg2/pst/HoW

 

0x3c (60 Miscast magic) in bg1 is a subset of bg2. Only the first 2 options (mage/cleric failure) work in bg1.

The effects stack, but not cumulative (in bg1).

HoW, PST are the same as bg1.

 

Except that PST uses a single byte while bg1/HoW use a word. (256 would be 0 in PST).

 

2. Effect offset 0x2c, always 0?

Well, usually. But some effects use it as an auxiliary parameter. Like the most recent discovery of damage opcode in PST. There are some other obscure uses, mostly internally.

 

3. item flags

I couldn't find any use for copyable, magical and bow.

Cold iron/silver are weird, i don't even want to believe what i read from the code. Apparently, you can use unidentified cold iron/silver weapons.

Link to comment

maybe the magical bit was used instead of enchantment when figuring out if a weapon could break in bg1.

I checked this, but couldn't find any evidence. Bg1 seems to ignore all those bits too.

 

I found another odd thing i didn't realize before: cursed items are auto identified on first equip! (in bg1/bg2, but most likely every game)

Link to comment

4. Target type in items (tt 3 is 'ignore range'), it could be simulated with a range of '0xfffe', because it simply overwrites the range with 0xffff, otherwise storing range+1 there.

This range 0xfffe (0xffff) will later cause the projectile to be set to 1 (default invisible projectile).

 

 

Btw, i found the bow itemflag (deep in the animation code). Still didn't find the magical/copyable bits. Those are apparently unused.

 

Link to comment
maybe the magical bit was used instead of enchantment when figuring out if a weapon could break in bg1.
This is done in the ability.

 

BG didn't support enchantment levels.

 

Btw, i found the bow itemflag (deep in the animation code).
Taimon noted this way back when. I'm reasonably sure nobody has ever found a place where it tries to access the "copyable" bit anywhere in the code.
Link to comment

0x44 Unsummon - resref - as far as i know this is the vanish animation. Defaults to SPGFLSH1.

0x134 Immune to tracking - param2 goes right into the stat. Any nonzero value will have the same effect, but of course you can create some special effect which you can detect by script.

0x10f Avatar removal and 0x126 Existance delay override are similar (you can check the stats by script, but the engine doesn't care much).

 

0xd3 Imprisonment - doesn't really care with effect offset CC. Maybe clarify this question?

Link to comment

In my previous note I wrote this stat's value is irrelevant besides 0 or nonzero. That was wrong.

0 - normal existance sounds

-1 (0xffffffff) - no existance sounds

anything between that - random, the higher the rarer.

Ok, just something more on 0x126, as i guess not many know wtf 'existance delay override' supposed to mean.

Existance is the verbal constant group from 69 to 74 (or 70-74). These sounds are randomly played (for non global, alive characters, when not in cutscene or dialog).

You can add random rants, mumbles, etc.

This stat tunes the frequency of these random strings.

 

[edit]

I'm pretty sure the group is 69-73, but the original intention was 70-74 (as evidenced from sndslot.ids).

Another bioware quirk.

This group is overlapped by some other functional slots, that are needed for a complete joinable pc.

Since the existance group is used only for non-globals, this is less of a problem, just keep in mind before doing MakeGlobal, you need to overwrite the important slots.

Link to comment

0xd3 Imprisonment - ok, just realized what you meant by cc (it is the firstapply field in the effect file format, internally it is c8 for me).

Imprisonment seem to spare the target from the death effects (kick out from party, etc), if it is applied the second (or more) times. This makes sense, you don't want to increase the kickedout variable, remove from party, etc whenever you load the game or enter the area of imprisonment.

So, probably, you can coerce the engine to do a milder imprisonment effect (including not to abort the game on protagonist imprisonment).

Link to comment

0xd2 Power word stun - on first apply it does: print the '... stunned' string on messagewindow. Calculates the effect time based on hitpoints.

It is rather useless to set first apply to 0 (if you manage to do it somehow).

 

0x10d Screen shake - parameter2 = 1

I don't really know what it does, it negates one of the shake coordinates. Probably the screen shakes in the opposite direction (as in clockwise vs. counterclockwise).

A much better solution would have been to use param1 for x and param2 for y.

 

0xbb Store local variable

Well, you seem to notice the fabric of space. These variables in the IE are able to store strings (up to 24 chars), floats, a point, and god knows what else. Hence their enormous size.

Totally useless, if you ask me, except to bloat savegames. Since the effect structure has enough fields, they thought, it would come handy, if they can modify all those unused fields too.

No other code interacts with the float value, and I have yet to find a way to exploit the string value (tokens are string variables, but you cannot pass locals to tokens or vice versa). And you cannot save tokens. So, i think it is better to forget these fields.

Anyway, here is what i know about the field values:

Point = [resistance.param3]

Float = Param4

Int = Param1

Whatever = Param2 (this could be the type of the variable, as Param2 is usually the subtype of effect too)

String = resource1+2+3

 

The 0x44 field (probably 0x40 for you?), it is the unknown 0x2c field in effect v1 structure, which i knew originally as the variable marker, is actually a little different.

If it is 0, then the local variable is set unconditionally.

If it is 1, then the local variable is set only if it didn't exist before.

Link to comment

0xc4 - Familiar block - param1 = 2 is used internally, it means, the familiar name was upgraded to ToB and doesn't need tampering with.

Some quirky code here (replacing * with f in the name of the familiar) means, familiar creature resrefs should all start with 'f' (and 6 letters long at most) for this opcode to function as expected.

By using param1 = 2, you can skip this upgrade process. (You can use any 8 characters, but forgo the upgrade to ToB feature).

Link to comment

0xd5 - Maze/Freedom - If param2 = 1, the freedom effect creates a maze effect for one round (with param2=1), if there is combat. The maze effect creates a freedom effect and copies this parameter.

All this circus is done to keep the victim mazed for the whole duration of combat.

I don't know what was the goal, this whole stuff is weird.

Why would X stay mazed (cast by Y), when Z and W keep fighting?

 

If param2 = 1, the maze effect overrides the duration stuff based on intelligence.

Link to comment

0xb6 - Apply Effect on Item -

resource1 is an item resref

resource2 is an effect resref

This effect seems to be unfinished.

 

 

0xb5 - Can't use itemtype - i managed to use it for books. Sadly, one needs to modify the .exe (overwrite one byte) to make it work with other itemtypes too.

param1 - string resref to print

param2 - itemtype (if not 0, then goes to /dev/null).

 

It is rather useless at this moment. It would be much more useful with rings (you can't equip both the ring of ice and fire, and such).

Link to comment

Archived

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

×
×
  • Create New...