HurtEffects.zh - Link Knockback, Sound, etc.
SubmittedDecember 14, 2016
Download Script Package
I've been holding back on submitting this for a while, primarily because of how the functions in this header could be...abused. Nevertheless, here it is.
The HurtEffects.zh header relates purely to the engine effects generated for Link, not for enemies, and gives you control over the following:
Knockback: Namely, the ability to disable knockback when Link is hit. This is useful for ensuring that if an enemy deals zero damage, Link isn't subjugated to knockback; or for spike mazes and such, t prevent knockback from causing multiple hits.
Hurt Sound Effects: The ability to disable, or randomise the sound generated when Link is hurt. Requires the included blank sound sample (Silent.wav)
Invincibility Frames: The ability to reduce, limit, or entirely eliminate Link's invincibility frames. This feature is pretty much why I was going to either avoid submitting this, or do so in an altered form. It i usable, but I advise that you should take great care in how you use it.
Note: This version (v1.2) includes a utility function that should prevent flickering, r flashing.
The header includes functions to determine if Link was damaged (current frame), and other utilities. Moat are used in the example global active script, and other example scripts.
Script Setup Details
Assign the desired numeric values to the Settings constants as needed.
If you wish to disable knockback entirely, at all time, set OVERRIDE_KNOCKBACK_GLOBALLY to 1.
If you wish to disable it conditionally, use the function DisableKnockback(true) to do so, and DisableKnockback(false) to revert to engine knockback, as desired.
To prevent knockback (globally) for 0-power weapons, and 0-power enemies, enable the setting OVERRIDE_ZERO_POWER_KNOCKBACK. This is enabled by default, so if you wish to retain knockback from 0-power hits, disable it.
Flash or Flicker
To disable flickering or flashing when hit, enable OVERRIDE_INVINCIBILITY_FLICKER and ensure that you assign the ffc script NoLinkFlicker to a slot when compiling. This feature requires ffcscript.zh.
Replace the sound assigned to Link's Hurt (Ouch) sound, with Silent.wav.
Populate the array HurtSFX with sounds that you want to use for land.
If you enabled 'WATER_HURT_SOUNDS' in Settings, populate the array HurtSFX_Water with hurt sound effects to play while Link is in water.
The ZIP includes v1.1, and v1.2, which is a preliminary upgrade; the sound file 'Silent.wav', and an example quest using v1.0 or v1.1. Version 1.1 is thoroughly tested.