How to disable red flash on damage?


#1

When you take damage, the screen will flash red.
Does anyone know if there’s a menu, script, command to disable it?



#2

If you want to turn it off on your own copy, it’s easy to tweak the code. Look in the prototypes for a function like “player_damage_screen_flash”, and just make the whole thing equal null. For example, in the latest git, it’s something like:

	player_damage_screen_flash: "def(int damage_amounts) -> commands
		if(damage_amounts > 2 or damage_amounts >= hitpoints, 
			screen_flash([255, 0, 0,255], [255, 0, 0,0], 4),  
			if(damage_amounts = 2, 
				screen_flash([255, 0, 0,200], [255, 0, 0,0], 3), 
				screen_flash([255, 0, 0,70], [255, 0, 0,0], 2)))",

And if you just change it to this, the flashing will be eliminated:

	player_damage_screen_flash: "def(int damage_amounts) -> commands null",

If you’re running an earlier version of the code (like 1.3), you might need to omit the “-> commands” part.


#3

Thank you very much!
Patch works fine, for the development version.

--- frogatto-a/modules/frogatto/data/object_prototypes/base/player_controlled_platformer_character.cfg	2014-06-19
+++ frogatto-b/modules/frogatto/data/object_prototypes/base/player_controlled_platformer_character.cfg	2014-06-19
@@ -21,12 +21,7 @@
 	]",
 	
 	/*TODO:  these might be changes per frame, not "something to tween to"*/
-	player_damage_screen_flash: "def(int damage_amounts) -> commands
-		if(damage_amounts > 2 or damage_amounts >= hitpoints, 
-			screen_flash([255, 0, 0,255], [255, 0, 0,0], 4),  
-			if(damage_amounts = 2, 
-				screen_flash([255, 0, 0,200], [255, 0, 0,0], 3), 
-				screen_flash([255, 0, 0,70], [255, 0, 0,0], 2)))",
+	player_damage_screen_flash: "def(int damage_amounts) -> commands null",
 	
 	character_specific_damage_response: "def(string damage_type, int amount) -> commands null",
 	

#4

Glad I could help. :slight_smile: