Jump to content

PST: CRE


Displacer

Recommended Posts

Posted

The unknown 5 bytes at 0x031a are processed as a whole, and they are processed along with the other .IDS entries around it. It checks if the first byte is zero, if it is it sets all 5 bytes to zero in memory. If the first byte is non-zero it moves all 5 into memory as is. Since they are processed along with all the other .IDS entries around it, could it be a .IDS entry of some sort too?

Posted

Yep, they are. Take a look at them in NearInfinity: they're Functional spec. 1-5. Basically there where the engine determines the OBJECT.IDS attributes assigned to a given creature.

Posted

I'm at the inventory processing function, and the inventory slot just after quiver 5 looks like its another quiver slot. Some of the inventory slots are processed in loops (weapon 1-4, quick item 1-5, quiver 1-5) and this slot is processed in the quiver loop so apparently they had 6 quiver slots available at one time. The slot is still processed so it may be possible to use it, although you would have to put something in there in an editor.

Posted

Just after the inventory slots there are 3 words. The first one is marked as "selected", the other 2 aren't even listed. I don't thing the first word is used in PST, the second word looks like its the selected weapon (offset in the 4 weapon slots, so a value of 3 here would be weapon 4) There are two special cases for this value, 0xFFFF or 0x3E8, I don't know yet what these special cases do however. Haven't figured out the third word, but it looks like its another selected thing, although I'm not sure what.

Posted

0x3e8 = 1000, it is when the selected weapon is bare hand.

You will see other weird values on Nordom, who has quiver.

I think you somehow miscalculated the inventory size, as the 'selected' slot is after the inventory.

 

Btw, you can get the selected weapon slot by this formula:

 

1000 - barehanded

other: Add the slot index of the first melee weapon to this signed word value.

This means, quivers will have a negative value, as they are before the first melee weapon slot.

If you manage to equip a magic weapon, it will also have a special value.

 

Thanks for confirming the hidden quiver slot. I didn't believe someone who insisted on that one.

Posted

Don't think I miscalculated the offset but its possible. If you open the creature in NI you can see at the bottom there are 3 unknown words, the first after the last slot would be the selected as per the IESDP, but it is not this one that is being used, its the one below it, the second one. Take a look and let me know if I did screw up. The code is accessing offset 0x5C from the start of the slots, so if you could double check my math I would appreciated it.

 

Yea, I just traced the function and if you select an empty weapon slot that value will be put in there, and it will equip the default weapon, which would be teeth for Morte, fist for Nameless, etc.

Posted

Here is a snippet from a PST saved game.

 

0004ceh 43-Inventory 0017

0004d0h 44-Inventory ffff

0004d2h 45-Magic ffff

0004d4h Equipped 00000001

0004d8h Items

0004d8h Item #0

0004d8h Item R98

 

No gaps around Equipped (which is a dword, in every incarnation of .cre on IESDP)

 

 

Also:

00035ch Itemslots 00000478 <--- start of PST inventory slots

000360h Item offset 000004d8 <--- 4d8

000364h Item count 00000018

Posted
Here is a snippet from a PST saved game.

 

0004ceh 43-Inventory 0017

0004d0h 44-Inventory ffff

0004d2h 45-Magic ffff

0004d4h Equipped 00000001

0004d8h Items

0004d8h Item #0

0004d8h Item R98

 

No gaps around Equipped (which is a dword, in every incarnation of .cre on IESDP)

 

 

Also:

00035ch Itemslots 00000478 <--- start of PST inventory slots

000360h Item offset 000004d8 <--- 4d8

000364h Item count 00000018

 

Ah, so there is a "magic" entry after the last inventory slot? This is not listed on IESDP which is why things are not adding up. I did miss the selected as a dword though, but the code I'm looking at treats "selected" as a word, and also accesses the word after it separately.

Posted

That is the magic weapon slot, it should be around :)

 

IGI: the magic weapon slot (you call it fist sometimes) exists in all .cre formats.

Posted
That is the magic weapon slot, it should be around :)

 

Well now everything adds up. Thanks! That slot doesn't appear to be used in PST though, but maybe its used elsewhere so I can't say for sure. I'll see if I can track down why the selection is treated as a word, and what the other value is used for.

Posted

BG series have Magic weapon, Weapon slot selected, Selected weapon ability.

 

They also have a phantom quiver slot (which should work IIRC, but isn't accessible to the GUI).

Posted
They also have a phantom quiver slot (which should work IIRC, but isn't accessible to the GUI).

 

Yea, I already found that and posted it earlier

Posted
Yep, they are. Take a look at them in NearInfinity: they're Functional spec. 1-5. Basically there where the engine determines the OBJECT.IDS attributes assigned to a given creature.

 

Thanks, so a creature can have 5 object.ids things attached to it correct?

 

As a side note, the way these slots are processed when the creature is loaded it checks the first slot, if it is zeroed, then it zeros all the other slots so if you are editing a creature and clear something here, make sure you have something in the first slot or you will lose all the other slots.

Archived

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

×
×
  • Create New...