• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Sp3ctre18

Corporal
15 Badges
Feb 16, 2019
26
1
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • BATTLETECH
  • Cities: Skylines - Green Cities
  • BATTLETECH - Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • BATTLETECH: Flashpoint
  • Cities: Skylines - Campus
  • BATTLETECH: Heavy Metal
  • Cities: Skylines Deluxe Edition
  • BATTLETECH: Season pass
What would it take to create full immunity from water? So that a city could face a tsunami or even be completely underwater yet function as if it were dry - buildings, vehicles, pedestrians, etc.

We have boformer's "no water check" for props and trees, and TPB's "flood damage control." Are there other mods to cover the rest? Can looking at those mods help point the way to the complete solution? How likely is it for it to be manageable by someone with 2 semesters of java a few years back?
 
How likely is it for it to be manageable by someone with 2 semesters of java a few years back?

With some guidance, you could probably do it. For buildings, the key is this method in CommonBuildingAI. With the Harmony library, it is possible to modify that method so that it returns false. I guess you

upload_2019-4-16_16-26-10.png


I made a mod that disables park building fires that does a very similar (make a method return false instead of true). You could easily adapt it: https://gist.github.com/boformer/fe4c9ce55258f4f0e3f0c127b96a574e

Of course there are other things affected by a flood, like networks and vehicles. It could be more difficult to modify those, but with advanced Harmony features it should be entirely possible.

As a general starter for mod development (project setup etc.), take a look at my tutorials.

So far there is no tutorial about Harmony, so here is what you need to do:

1. Add the Lib.Harmony NuGet package to your project
2. Add this post-build script to your project. It makes sure that both the mod dll and the Harmony dll are auto-copied to the Mods folder when you compile your mod.
 
Thanks, Boformer, it's exciting to hear you think it's possible! I hadn't seen your tutorials before so I'll definitely look at those. I always feel a hindrance in coding is not knowing what methods and parameters are available. Hopefully I'll get a sense of how to address that.

But yeah, networks and cims are my main concern since I'm hoping looking at Flood Damage Control will reveal enough about the buildings.

As I start making progress I'll surely need to ask for some help. Where's the best place to do that? Simtropolis?
 
As I start making progress I'll surely need to ask for some help. Where's the best place to do that? Simtropolis?
Def. not this forum, it is kind of dead. I'm more active on Simtropolis, also a few other mod devs. Discord is also a good place, you can tag me there. I'm sending you a PM with an invite link.