Confusion surrounding items and models

Discuss modding questions and implementation details.
Post Reply
User avatar
SmoothTalk
Posts: 3
Joined: Wed Mar 10, 2021 2:59 am

Confusion surrounding items and models

Post by SmoothTalk »

Hi -
I'm trying to get the item names corresponding the list of models I was able to generate for Interior records. However, I am unable to find any information that can tie together the

Code: Select all

3dObjectRecord.ModelIdNum
and the corresponding Item: https://github.com/Interkarma/daggerfal ... emEnums.cs

Perhaps the larger struggle here is getting the items located within a building. I am doing the following in the hopes of being able to generate an item to place on a table within the house:

Code: Select all

DFBlock[] blocks;
RMBLayout.GetLocationBuildingData(location, out blocks);
foreach (DFBlock block in blocks)
{
    foreach (DFBlock.RmbSubRecord record in block.RmbBlock.SubRecords)
    {
        DaggerfallConnect.Arena2.BlocksFile file = DaggerfallUnity.Instance.ContentReader.BlockFileReader;
        foreach (DFBlock.RmbBlock3dObjectRecord rec in record.Interior.Block3dObjectRecords)
        {
            string name = GameObjectHelper.GetGoModelName(rec.ModelIdNum);
            Debug.Log(name);
        }
    }
}
Any help/advice would be appreciated :D Despite the struggle, really enjoying tinkering around with things.

Gracias ahead of time.
- Smooth

User avatar
Hazelnut
Posts: 2694
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Confusion surrounding items and models

Post by Hazelnut »

You can use the utility Daggerfall Modelling to browse the models by id. The author of the handpainted models mod has a googledocs spreadsheet with a list of descriptions of models and the model id in game which may also help you.

Note that the item enums are for in game items which have nothing to do with 3d models used to construct the world.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
SmoothTalk
Posts: 3
Joined: Wed Mar 10, 2021 2:59 am

Re: Confusion surrounding items and models

Post by SmoothTalk »

Thanks - I'm now able to snag which 3D objects are tables vs. other records, as well as determine the Archive/Record # of textures. What would you recommend for adding a billboard/flat object to the table at this point? I've got the X/Y/ZPos of the table and have tried the following (where obj is the 3D object/table):

Code: Select all

GameObject go = GameObjectHelper.CreateDaggerfallBillboardGameObject(209, 7, transform);
go.transform.position = new Vector3(obj.XPos, obj.YPos, obj.ZPos) * MeshReader.GlobalScale;
RMBLayout.AlignBillboardToBase(go);
This is invoked after entry into the interior of the building. However, I cannot see the item nor does the building data dump show that flat as being a part of the scene (I realize this is because it is not actually apart of the block data, thus it can't be dumped). I might be overthinking this, but I would essentially like to simply add a billboard to an interior location (e.g. paper on top of a table), perhaps in a way that would persist across save/load.

Post Reply