663a900907ae0

663a900908133
1 Guest is here.
 

Topic: Photosensitivity mod test Read 411 times  

663a9009086c5ZylonBane

663a900908775
Figured I'd throw this in Engineering for a bit before inflicting it on the world.
Code: [Select]
System Shock 2 Decent Exposure Mod 0.9
22 November 2023
by ZylonBane

Requires SS2 NewDark patch v2.46 or higher.

"No more flashers!"

This is an accessiblity mod for players with sensitivity to flashing lights (photophobia,
photosensitive epilepsy).
- Sets animated lights with a brighten or dim interval of less than 1/3 second to
  permanently "on".
- Suppresses screen flash from player damage.
- Reduces screen flash from psi overload.
Modifying the screen flash effects was an absurd hack that frankly I'm surprised even works. Since all screen flashes are triggered by the massive player script, and rewriting that isn't an option, this just listens for the same damage events, then issues an overriding screen flash command with reduced duration or brightness.

Unfortunately the radiation screen flash couldn't be overridden in this way, since it runs off an internal timer instead of an external event.
« Last Edit: 08. January 2024, 21:01:07 by ZylonBane »
Acknowledged by: Marvin

663a900908bdaNameless Voice

663a900908c47
Unfortunately the radiation screen flash couldn't be overridden in this way, since it runs off an internal timer instead of an external event.

Couldn't you listen for the same timer?  It's a Timer message with data RadDamage.

663a900908d52ZylonBane

663a900908daf
Eh, maybe. The player script fires off so many timers so frequently that I'm loathe to hook Squirrel into that.

Well for a fringe mod like this I might give it a shot.

663a900908f23Nameless Voice

663a900908f77
Shouldn't matter much, you just listen for the Timer message, check the timer name, and return if it's not the one you're interested in.
That's how timer messages are handled.  There's even a script in NVScript that hooks into RadDamage to do this exact thing, allowing you to specify the fade colour for the radiation damage effect.  I think it was used in SecMod to change the glow from green to blue.

Code is here: https://github.com/NamelessVoice/NVScript/blob/master/NVScript/NVScript-SS2.cpp#L2764
(Annoyingly, the indentation seems to be a little messed up.)

663a9009090dfZylonBane

663a900909133
Yes I know how listening for timer messages works, but in my head spinning up an interpreted scripting engine dozens of times per second, constantly, seems like something that wouldn't be great for performance. That's why SCP has avoided adding any timers to the player.

Okay, added it. Seems to work.

Code: [Select]
System Shock 2 Decent Exposure Mod v0.91
23 November 2023
by ZylonBane

Requires SS2 NewDark patch v2.46 or higher.

"No more flashers!"

This is an accessiblity mod for players with sensitivity to flashing lights (photophobia,
photosensitive epilepsy).
- Sets animated lights with a brighten or dim interval of less than 1/3 second to
  permanently "on".
- Removes full-screen flashes from standard damage, radiation damage, and psi burnout.
- Removes muzzle flashes from pistol, assault rifle, and shotgun.
« Last Edit: 08. January 2024, 21:02:07 by ZylonBane »

663a90090920aNameless Voice

663a900909260
Hadn't thought of the potential impact of it being done in Squirrel instead of C++.   Could probably actually use script from NVScript that I linked earlier instead, if that's a worry.
1 Guest is here.
Death is my former employer.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
663a90090937e