Jump to content

Aesirkin

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by Aesirkin

  1. Anyone happen to try this and have any thoughts, suggestions, or bug reports before I put it up for download?
  2. If anyone is interested in trying this out, and in helping me test, I have a version available for download at https://www.dropbox.com/s/wnlppi3wlo9xemc/AesirkinNutritionBuffs.zip?dl=1 Please be sure to backup your game files (including C:\Users\[username]\AppData\Roaming\7DaysToDie) before trying it. Recommended for a new install, but preliminary testing seems to indicate it may work okay on an existing game. There is an included readme.txt file that explains exactly how it's supposed to work.
  3. This was a great suggestion; thanks so much! Unfortunately, playerhealth isn't defined anywhere I can see in the config folder. I tried looking at coretemp, which is a cvar, but no joy there either. However, I started looking at all the cvar addition and subtraction methods on buffs and noticed that just about every one (all operations done to variables reporting to display, anyway) were done in whole numbers. I multiplied every number in my mod so that no more decimal operations were taking place (all additions and subtractions were of integers) and a quick test indicates that may be working. I'd prefer smaller numbers capped at 100 as I think that's more relatable, but if making the cap 1000 fixes this issue I'm happy to make that trade. Going to do some more testing tomorrow, and probably some more tweaking, but I may be approaching completion.
  4. That's the direction I decided to go. I like the idea of maybe having a 2-pixel tall overlay on the health bar or something for each nutrient to help track it, but I can also see that annoying some players who want a stock-looking UI. And you don't really need to track these things that closely; they don't change often. So the player information tab seemed like the best route. I've also set the nutrition-gain buffs to show only in the full list and not the UI. I may update some others to as well; not sure yet. So I've managed to complete and test just about all the functionality. Yay. However, I still have one major problem... In windows.xml I have this: <configs> <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@textcontent)=0][1]/@textcontent">Protein</set> <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@valuecontent)=0][1]/@valuecontent">{cvar(cvarANBProtein)}</set> <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@textcontent)=0][1]/@textcontent">Carbs</set> <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@valuecontent)=0][1]/@valuecontent">{cvar(cvarANBCarbs)}</set> <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@textcontent)=0][1]/@textcontent">Greens</set> <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@valuecontent)=0][1]/@valuecontent">{cvar(cvarANBGreens)}</set> </configs> Which seems to work great. Except that as math starts getting done on these cvars I start to see something like this: So, okay, that's technically correct I guess :P. The math I do is all to only one significant digit, but I believe cvars are all doubles, which results in these tiny discrepancies that result in numbers like the above. I'd like to show these either as integers or with one decimal place (ie: 96 or 96.8). And I have absolutely no idea how to go about this. Anyone have any thoughts? My preference would be some sort of display mask in the windows.xml file if that's possible, but I can't find anything that works. I tried: <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@valuecontent)=0][1]/@valuecontent">{int(cvar(cvarANBProtein))}</set> Which just resulted in nothing being displayed. And: <set xpath="/windows/window[@name='CharacterFrameWindow']/grid[@visible='{showstats}']/player_stats_entry[string-length(@valuecontent)=0][1]/@valuecontent">int({cvar(cvarANBProtein)})</set> Which resulted in "int(12.75426)" being displayed. Having trouble finding any other clues in the default windows.xml file that would help. 😕
  5. Thanks doughphunghus; that is some great information! Much appreciated. I've made surprisingly quick progress on this. Xpath is very powerful and very easy; if only there were a 7DTD reference somewhere that would help me look up attribute meanings and possible values easier this would be a breeze! So my current status is: Create cvar variables one for each nutrition category (protein, carbs, greens) set to 50 on spawn Decrement cvars over time -15 per day min value of 1 increase rate of loss above 75 to make powerful buffs possible but expensive to maintain decrease rate of loss below 15 to make avoiding malnourishment easier at the beginning? apply iron gut bonuses? (may unbalance the system) Add effects to existing foods that increase these cvars based on food/drink digestion max value of 100 show nutrition info in item table Add debuffs/buffs based on these cvars that update as the cvars do Malnourished is minor debuff, currently slight stamina regen debuff Healthy (50 of all metrics) gives minor boost, currently slight stamina regen buff add buff for each nutrient when above 90 other buffs/debuffs Add ability to track these nutrition values Added to character stats screen Prevent UI problems / overload Show nutrition info as integers; not doubles (values currently sometimes showing as decimals with many sig digits) Figure out if nutrition bars should be displayed on the HUD, or just leave in a subwindow Figure out how to display buffs so that players don't constantly have too many cluttering their screen I'll continue to work on it this week. How do you know if a modlet will require a new game or work with an existing game? Are there any rules of thumb? Or do I just try it? What's a good way to test, not just for errors but for balance? I may want to rework things a bit eventually. For now I think this will address my original goals; to maintain a sustainable balanced diet, especially above 75, will require at least four different farmable mats plus meat, while avoiding the malnourished debuff really just requires you to not be starving all the time. I think there's room for improvement, though, to keep new food items being interesting as the game progresses even after you meet those basic five. I'd love to add some sort of "variety" cvar that tracks the number of different foods you've eaten (or maybe just basic ingredients) in the past 5 days or something, but can't begin to conceptualize how that'd work yet.
  6. Just thinking this through more. Here are the tasks I came up with to make this work: Create several cvar variables one for each nutrition category (maybe start with protein, carbs, greens?) set to 92 on spawn Decrement cvars over time maybe -20 per day or -1 per hour; whatever is easiest min value of 1 Add effects to existing foods that increase these cvars max value of 100 Add debuffs/buffs based on these cvars that update as the cvars do -10% associated stat when a nutrition drops below 2 -5% associated stat when a nutrition drops below 20 +5% associated stat when a nutrition increases above 70 +15% associated stat when a nutrition increases above 93 (for blood moons or focused activities) -something when all stats are below a given value? +something when all stats are above a given value? other combined buffs/debuffs? Add ability to track these nutrition values Some thoughts here: Just have to learn what xui is. 😛 Prevent UI overload Figure out if nutrition bars should be displayed on the HUD, or just leave it in a subwindow Figure out how to display buffs so that players don't constantly have 3+ cluttering their screen I'm assuming that cvars are some sort of session variable tied to the player that persist from play session to play session; I still need to read up on them. No idea how to set, access, or use them yet. Does this sound like I'm on the right track? Again, if anyone knows of another mod that uses cvars like this please let me know. I learn much quicker from example than from docs or tutorials.
  7. Thanks, everyone, for your responses. You've already fleshed this out to a far better concept than my original thoughts! This sounds great. I assume there's some way to tie a cvar to a buff, and to do a drain over time? I'll need to do some research on this. Any chance you could point me to a mod that does something similar so I could learn by example? I don't think they will if we make it a larger pool that depletes more slowly. Maybe it takes 5-7 days to dip from full to empty, so as long as they eat a different food each day they'll be doing okay. And maybe add an extra buff at 90%+ so you can get a little boost for blood moons at a resource cost you can't sustain the rest of the time. I really love this idea! My original thought was just to track how many different foods had been eaten, but tying it together like this could create a far more complex, fun, and in-universe-meaningful mechanic. This was one of the first questions that popped into my head when reading all the responses. Is it possible to add additional bars to track stuff? Also, this could result in a large number of buffs/debuffs and they would really clutter the display. What would be the best way to handle that problem? That's an interesting thought, but wouldn't that require more invasive changes than a modlet could do? And would it cause problems with using other mods at the same time? That's okay for me. I'm interested in creating something fun for me and my friends primarily. And adding something to the community for the minority makes me feel good as well. The beauty of mods is they're not forced on everyone, so you don't need to make something everyone enjoys; just something some people will enjoy.
  8. As a preface I'll say that I'm very very new to modding. I've been noodling around with an idea for a mod that just adds a few new mats, and buff items made with them, to the game. Even that's been a bumpy road. 😛 I'm now finally far enough in a game that hasn't crashed or corrupted to have a good set of farm plots going along with high level cooking, and noticed a weakness in the food system. We now just farm a couple crops needed to make one really good food and eat that all of the time. I feel like it detracts from the game; instead of food management evolving and staying fun in the late game it simply disappears. I'd like to see a mod that encourages dietary variety somehow, so in the late game there's still reason to farm more crops, continue to forage/hunt, and we'll face challenges with the food supply. The best approach I've come up with so far with my limited modding knowledge is to have each different food provide it's own small non-stacking buff that lasts 2-3 game days. However, if that buff is small it won't be worth worrying about, and if large it will make the game too easy (I like the challenge level Nomad provides right now), so I don't know that's the right direction to go. I couldn't find an existing mod that tried to address this, so I'd be willing to try to create one myself, but I'm just really not sure where the start. So I'd really welcome suggestions on how this might be accomplished given the modding capabilities we have from those more experienced than I. Or if someone else would like to try creating something based on this idea please feel free to take it and run with it.
×
×
  • Create New...