Page 1 of 1

Adding new item template properties?

Posted: Thu May 06, 2021 12:39 am
by Kab the Bird Ranger
Someone taught me that the Repair service can repair virtually all items, not just equipment. I took a look, and indeed, only arrows are filtered out.

https://github.com/Interkarma/daggerfal ... ow.cs#L803

For vanilla Daggerfall, this is not really an issue, since only equipment can have its condition reduced, and therefore everything else will always have full condition.

But with mods involved, I'm wondering if we shouldn't have a way to let mods disable the repair service.

At first, I thought of going into the ItemTemplate type and adding a new field, that mods could change in their ItemTemplates.json. However, I realized that the ItemTemplate fields are based strictly on the data in FALL.EXE. I wasn't sure adding new fields there would be the right approach.

Any ideas on how else you would do it? Maybe we could have extra fields in ItemHelper to go along with RegisterCustomItem and the rest, but I wouldn't want to add a new function there for every other item template property we might want to add in the future.

Re: Adding new item template properties?

Posted: Thu May 06, 2021 8:47 am
by Interkarma
Registering new properties to item templates is a reasonable idea. There should be a way to add this in a non-breaking manner.

I'd like this to be done in a way that doesn't break if a mod adding these properties is removed later and the item remains. I can see an outline in my mind of a way this could work, but would need to explore to see if it's viable before I comment further.

Re: Adding new item template properties?

Posted: Thu May 06, 2021 8:59 am
by Ralzar
This is why the food items in Climates & Calories does not use the condition data and instead renames the items as they deteriorate.

When I used condition data I discovered that you could give a rotten apple to the blacksmith and he could pound it back into a fresh apple :D

Re: Adding new item template properties?

Posted: Thu May 06, 2021 10:43 am
by Interkarma
That's one gifted blacksmith!

Re: Adding new item template properties?

Posted: Thu May 06, 2021 2:34 pm
by Hazelnut
Yeah it was amusing when we realised this. Changing the name worked better anyway because the condition strings are fixed and a broken apple is just as nonsensical.

Re: Adding new item template properties?

Posted: Fri Jul 02, 2021 4:54 pm
by DunnyOfPenwick
On the topic of item templates, shouldn't there be a way to override modded item behaviour when using the INFO button in inventory, as with the USE functionality? Or is there a way and I just didn't see it?

I don't need this now, but I suspect someone might need it in the future.

Re: Adding new item template properties?

Posted: Fri Jul 02, 2021 9:38 pm
by Ralzar
Agreed, I have a couple of items in my mods where info would be very handy.