How Are Painting Created?

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

How Are Painting Created?

Post by Magicono43 »

I have been looking through the code and can't seem to find anywhere that the painting items are generated, and this makes me wonder if they can be generated at all? Either i'm completely missing something somewhere in the scripts or something else is going on, I do know there is meta-data to handle painting and such, but I don't see anything in places like "ItemBuilder.cs" that have any method like "CreateRandomPainting" or something.

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: How Are Painting Created?

Post by Interkarma »

My memory is they're generated straight from random loot tables using the template group and index, and the image displayed is selected randomly with UID as a seed. There's also a regression I need to look at where image isn't displayed correctly.

I'm about to leave for work, will be able to give more details a bit later today when back in front of my dev PC.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: How Are Painting Created?

Post by Magicono43 »

Interkarma wrote: Sun Feb 28, 2021 8:52 pm My memory is they're generated straight from random loot tables using the template group and index, and the image displayed is selected randomly with UID as a seed. There's also a regression I need to look at where image isn't displayed correctly.

I'm about to leave for work, will be able to give more details a bit later today when back in front of my dev PC.
Thanks for the info. I figured the painting must have been generating somewhere since I have had a few people tell me they have seen paintings occasionally show up, after some key-word searching for "paint" and "painting" I was just unable to find anything that I was used to seeing for the other items.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: How Are Painting Created?

Post by Magicono43 »

It was a lot more simple than I expected actually after seeing your response.
Capture1.JPG
Capture1.JPG (17.95 KiB) Viewed 735 times
You were close with how it generates a seed but slightly off, it does not use the UID of the item but instead rolls a random number between 0 and 65536, then that does some magic later on that turns that into the seed that chooses the image somehow, which started too look too complicated for me to easily comprehend, lol.
Capture2.JPG
Capture2.JPG (15.46 KiB) Viewed 735 times

Oh yeah, I saw the regression it looks like you were talking about, at least it just seems that the windows don't come up at the correct times when using the "info" action on the paintings, I assume the title is supposed to show and then after clicking off that the painting picture itself shows, here is what I was seeing.
Capture.JPG
Capture.JPG (54.16 KiB) Viewed 735 times
Thanks for the extra info though, was much more simple than expected for my purposes, lol.

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: How Are Painting Created?

Post by Interkarma »

Happy you were able to make progress for your needs. :)

It's supposed to render the painting within the dialog and it's not sizing appropriately in that screenshot. The issue I've seen is the painting doesn't render at all. The two issues could be related, I've not looked into this one at all.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: How Are Painting Created?

Post by Magicono43 »

Interkarma wrote: Mon Mar 01, 2021 12:19 am Happy you were able to make progress for your needs. :)

It's supposed to render the painting within the dialog and it's not sizing appropriately in that screenshot. The issue I've seen is the painting doesn't render at all. The two issues could be related, I've not looked into this one at all.
Ah ok, I also forgot to mention that my fork i'm working with is currently in 0.10.26 as well, so maybe the problem you brought up was a different one from the latest versions.

Post Reply