Death from slip damage - sometimes only

On the Systems tab of the data base, I have unchecked the boxes "KO by Slip Damage" and "KO by Floor Damage" and this is fine because 90% of the time that's what I want.

However, there are a couple of places where I would like to have KO by these.  My guess is that I need to do a script call to enable either one, and another to disable, probably by referring to something with 'true' or 'false'.  However, I have no clue what that 'something' is.  I have found the couple of references to slip_damage in the script Game_Battler, but I don't understand it, and anyway, this would be on a map, not in battle.

Can anyone tell me what those script calls would be?

Thank you.
I think the script calls are:

$data_system.opt_floor_death = true // for floor damage death$data_system.opt_slip_death = true // for slip damage deaththey should work  🙂
Dead as door nails.  Ah, how satisfying!  (Being a dev brings out the sadist in one, don't you think?)

Thank you for your help.  Much appreciated.
The problem with that is if you made that call, then the player saved, exited and later continued the saved game, that value would no longer be set.


Or if you made the call, then the player exited to the menu and either loaded a different saved game or started a new game, that value WOULD be set when it shouldn't be.


Unless you change the value, execute whatever action is needed, and change the value back all within the one event, without the player being able to even call up the menu in between.
Hmm, no I don't think that doing it all within the one event would work.  The player has to find a safe route across an area.  Stepping on a terrain damage tile reduces HP.  The trouble with having the KO switch turned off is that there is no real incentive for the player to find the safe route - just walk straight ahead and heal up with a potion once safely on the other side.  That is what I'm trying to guard against.

Do you have any suggestions of another way of doing it if the above script call doesn't function the way I'd hoped?
You would need to set up switches for each of the above, and then change the script to refer to the switch instead of the $data_system variable wherever it is used.

That would keep it confined to that single save file, and the value would be retained if the player closed and resumed later.

Put the code below into a new slot below others, and set FLOOR_DEATH_SWITCH and SLIP_DEATH_SWITCH to the correct switch IDs. Turn the switches on at the start of the puzzle and off again afterwards.

Code:
class Game_Actor < Game_Battler  FLOOR_DEATH_SWITCH = 1  def max_floor_damage    $game_switches[FLOOR_DEATH_SWITCH] ? hp : [hp - 1, 0].max  endendclass Game_Battler < Game_BattlerBase  SLIP_DEATH_SWITCH = 2  def max_slip_damage    $game_switches[SLIP_DEATH_SWITCH] ? hp : [hp - 1, 0].max  endend
err, I'm afraid you've lost me here.  When you say a switch "for each of the above" what specifically are you referring to?  And the script call that EatYourBeetS provided doesn't make reference to a variable, so I'm completely confused by what you mean.  Sorry to be so dumb about this.
I edited my post and gave you the script. Don't use the script call at all - just use Control Switches.
They are falling like flies.  thank you.  

There is one final tweak, if that is possible.  At the moment it was dealing damage of 10HP per step.  If I wanted to change that to something else, how would I go about it?

Oh, and before I forget - I had already marked the earlier post as being the solution before you showed up.  Is it possible to unmark it, in case someone comes along at a later date, looks at it and doesn't read any further?
You should just be able to mark the new one as the solution and it will change them.

Code:
class Game_Actor < Game_Battler  FLOOR_DEATH_SWITCH = 1  def basic_floor_damage    5 # or whatever you want the floor damage to be  end  def max_floor_damage    $game_switches[FLOOR_DEATH_SWITCH] ? hp : [hp - 1, 0].max  endendclass Game_Battler < Game_BattlerBase  SLIP_DEATH_SWITCH = 2  def max_slip_damage    $game_switches[SLIP_DEATH_SWITCH] ? hp : [hp - 1, 0].max  endend
That does just what I want.

Thank you once again.  Players may hate you for working this out, but I am most appreciative.

As I think this is genuinely solved this time, I shall report the thread for closing.

Original thread: https://forums.rpgmakerweb.com/threads/death-from-slip-damage-sometimes-only.38696/