Need some info

Discuss modding questions and implementation details.
Post Reply
User avatar
scythe
Posts: 3
Joined: Fri Nov 11, 2016 12:04 pm

Need some info

Post by scythe »

(Just posted this in the wrong section)
Hi

I really love this project and have kept my eye on it for a while, I've decided to start modding for DFW. I have created the initial framework for my first mod "Player Needs DFW". I was just hoping I could get some info before I start going through all the scripts to help me learn more about DFW and increase my programming knowledge, you guys are amazing devs and made me realise how much knowledge was lacking after reading some scripts.

I need info on player resting functions, info on the using of items and adding new item groups as I do believe food and drink items may not have been present in DF, please correct me if I'm wrong. I haven't actually played much of the original DF and it was a long time ago.

I am hoping to create my own set of food/drink items, but kept within my mod rather than editing the source which I want to avoid to do as my skills are just not there to be able to help in an efficient way with development, hence wanting to mod over help development.

I'll look forward to your replies :D

User avatar
EpicSpellsword404
Posts: 50
Joined: Mon Sep 21, 2015 12:26 am

Re: Need some info

Post by EpicSpellsword404 »

First, good concept. While I do sometimes enjoy running around Tamriel as an all-powerful spirit, this would make things a lot more immersive.
Second, Daggerfall Unity isn't complete quite yet. Check the roadmap for more details.
And also, welcome and enjoy.

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

Re: Need some info

Post by Interkarma »

Hey spritefun, welcome to the forums. :)

You've picked a tricky subject for a first mod. Classic Daggerfall has a very hardcoded approach to item handling - I literally had to extract all the data out of fall.exe before I could start working with it. Almost everything about items is hard-coded in some way.

I've gone some distance to separating out item data from code (e.g. item templates are now in a JSON text file), but a lot of the hard-coded item DNA has come along for the ride as I need to maintain compatibility with classic saves, questing, and (later on) magical effects. This unfortunately means copying the way Daggerfall does certain things, even when a better solution should be considered. Bridging that gap becomes exponentially harder with more complex systems.

It's certainly not impossible to create custom items, but it would require a lot of code tinkering across several classes (in addition to new icons and scripting for item behaviours). And your mod is a double-whammy in that it would need not just new items, but new item categories that don't currently exist in the game. This is one is probably sadly out of the reach the mod system and Daggerfall Unity in its current state, I'm sorry to say. :(

User avatar
scythe
Posts: 3
Joined: Fri Nov 11, 2016 12:04 pm

Re: Need some info

Post by scythe »

Ah, I see how I may have a problem continuing this lol. I'd rather not do any messing around with the original scripts as I don't think my skills are quite there yet to avoid causing issues.

I have been able to load my own textures at runtime so I'm thinking maybe a whole new UI just for food and drink with my own items created separate to DF items. I know this is a big workaround, but I can store any data I need via XML meaning it wouldn't affect current classic save functionality. I suppose I'd have to create data sets based on which save is loaded which I think I could do given some time.

If you would prefer I dont work on this mod and focus on something else that's not a problem for me, I was considering making my own quests instead for when you implement the questing. Testing on original daggerfall will likely give me the playtime I'm missing too!

Thanks for your reply btw, if you're ok for me to continue this can you let me know where to find the player rest functions and I could probably have this working in a day or 2 depending on my free time.

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

Re: Need some info

Post by Interkarma »

Resting UI is handled by DaggerfallRestWindow.cs. Here's the high-level overview of that file:
  • Setup() is called once by the UI framework on first run of window.
  • UI state is reset any time rest window is pushed onto UI stack by OnPush() (again called by UI framework).
  • Player selects rest mode (for a while, until healed, loiter) and the amount of time.
  • In Update(), animation is played by TickRest() and player vitals are raised in TickVitals().
  • World time is incremented as UI window pops off stack in OnPop() by calling RaiseTime().
The check to see if any monsters are around happens when player hits rest key in game (R by default). The check itself is performed by the GameManager singleton using CanPlayerRest().

I hope that helps!

User avatar
scythe
Posts: 3
Joined: Fri Nov 11, 2016 12:04 pm

Re: Need some info

Post by scythe »

That's great, thanks. Looking forward to watching the project progress :D

Post Reply