What links the Beastiary pictures?
smeagolheart
Member Posts: 7,963
in PST:EE Mods
Anyone know how the beastiary is referenced in game?
I'd like to make a mod that shows the picture of the beast you are talking to while you are talking to said creature. This will take some UI changes but how does the beastiary portrait get referenced by a creature?
I've noticed you just have to spawn in a particular creature and then the appropriate entry is made in the beastiary automatically. How does that happen? I can't find the connection between the beastiary and that entry. Using @argent77 nearinfinity I see no reference in scripts that do it - though I could easily be missing something.
I suspect the link is based on the animation, but is there a table or reference that shows what BMP matches up to what type of animation? If so, my goal is to reference that through dialogue and show the beasitary pic when you talk to a creature of that type.
Anybody know the internals on this aspect?
I'd like to make a mod that shows the picture of the beast you are talking to while you are talking to said creature. This will take some UI changes but how does the beastiary portrait get referenced by a creature?
I've noticed you just have to spawn in a particular creature and then the appropriate entry is made in the beastiary automatically. How does that happen? I can't find the connection between the beastiary and that entry. Using @argent77 nearinfinity I see no reference in scripts that do it - though I could easily be missing something.
I suspect the link is based on the animation, but is there a table or reference that shows what BMP matches up to what type of animation? If so, my goal is to reference that through dialogue and show the beasitary pic when you talk to a creature of that type.
Anybody know the internals on this aspect?
3
Comments
example: edit:
I can get it to work - but only if I preselect the journal entry before entering dialogue. It will show the portrait even if I speak to someone else.
otherwise it shows this:
so there's no link between speaker and dialogue.
I can link them directly, which will be a bit tedious to recreate everything but it can be done and I know how to do it.
But the portraits show up on the main ui screen without transparency.
As an example this portrait would show up as this:
Anyone up to making a transparent frame that fits in with the base UI to get something better than this quick mockup:
Maybe you ui modders can figure this out. In the bestiary the green gets dropped and you get the rounded edges.
mosaic lua "getBestiaryImage()"
But in dialogue that doesn't work have to call it as:
bitmap lua "worldNPCDialogPortrait"
mosaic lua "worldNPCDialogPortrait" doesn't show anything.
So the rounded edges don't work, the frame would have to be square or pseudo-square... I added another layer beneath.. It doesn't look great.
I'll try placing the frame on top without adding the layer, that might work.
I don't know LUA well and there might be a way to get the bestiary portrait to link to the speaker that I'm missing. Since I can't figure that out, I'm making the small portrait show up on the UI like in BG, BG2, IWD.
Now just need to map all the creatures to their bestiary pics. This seems to be done based on their animation.
In nearinfinity for one of the creatures, ABISHBH.cre and it is animation 61440. If you click on another animation then click back on Abishai_Black - 61440 you can "view/edit" that it shows F000.ini (not sure the link there?).
It has a monster_planescape section and an entry on the bestiary there. In BGEE.lua it seems to enumerate the bestiary around line 1490 has There's 87 entries on the bestiary. So I think if I go through each animation/ini file I can find out what animations are linked to what bestiary entry. If anyone knows a better way to do that let me know. Once I have that info, I'll patch the appropriate creature to have their bestiary portrait as their small portrait.
Example code how to read BGEE.LUA entries:
[spoiler] The data can now be accessed by using indexed variables (e.g. $cre_imageKnown(0) contains the image resource name for the bestiary entry of index = 0).
[/spoiler]
I'm not yet stuck on the problem of reading the bestiary entries.
How does it work that "Abishai_Black - 61440" corresponds to F000.INI?
When I read in the animation data for each creature like this: How do I link variable 'animationindex' which presumably will give me something like 61440 to f000.ini (or am I missing something)?
I believe I need to read in creaturedata but how to match something from the creature to the ini file where I can grab the bestiary number?
Need a function to read in an ini file (random example F035.INI) and return the bestiary value (this case 45).
Then I should be able to match that to the index that argent77 provided earlier that links the portrait.
I'm not sure how it will work on NPCs that are already in your party... At any rate, a new playthrough would give best results.
The last thing I'm working on is how to weidu in the one small required ui.menu change
https://forums.beamdog.com/discussion/64382/mod-journal-portrait-conversations-for-pstee/p1