Script for floor damage depending on terrain ID?

I want to have a floor that would normally do floor damage (such as lava), but there is an invisible road over the lava (like see through) that the players can walk on without getting floor damage.

I thought that this might be possible by either doing a parallel process common event for that floor with a conditional branch, but I'm not sure how I would have to set that up. Somewhere here I thought I saw that someone had said that this might be possible using a small script, but I have no experience using and finding scripts, so could someone tell me which script I would have to use and how I would have to implement it?
The following script should do what you are wanting :

#==============================================================================# ** Game_Map#------------------------------------------------------------------------------# This class handles maps. It includes scrolling and passage determination# functions. The instance of this class is referenced by $game_map.#==============================================================================class Game_Map #-------------------------------------------------------------------------- # * ALIAS - Determine if Damage Floor #-------------------------------------------------------------------------- unless method_defined?🙂hud_q36N9Sjn_gm_damage_floor?) alias_method🙂hud_q36N9Sjn_gm_damage_floor?, :damage_floor?) end def damage_floor?(x, y, *args, &block) return if region_id(x, y) == 60 hud_q36N9Sjn_gm_damage_floor?(x, y, *args, &block) endend
damage-tile-avoid.png
All you need to do to set up the 'clear' path is paint region 60 over the damage tiles.
Alternatively, there are several scripts that execute a common event whenever the player steps on a region. For example Yanfly has one of those.


They are a lot more flexible as you can do a lot more than simple damage on a region with them - just make sure that the common event doesn't have a show text, that would be distracting if it pops up every tile.
I think I found the script that you mentioned Andar, The Common_Event_Tiles script?

My problem with installing is that I don't know from what point I need to copy&paste it. Do I need to copy paste it from line 1 or from a different line?

Does anyone have a screenshot of how such a script would be installed?

"

Tileset Notetags - These notetags go in the tileset notebox in the database.   # -----------------------------------------------------------------------------   # <event x: y>   # <event x: y, y>   # Sets the tiles marked with terrain tag y to trigger common event x. The   # common event will run each time the player steps over a tile with the   # respective terrain tags.
Does this mean that I have put those notetags in the tileset notebox in the database? And what would I actually have to do, because it's only making me more confused...
Always copy the entire script, and always into a new slot in the script editor. And that slot has to be below the slot named "Materials" and above the slot named "Main" in the script editor's list.


Each common event has a number - you see that ID number at the left list in the database. That number has to replace the X in the description


And for the Y set the number of the region.


If you want several different CEs react on different regions, make one such line for each common event.


And yes, those lines go into the notebox of the tileset used for the map.
In the end I went with the one posted above, because then I could make the actual floortile a damaging tile (which it was supposed to be) but mark the one that weren't supposed to be damaging without having to use different tiles.. With Yanfly's script I couldn't figure out how to make the exception...

Original thread: https://forums.rpgmakerweb.com/threads/script-for-floor-damage-depending-on-terrain-id.40382/