tModLoader Destructible Tiles - Brutalize your worlds

hamstar

Terrarian



Requires Mod Helpers


Tiles can now be destroyed with direct hits from projectiles. Configurable.

This version is beta. Please try out the mod and report any issues or features you want to see.



Features planned:
  1. Set "physics-like" projectiles to factor velocity and possibly size into damage.
  2. Supply (configurable) table of minimum damage values (e.g. to prevent a wooden bow from breaking into the Lihzarhd temple).
  3. Add support for other weapon types (especially via. API).

Source available. API available. Config settings here.


 
Last edited:
v1.2.5
  • Clarified config settings
v1.2.4
  • Added MinionsCannotHitTiles setting
  • Clarified some settings via tooltips
  • Restructured projectile behavior code files
v1.2.3
  • Refactored configs to use FooDefinition keys for dicts (some renames)
  • Refactored configs to put defaults inline
  • Refactored configs to use properties instead of fields
  • Restructured config code files
v1.2.2
  • Attempted improvements to tile destroy code
v1.2.1.2
  • Fixed improper behavior with OnTileCollide
v1.2.1.1
  • Updated for latest MH edits
  • Fixed compile issue with Overlay subclass (ctor)
  • Fixed missing default ctor for ProjectileStateDefinition
  • Restructured project folders
v1.2.1
  • Updated for TML11.5
  • Implemented FloatInputElement for config
  • Changed Main.tile references to Framing.GetTileSafely(...)
  • Changed config settings to not use extreme value ranges
v1.2.0
  • Updated to MH5b and TML11.4
  • Added a ProjectileStateDefinition for defining friendly, hostile, is-npc, etc projectiles.
  • Refactored configs to use a projectile definition template to filter hostile, friendly, or NPC-sourced projectiles
  • Added config field ranges
  • Fixed config field defaults (avoids redundancy)
  • Changed TileDataManager deconstructor to use a mod unload LoadHook instead
v1.1.0.1
  • Fixed beam glitching against random tiles
  • Minor internal refactoring
v1.1.0
  • Added TileFinderHelpers.GetNeartestSolidTile(...)
  • Added support for beam weapons
  • Added minor optimization tweaks
  • Added CollisionHelpers (MeasureWorldDistanceToTile)
  • Implemented ProjectilesAsConsecutiveHittingAndCooldown setting (untested)
  • Added assurance of projectiles hitting at least 1 tile in OnTileCollide
  • Restructured some projectile code
  • Added BeamDamageScale config setting
  • Pre-configured ProjectilesAsConsecutiveHittingAndCooldown to let molotov fires "melt" tiles at a rate of ~3/4s per hit
  • Toned down beam weapons by using the same "can consecutive hit" code as regular projectiles
v1.0.1
  • Removes ProjectilesAsConsecutiveHittingAndCooldown and ProjectilesAsPhysicsObjectsAndMaxVelocity settings (for now)
  • Changed ProjectilesAsExplosivesAndRadiusAndDamage to ProjectilesAsExplosivesAndRadius
  • Set auto explosive projectile list building to not override any custom explosive definitions
  • Corrected some bad logic with explosive projectile damage calculation
v1.0.0
  • Set ReloadConfigFromFile() to reset projectile defaults
  • Further modified TileData to use AnimationTimeDuration instead of AnimationTimeElapsed (terminates animation on completion)
  • Modified TileData's use of TTL to be in ticks, and implemented damage reset effect on expire
  • Removed unnecessary debug outputs
  • Traded lock object for ConcurrencyDictionary in TileData
  • Added AllDamagesScale setting
  • Removed redundant tile damage overlay drawing
  • Internally restructured TileDataManager draw code
  • API functions added
  • Added mod icon
  • Added crash failsafe during drawing tile damage
v0.9.1
  • Modified default behavior of tile breaking to not drop items (configurable)
  • Added DestroyedTilesDropItems config setting
  • Implemented DestructibleTilesProjectile.HitTilesInRadius(...)
  • Added tile armor table config setting
  • Added debug outputs config option
  • Added explosive projectiles to in-memory configs
  • Refactored Hit functions to remove projectile references; only effect describing params are now used
  • Added GlobalProjectile.Kill(...) for explosive projectiles to apply their effect in a radius
  • Fixed issue with loading explosive projectiles
  • Properly cleared reference-based config fields in SetDefaults()
  • Added ProjectileTileDamageDefaults and ProjectileTileDamageOverrides config tables for supplying damage values for projectiles
  • Implemented DestructibleTilesProjectile.GetExplosives() as good as it's going to get
  • Added DestructibleTilesProjectile.ComputeProjectileDamage(Projectile)
  • Cleaned up some scaffolding
  • Added placeholder stub for custom tile damage
v0.9.0
  • First beta release.
 

Attachments

  • DestructibleTiles v0.9.0.zip
    23.2 KB · Views: 293
  • DestructibleTiles v0.9.1.zip
    30.6 KB · Views: 229
  • DestructibleTiles v1.0.0.1.zip
    37.4 KB · Views: 245
  • DestructibleTiles v1.0.1.zip
    37.5 KB · Views: 228
  • DestructibleTiles v1.1.0.zip
    39.2 KB · Views: 219
  • DestructibleTiles v1.1.0.1.zip
    39.3 KB · Views: 285
  • DestructibleTiles v1.2.0.zip
    67.9 KB · Views: 238
  • DestructibleTiles v1.2.1.zip
    68.2 KB · Views: 302
  • DestructibleTiles v1.2.1.1.zip
    68.2 KB · Views: 232
  • DestructibleTiles v1.2.1.2.zip
    70.2 KB · Views: 248
  • DestructibleTiles v1.2.2.zip
    71.1 KB · Views: 139
  • DestructibleTiles v1.2.3.zip
    76.3 KB · Views: 145
  • DestructibleTiles v1.2.4.zip
    80.3 KB · Views: 152
  • DestructibleTiles v1.2.5.zip
    76.4 KB · Views: 231
Last edited:
It looks very good. I have one idea. It would be great if monsters will have the ability to destroy tiles. Not all tiles, but, you know: dirt, sand, rock, etc. low-level tiles in summary.
 
v1.0.0 released, now with:
  1. Tile "armor" support (implemented but unused)
  2. Tile "damage scale" support (a secondary armor-like concept) - Martian Conduit added as an example of reducing general damage by 90%
  3. Projectile damage defaults and overrides support - Allows any given tile to receive damage differently from specific projectiles
  4. Explosive projectile support (projectiles can be adjusted)
  5. "In-house" tile damage rendering overlay - Allows for limitless tile breakage
 
Will there be support for beam weapons such as the last prism? My first thought upon seeing the mod was to use that and i was mildly sad that it didn't break anything. I'm unsure if the charged blaster cannon is likewise limited.
 
Will there be support for beam weapons such as the last prism? My first thought upon seeing the mod was to use that and i was mildly sad that it didn't break anything. I'm unsure if the charged blaster cannon is likewise limited.
I want to, but those require a special touch that will need more work.
 
Can you please add configs that prevents projectiles from non-players to destroy tiles ? Also, can you make so rooms housing NPCs cannot be destroyed ? Also, can you please add "compatibility" for the mod Various weathers so that thunder cannot destroy tiles, please ?
 
Can you please add configs that prevents projectiles from non-players to destroy tiles ? Also, can you make so rooms housing NPCs cannot be destroyed ? Also, can you please add "compatibility" for the mod Various weathers so that thunder cannot destroy tiles, please ?
You can already configure specific projectiles types or tile types to not give or take damage.

I can (attempt to) add a friend vs foe detection, player vs non-player detection.
 
You can already configure specific projectiles types or tile types to not give or take damage. I can (attempt to) add a friend vs foe detection, player vs non-player detection.
A, great ! May i ask a tutorial on the first post on how to do such modifications (and a example)?
 
A, great ! May i ask a tutorial on the first post on how to do such modifications (and a example)?
In the config, you'll want to do either of 2 things:

- Edit TileDamageScaleOverrides to specify the tile you want to adjust the damage scale for (set to 0 = invincible tile). By default, martian conduit is set to a really low value, as an example. Just add a new entry (or change the existing martian conduit entry), changing the table key's number value to the ID of the tile type you want.

- Alternatively, you can modify projectile damages directly. Similarly, you can add or edit an entry in ProjectileTileDamageDefaults using projectile IDs to specify the table keys. The second number is, of course, the projectile's damage.

All tiles by default have 100 hp.



Important note: All of this will completely change with the next version release. Hopefully it should be far more intuitive, thanks to ModConfig.
 
- Edit TileDamageScaleOverrides to specify the tile you want to adjust the damage scale for (set to 0 = invincible tile). By default, martian conduit is set to a really low value, as an example. Just add a new entry (or change the existing martian conduit entry), changing the table key's number value to the ID of the tile type you want.
Important note: All of this will completely change with the next version release. Hopefully it should be far more intuitive, thanks to ModConfig.
Ah, now xe're talking ! I know it would be a lot of work, but what if all the tiles were already included in the config file, so that all you need to do is searching the number you look for and modify it ?
Also, when i modify the data of a tile with varients, does it includes the varients or not ?
 
Back
Top Bottom