Jump to content

Trying to design an early-game water rework. What editing do I need to make and how for the following item changes?


FramFramson

Recommended Posts

I want to rework the early-game water system to smooth out the rather sharp but also rather short difficulty curve for hydration. This basically involves expending the "you boil buckets of water" which was a great response to the absurdity of not being able to gather water from standing water blocks; rather than just offering it as an alternative, I'd like standing water to be a comprehensive stage of water gathering on their own instead of just an alternate. Water purifiers could actually be an advanced convenience.

 

In order to implement this I need to add two things (and add a small edit as a third), first to make buckets relatively common and second to make water purifiers much rarer, which, honestly they should have been as a relatively sophisticated and expensive tech compared to nearly every other aspect of the early game. The exact technical changes I want to make are: 

 

- Buckets commonly available in loot, though where cooking pots are reliably found in kitchens, buckets should be in work areas like garages, barns, etc. Or if that is too complicated just make them fairly common (about the same as cook pots or perhaps even slightly more plentiful). They should also be available from traders early and often, at the same rarity and frequency as cook pots/grills.

 

- Water purifiers should cost twice as much and not appear until gamestage corresponds roughly to T3 missions, and even then be fairly rare. Ideally I'd like to add single ones as a rarer reward in the reward pool for T2 quests. They should start to appear semi-regularly (50/50 chance?) when your gamestage corresponds roughly with a player doing T4 missions.

 

- Minor edit to allow dew collectors to hold at least a full stack of water jars (10), so you don't need to constantly empty them. If possible, this should also be compatible with mods which enhance water barrel storage to three stacks (30), or incorporate that as an option. Not sure if this is actually possible as stacks, as mods like "64 slot dew collector" have them all individually slotted. This is a minor quibble though, and if I just want to increase the slots, Khzmusik's Rain Collector mod page has full instructions on how to add slots to dew collectors.

 

Ideally I'd like to directly incorporate the Silver Magister's bucket-boil mod into this , but the mod doesn't link to a forum thread so I'm not sure if they're on here for me to ask?

 

 

 

 

Link to comment
Share on other sites

20 hours ago, FramFramson said:

- Buckets commonly available in loot, though where cooking pots are reliably found in kitchens, buckets should be in work areas like garages, barns, etc. Or if that is too complicated just make them fairly common (about the same as cook pots or perhaps even slightly more plentiful). They should also be available from traders early and often, at the same rarity and frequency as cook pots/grills.

 

You can't really add them to garages and barns easily, but you can add them to lootgroups for place you could imagine finding a bucket--under sinks (groupSinks01), in utility carts (groupUtilityCart), and possibly in lockers (groupLocker01). Rather than add them to the sub lootgroups in those containers (which would also put buckets in unlikely places like trash bags and trash barrels), you could add them at the top level but with a fairly low drop chance--say "low" or "med" at most.

Edited by Cranberry Monster
poor freaking spelling (see edit history)
Link to comment
Share on other sites

10 minutes ago, Cranberry Monster said:

 

You can't really add them to garages and barns easily, but you can add them to lootgroups for place you could imagine finding a bucket--under sinks (groupSinks01), in utility carts (groupUtilityCart), and possibly in lockers (groupLocker01). Rather than add them to the sub lootgroups in those containers (which would also put buckets in unlikely places like trash bags and trash barrels), you could add them at the top level but with a fairly low drop chance--say "low" or "med" at most.

 

Was thinking destroyed workbenches would be a good place as well.

Just needs to be enough places that they can be found as commonly as cooking pots.

Link to comment
Share on other sites

On 12/17/2023 at 9:46 PM, FramFramson said:

I want to rework the early-game water system to smooth out the rather sharp but also rather short difficulty curve for hydration. This basically involves expending the "you boil buckets of water" which was a great response to the absurdity of not being able to gather water from standing water blocks; rather than just offering it as an alternative, I'd like standing water to be a comprehensive stage of water gathering on their own instead of just an alternate. Water purifiers could actually be an advanced convenience.

 

In order to implement this I need to add two things (and add a small edit as a third), first to make buckets relatively common and second to make water purifiers much rarer, which, honestly they should have been as a relatively sophisticated and expensive tech compared to nearly every other aspect of the early game. The exact technical changes I want to make are: 

 

- Buckets commonly available in loot, though where cooking pots are reliably found in kitchens, buckets should be in work areas like garages, barns, etc. Or if that is too complicated just make them fairly common (about the same as cook pots or perhaps even slightly more plentiful). They should also be available from traders early and often, at the same rarity and frequency as cook pots/grills.

 

- Water purifiers should cost twice as much and not appear until gamestage corresponds roughly to T3 missions, and even then be fairly rare. Ideally I'd like to add single ones as a rarer reward in the reward pool for T2 quests. They should start to appear semi-regularly (50/50 chance?) when your gamestage corresponds roughly with a player doing T4 missions.

 

- Minor edit to allow dew collectors to hold at least a full stack of water jars (10), so you don't need to constantly empty them. If possible, this should also be compatible with mods which enhance water barrel storage to three stacks (30), or incorporate that as an option. Not sure if this is actually possible as stacks, as mods like "64 slot dew collector" have them all individually slotted. This is a minor quibble though, and if I just want to increase the slots, Khzmusik's Rain Collector mod page has full instructions on how to add slots to dew collectors.

 

Ideally I'd like to directly incorporate the Silver Magister's bucket-boil mod into this , but the mod doesn't link to a forum thread so I'm not sure if they're on here for me to ask?

 

 

 

 

 

Just FYI, adding slots to dew collectors only works if you have my mod installed. You can't change them in vanilla, they're hard-coded.

Link to comment
Share on other sites

58 minutes ago, khzmusik said:

 

Just FYI, adding slots to dew collectors only works if you have my mod installed. You can't change them in vanilla, they're hard-coded.

 

Yes, I was going to use your instructions to incorporate extra slots into a larger mod. Which should work fine, I think? Or is there a reason that dew collector slot expansion needs to be standalone?

Link to comment
Share on other sites

53 minutes ago, FramFramson said:

 

Yes, I was going to use your instructions to incorporate extra slots into a larger mod. Which should work fine, I think? Or is there a reason that dew collector slot expansion needs to be standalone?

 

If you mean, incorporate my mod into a larger mod, then it will probably work.

 

But without my C# code, it definitely will not work. (That's what I meant, it's hard-coded in 7D2D's compiled C# code.)

 

Also, pay attention to load order, especially when other mods modify the XUi XML files. For instance, trying to do that when the SMX UI mod is installed, will cause errors. That's because SMX loads after my mod, and it wipes out the entire Dew Collector window and replaces it with its own. Renaming my mod with so it loads after SMX probably will work, but I don't use SMX so haven't tested it.

 

If you're trying to incorporate it into an overhaul, then that's really iffy, because overhauls are usually not meant to be modded.

Link to comment
Share on other sites

2 hours ago, khzmusik said:

 

If you mean, incorporate my mod into a larger mod, then it will probably work.

 

But without my C# code, it definitely will not work. (That's what I meant, it's hard-coded in 7D2D's compiled C# code.)

 

Also, pay attention to load order, especially when other mods modify the XUi XML files. For instance, trying to do that when the SMX UI mod is installed, will cause errors. That's because SMX loads after my mod, and it wipes out the entire Dew Collector window and replaces it with its own. Renaming my mod with so it loads after SMX probably will work, but I don't use SMX so haven't tested it.

 

If you're trying to incorporate it into an overhaul, then that's really iffy, because overhauls are usually not meant to be modded.

 

Ahhh, crap. Was hoping it wouldn't require such deep tinkering to make additional slots work, because that's all I want to do is add additional storage capacity to the dew collector. I was looking at these instructions:

 

Changing the Number of “Slots”

The “slots” are the number of empty squares in the dew collector’s output grid. Each slot generates one bottle of water when filled. There are three slots in the vanilla game.

To change the number of slots, you must make two changes:

1. In blocks.xml, add the “ContainerSize” property:

<property name="ContainerSize" value="4,2" />

The value represents the number of columns, then the number of rows.

2. In XUi/windows.xml, set the columns and rows on the “windowDewCollector” grid:

<set xpath="//window[@name='windowDewCollector']/rect/grid/@cols">4</set>
<set xpath="//window[@name='windowDewCollector']/rect/grid/@rows">2</set>

These values must match! If they do not, your game will crash.

 

Which doesn't mention anything abut C# code?

 

Is there something else that's required to ONLY change the number of slots that's not listed there? Is it a case where the above changes are only to the UI and any added slots after the base 3 will not fill without the additional C# code?

Link to comment
Share on other sites

7 hours ago, FramFramson said:

Is there something else that's required to ONLY change the number of slots that's not listed there? Is it a case where the above changes are only to the UI and any added slots after the base 3 will not fill without the additional C# code?

 

The "ContainerSize" property is something I added. It does not exist in vanilla. (Just like the "FogConvertMultiplier", "RainConvertMultiplier", and "MinConvertTemperature" properties.)

 

So that property would have no effect at all, and the game would still have only three slots.

 

I'm not positive what happens when the container size doesn't match the grid size in windows.xml. If the container size is larger than the grid size, the game will throw null reference errors. But I've never seen what happens when the container size is smaller than the grid size. My guess is that it will only fill up the first three slots.

 

The ability to change the container size was accomplished through a Harmony patch to the game's TileEntityDewCollector.HandleUpdate method, which is also where all the other calculations take place. My C# code is free to re-use, and is online as well as in the mod, if you want to strip out the "rain collector" stuff and only add the code that reads the "ContainerSize" property and sets the container size.

 

Here's the relevant code:
https://gitlab.com/karlgiesing/7d2d-a21-modlets/-/blob/main/khzmusik_Rain_Collector/Harmony/TileEntityDewCollectorPatches.cs?ref_type=heads#L325

https://gitlab.com/karlgiesing/7d2d-a21-modlets/-/blob/main/khzmusik_Rain_Collector/Harmony/TileEntityDewCollectorPatches.cs?ref_type=heads#L483 

Link to comment
Share on other sites

14 hours ago, khzmusik said:

I'm not positive what happens when the container size doesn't match the grid size in windows.xml. If the container size is larger than the grid size, the game will throw null reference errors. But I've never seen what happens when the container size is smaller than the grid size. My guess is that it will only fill up the first three slots.

 

I figured it couldn't hurt to try - why not, right?

 

I literally just copied the exact code you laid out for the windows.xml. Went with a simple 4x3 grid to test but it didn't even show any change to the grid at all and just displayed the base 3 slots which exist in vanilla. Interesting that it neither crashed nor changed the dew collector UI at all though (I did place new collectors to test this, though I did so in an existing game).

 

Just in case I didn't set it up right or missed something, Here's the minimod I made for the test: GDrive link, but I suspect that you're right and that this confirms there's no easy workaround here.

 

Not a huge issue, just means slot expansion will not be a feature I'll incorporate into my mod directly (would like the mod to be usable by players who can't or don't wish to disable EAC), though I will probably suggest it as an option, and if all my mod does is WRT dew collectors is to make water purifiers much harder to obtain from traders, there shouldn't be any conflicts with mods like your rain collector or other collector slot-expansion mods.

 

Edited by FramFramson (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...