r/NoSodiumStarfieldMods • u/taosecurity • 10h ago
Free Mod Terrormorph Detector Tech Demo - Console vs PC
Several weeks ago I published a video explaining three different types of mods (esm, SFSE-only, SFSE+CommonLibSF). I promised to release the mods and the source code for all three. It's all live now on Nexus Mods:
https://www.nexusmods.com/starfield/mods/19027
GitHub:
https://github.com/taosecurity/terrormorph-detector-demo
What does it do?
This demo mod shows TERRORMORPH DETECTED when a living Terrormorph comes within 200 meters, and TERRORMORPH ELIMINATED when one of the noticed creatures perishes. This is a tech demo to show three ways to build a mod: 1) a plain ESM suitable for all platforms, without SFSE; 2) an SFSE-only mod, without CommonLibSF; and 3) an SFSE mod that uses CommonLibSF. Install only one.
The three versions (install only one)
- ESM (1.3.4): This is a plain plugin with a Papyrus script that checks once a second. It needs nothing extra, and it's built to work on Xbox and PS5 as well as PC. Its on-screen text uses Message records, not the debug-only Debug.Notification. It has a Show Debug Messages option in Settings > Gameplay Options.
- SFSE-Only (1.3.4): This is a native SFSE plugin that uses only SFSE's own plugin header and its own Address Library reader. It behaves like the ESM version.
- SFSE + CommonLibSF (1.3.4): This is a native SFSE plugin built on CommonLibSF. It behaves like the ESM version, and it loads only on game version 1.16.244, like SFSE-Only.
A Terrormorph is an actor whose race is TerrormorphRace or TerrormorphElderRace, so Elder Terrormorphs count too.
How it works
- ESM: A quest that starts with the game runs a Papyrus script once a second. Each check restarts a second, small quest, and the game itself fills that quest's list with the living, enabled actors near you whose race is TerrormorphRace or TerrormorphElderRace, closest first. The script reads that list in one step and keeps the ones within 200 m, so a check stays quick even with many other creatures around. It remembers which of those it has already announced and shows the detected notice only for new ones. When one it announced disappears due to dying, the mod shows the "eliminated" notice. The notices are Message records shown with Message.Show(), because Bethesda marks the whole Debug script as debug-only and its on-screen functions show nothing on consoles. No vanilla records are changed.
- SFSE versions: Once a second, from a task that SFSE runs once a frame, the plugin walks the game's list of active actors and applies the same rules as the ESM version. SFSE runs these checks one at a time, and they don't always run on the same game thread. Its notices use the same corner message that Papyrus Debug.Notification shows. The few game internals these versions use (Address Library IDs and structure offsets for game 1.16.244) are listed in their source code (src\Game.h in SFSE-Only).
I'm working on the Creations release now and will post a comment what that is live.
It will only be the ESM version on Creations.