Closed: House and Ship information

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Open: House and Ship information

Post by Interkarma »

I'll need to make an easy way for you to work backwards from building directory to model ID then. I'll see what I can do today. :)

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

Re: Open: House and Ship information

Post by Interkarma »

Numerical ModelID is now stored in BuildingSummary. You should be able to get the appropriate building model by looking up BuildingSummary in directory with just the buildingKey.

You should be able to load individual model and apply textures based on local biome to display in bank UI. Can assist with this step if any help needed.

To get you started, have a look at GetModelData() use starting at RMBLayout.AddModels() line 685 for example of getting raw model data using model ID. Then follow the trail for how this becomes a Unity model.

The DaggerfallMesh MonoBehaviour can do climate swaps for you. You should be able to attach this to singleton model gameobject and use it to set the climate. It's been literally years since I looked at this however, so I'll need to refresh myself if you come across any problems.

Let me know how you go.

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

Re: Open: House and Ship information

Post by Interkarma »

As pricing requires radius data from classic save, I'll need to give you an easy way to query this as well. We can get to resolving the price value a bit further down the track though.

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Open: House and Ship information

Post by R.D. »

I did add code that searched the current location building directory for type = for sale, but only got 1 or 2 buildings so I think that must be the wrong approach.
I think it is the correct approach, but we may have a problem with not all "house for sale" buildings being picked up by DF Unity. I just found a house that is a house for sale in classic but coming up as a regular residence (House2) in DF Unity.

The building is in Burgcester, Daggerfall, near the upper left corner.
Classic.jpg
Classic.jpg (70.11 KiB) Viewed 3473 times
DFUnity.jpg
DFUnity.jpg (61.9 KiB) Viewed 3473 times
Automap.jpg
Automap.jpg (95.37 KiB) Viewed 3473 times
Last edited by R.D. on Sun Feb 04, 2018 11:16 am, edited 1 time in total.

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

Re: Open: House and Ship information

Post by Hazelnut »

That might explain why I'm only getting 1 or 2 found then. I wonder if 'House for Sale' are just in there to nudge the player and let them know you can buy houses in the game? There must be another way the list gets generated with eligible buildings. Maybe some are converted at runtime, and not marked in the datafiles?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Open: House and Ship information

Post by R.D. »

My guess is that some houses that have other building types get assigned the HouseForSale building type at runtime.

I just checked with a different character and the house was a House for Sale there too, so it's probably always the same houses that get made into houses for sale.

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

Re: Open: House and Ship information

Post by Hazelnut »

I'm thinking we could make our own algorithm for house selection instead of duplicating the classic one. Just a thought.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Open: House and Ship information

Post by R.D. »

We could just do a random selection, right? (Might want to be careful to avoid including thieves guild and dark brotherhood hideouts in the list! :) Sounds funny but if buying a house removes the NPC inhabitants, it could make those guilds inaccessible) Also the selection shouldn't change every time you open the buy menu.

If we figure out how classic does it we could switch to that or have a choice of implementations. I'm not all that familiar with this part of the game and how much/little the selection of houses matters.

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

Re: Open: House and Ship information

Post by Hazelnut »

Yeah, I'm not sure. I still have to figure out how to make the 3d models appear and spin. Not sure when I'll get around to doing that yet. Need to learn some things about unity scenes first. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Open: House and Ship information

Post by Nystul »

Hazelnut wrote:Yeah, I'm not sure. I still have to figure out how to make the 3d models appear and spin. Not sure when I'll get around to doing that yet. Need to learn some things about unity scenes first. :)
I would suggest taking a look at the interior automap.
You could use a similar approach to what is implemented there (render the house model into a rendertexture which is then used as texture inside a ui panel)

Take a look at DaggerfallAutomap.cs and DaggerfallAutomapWindow.cs files. I splitted up gui window logic and automap logic, so you will have to take a look at both files:
  • panel and rendertexture stuff is in DaggerfallAutomapWindow.cs, especially see function updateAutomapView() how an update of the panel/view is performed
  • camera stuff is split among both files, since both have to use it at several points (the camera is created and managed by DaggerfallAutomap.cs because I tried to make only DaggerfallAutomapWindow.cs depend on DaggerfallAutomap.cs and not the other way around)
  • model related stuff is in DaggerfallAutomap.cs (make sure to use an own custom layer for the model geometry. you need to create and make sure the camera only uses this layer for rendering)

Post Reply