Closed: House and Ship information

Need something opened in the core for your mod, or even help with research?
User avatar
Interkarma
Posts: 3038
Joined: Sun Mar 22, 2015 1:51 am

Re: Open: House and Ship information

Post by Interkarma » Fri Feb 16, 2018 8:55 pm

Will do mate. :)

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

Re: Open: House and Ship information

Post by Interkarma » Fri Feb 16, 2018 9:53 pm

Hazelnut wrote: EDIT: Also for setting climate using dfMesh.SetClimate() where should I get the climateBase and climateSeason from? No rush for this bit - I can add climates later.
You can get climateBase from static helper class ClimateSwaps using the current climate type from PlayerGPS.

Code: Select all

ClimateBases climateBase = ClimateSwaps.FromAPIClimateBase(GameManager.Instance.PlayerGPS.ClimateSettings.ClimateType);
For climateSeason, you can probably just use ClimateSeason.Summer in the bank UI. I can't recall if classic applies snow texture set inside the bank interface. Otherwise, you can work out climateSeason from world time.

Code: Select all

DaggerfallDateTime.Seasons worldSeason = DaggerfallUnity.Instance.WorldTime.Now.SeasonValue;
ClimateSeason climateSeason = ClimateSeason.Summer;
if (worldSeason == DaggerfallDateTime.Seasons.Winter)
    climateSeason = ClimateSeason.Winter;
If you're wondering about the different climate & season handling between DFTFU and Daggerfall Unity, it's kind of a historical thing. All the layout guts were ported over from DaggerfallConnect and Daggerfall Modelling at the beginning when I was just building DFTFU. Which in turn came from my C++ codebase for Daggerfall Explorer written around 2000-2001.

As I started building out Daggerfall Unity, it was apparent the game world needed better climate & season handling beyond just the simplified model (climate+summer/winter/raining) required for laying out models. Rather than retro-fit this back onto the model layout code (which didn't really need it anyway), I just bridged them across with some helper methods. It can make things a but confusing though.

I also think it's kind of cool to see the progression of this layout code across the years from Daggerfall Explorer, to Daggerfall Modelling, to Daggerfall Unity.
daggerfall-explorer-2001.jpg
daggerfall-explorer-2001.jpg (81.57 KiB) Viewed 456 times
daggerfall-modelling-2009.jpg
daggerfall-modelling-2009.jpg (99.24 KiB) Viewed 456 times
daggerfall-unity-2017.jpg
daggerfall-unity-2017.jpg (100.01 KiB) Viewed 456 times
The engines above are Alchemy for Daggerfall Explorer (one of my first attempts at a game engine back in my DirectX and C++ days), XNALibrary for Daggerfall Modelling (built on XNA and C#), and of course Unity and C# today for Daggerfall Unity.

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

Re: Open: House and Ship information

Post by Hazelnut » Fri Feb 16, 2018 10:56 pm

Thanks for the info. I actually don't appear to get snowy houses in classic so can't really test whether seasons affect houses in bank UI. Tried both evening and morning star. Trees are snowy but not buildings. Ah well I will leave it affected by the current season for now.

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

Re: Open: House and Ship information

Post by Hazelnut » Fri Feb 16, 2018 11:44 pm

PR submitted for when you need a break from magic. Far too excited about this so for now I've just handled loading inside a bank by using the no houses for sale message. I'm happy to switch from using BuildingDirectory to datafiles, but not convinced it's worth it for this edge case. I'll sleep on it and see what opinions are posted by you, or others.

Player housing! 8-)

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

Re: Open: House and Ship information

Post by Hazelnut » Sun Feb 18, 2018 12:04 pm

Closing this as player housing is all done. Just need to wait until someone finds a bug. :)

Post Reply