Closed: House and Ship information

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

Re: Open: House and Ship information

Postby Interkarma » Sun Feb 11, 2018 2:15 am

R.D. wrote: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.

Agreed! Also, the player's own home should be filtered out of house selection by quest system.

You guys will likely have this all done before I would have even started, so you're likely to know more than me. I'll keep focused on the spell system, but just let me know if any help needed with this. :)
User avatar
Hazelnut
Posts: 341
Joined: Sat Aug 26, 2017 2:46 pm

Re: Open: House and Ship information

Postby Hazelnut » Sun Feb 11, 2018 9:25 am

Nystul wrote:
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)

Thank you for the pointers. Am I correct that using the layer will allow me to have a 3d model that I can render without getting rid of the main game scene? I was thinking I needed to create a new scene, but if you can't have 2 active at once that would not work. Didn't know about layers, so thanks for the heads up.
User avatar
Nystul
Posts: 889
Joined: Mon Mar 23, 2015 8:31 am

Re: Open: House and Ship information

Postby Nystul » Sun Feb 11, 2018 10:14 am

Hazelnut wrote:Thank you for the pointers. Am I correct that using the layer will allow me to have a 3d model that I can render without getting rid of the main game scene? I was thinking I needed to create a new scene, but if you can't have 2 active at once that would not work. Didn't know about layers, so thanks for the heads up.

Exactly, it prevents that any other geometry will be rendered in that camera except the geometry belonging to the specified layer.
Just make sure that the house model is correctly unloaded/destroyed on bank window close, to prevent any problems with other cameras that don't know anything about this specific layer
User avatar
Hazelnut
Posts: 341
Joined: Sat Aug 26, 2017 2:46 pm

Re: Open: House and Ship information

Postby Hazelnut » Sun Feb 11, 2018 11:06 am

I can see the layers defined, but none of them appear to be allocated in the editor. Are they all assigned in code then?

BTW, thanks for the help. Probably not going to get to this today as I'm really tired from helping my daughter & family move house, but it really helps planning and getting an idea what I will need to do.
User avatar
Nystul
Posts: 889
Joined: Mon Mar 23, 2015 8:31 am

Re: Open: House and Ship information

Postby Nystul » Sun Feb 11, 2018 3:33 pm

take a look at function Awake() in DaggerfallAutomap.cs:
it will try to get layer index from name (automap layer is called "Automap") - if it finds a layer called "Automap" it will use this layer, otherwise automap defaults to layer 10 and afterwards makes sure that the main camera does not render this layer (your custom camera will have to render only this layer)

you could use a different currently unused layer for the house model geometry as default/fallback layer or we define a new layer in the project settings.

layers are defined in unity under Edit->Project Settings->Tags and Layers
next free layer would be 12
User avatar
Hazelnut
Posts: 341
Joined: Sat Aug 26, 2017 2:46 pm

Re: Open: House and Ship information

Postby Hazelnut » Fri Feb 16, 2018 5:21 pm

Interkarma wrote: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.

I'm wondering if querying the buildingDirectory is the right approach since it's not been created until you step outside due to the suppressWorld mechanism. So loading a save inside a bank would not allow house purchases. Not a big deal, I can always implement some kind of "can't by a house at this time" message, or alternately I could query the location DFBlocks from game data like is done in quest site generation, talk window, automap etc.

What do you think the best approach is?

Also, where is this radius data in the data structures? I can't find any references to it.

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.
User avatar
Interkarma
Posts: 2143
Joined: Sun Mar 22, 2015 1:51 am

Re: Open: House and Ship information

Postby Interkarma » Fri Feb 16, 2018 8:20 pm

Agree it's probably not the best place for this data. That's why I was a bit nebulous around "an easy way" above. :) I'll think of a way to handle this and get it in over weekend for you.

Radius is in model data for building in ARCH3D.BSA. I don't generally use it, but it should not be a problem linking this up to a building key query.
User avatar
Hazelnut
Posts: 341
Joined: Sat Aug 26, 2017 2:46 pm

Re: Open: House and Ship information

Postby Hazelnut » Fri Feb 16, 2018 8:24 pm

Interkarma wrote:Agree it's probably not the best place for this data. That's why I was a bit nebulous around "an easy way" above. :) I'll think of something to make this easy and get it in this weekend for you.

Can't I simply copy the approach taken in the other places reading DFBlocks data? I'm happy to do that, I don't want to distract from you working on magic systems. Unless there's a reason you would like to handle it of course?
User avatar
Interkarma
Posts: 2143
Joined: Sun Mar 22, 2015 1:51 am

Re: Open: House and Ship information

Postby Interkarma » Fri Feb 16, 2018 8:39 pm

Go ahead, I trust you to find a good way as well. I'd love to dive into the magic systems for a while. :) Just let me know if any assistance needed later and I'm happy to help.

For the climate stuff, the interior layout process should give you some leads. I'll drop some more exact info later when I'm behind a computer.
User avatar
Hazelnut
Posts: 341
Joined: Sat Aug 26, 2017 2:46 pm

Re: Open: House and Ship information

Postby Hazelnut » Fri Feb 16, 2018 8:50 pm

Great thanks, most of house buying is working now. Need to switch to game data and do pricing and climate then it's done. I will submit without that last one, as it can be done anytime. :D

If you could commit yesterday's PR sometime today that would be helpful. In between that spell slinging. :lol:

Return to “Work Requests”

Who is online

Users browsing this forum: No registered users and 1 guest