xml X & Y for MISC Items

Discuss modding questions and implementation details.
Post Reply
l3lessed
Posts: 1403
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

xml X & Y for MISC Items

Post by l3lessed »

I'm close to a new release of the magical compass; this version will finally deal with a number of the mod breaking issues people encountered and add in a number of new immersive features.

That being said, I need one quick question answered, as I can't find documentation or code on it.

When setting up a custom mod item, you create a new itemtemplate.json, setup the item in the template file, create the item class sccript, add it in the item class script using the createitem object, and then the game has your custom item. This is working just fine for me.

I'm stuck at adding in a custom inventory texture for misc items. When adding in a custom texture, you have to create the png file that matches the index number and then create a matching xml file to tell the engine what size the texture is and what it is replacing. Using other mods, I was able to get in the compass item custom inventory icon to show using the magic item and/or jewelry item type.

However, when I try to add misc items using the misc item type, I can't because I do not and cannot find the X and Y properties for the XML file for this item type.

When I switch the items to jewelry, the icons work, so I know it is the item type causing this issue. I imagine each item type has a predefined x and y value for the xml file, but I can't find it.
Here is the XML that works with item types jewelry and Magic Items but throws an null color array error when the items are switched to misc item type.

Code: Select all

<?xml version="1.0"?>
<info>
    <rect scale="1">
        <x>35</x>
        <y>88</y>
        <width>44</width>
        <height>44</height>
    </rect>
</info>
The <X> & <Y> properties are causing the issue I think, but I cannot find figure out what the proper values are for other item types.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: xml X & Y for MISC Items

Post by Ralzar »

This is only needed for items that you equip so they get positioned correctly on the paper doll. Is that what you are trying to achieve?

l3lessed
Posts: 1403
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: xml X & Y for MISC Items

Post by l3lessed »

Okay, thanks for explaining what those do. That makes sense. Items that aren't equippable should not have those properties in their XML I assume then.

*UPDATE*
That fixed it. Now I need to just clean up and wrap up some repairing compass code for the repair kit, and I think release by Wednesday of this week for new version.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: xml X & Y for MISC Items

Post by Ralzar »

Yeah, I have a bunch of items in my mods. Including items that are equippable in the jewelry slots. None of them have XML files.

Btw, make sure to use item indexes etc that are available:

viewtopic.php?f=27&t=3023
(Hazelnut has not updated it in a while so make sure to check the recent posts for resources that have been taken but not added to the OP)

l3lessed
Posts: 1403
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: xml X & Y for MISC Items

Post by l3lessed »

Thanks for the info Ralzar. I wanted to look at your mod files for reference, but because you do what I do, and precompile it as a dll, it can't be extracted from the mod file.

When you extra precompiled mods, it gives you a standard .dll in place of the individual script files. I also couldn't find a link to a github for your code, so I used Realistic items as a reference. However, it didn't have any non-equipable items, thus my confusion.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: xml X & Y for MISC Items

Post by Ralzar »

l3lessed wrote: Wed Nov 10, 2021 8:35 pm Thanks for the info Ralzar. I wanted to look at your mod files for reference, but because you do what I do, and precompile it as a dll, it can't be extracted from the mod file.
Yeah, here's my github. I try to keep it up to date :D

https://github.com/Ralzar81

Post Reply