diff --git a/Data/AutoTest.esp b/Data/AutoTest.esp index 7ee05c9..2810466 100644 Binary files a/Data/AutoTest.esp and b/Data/AutoTest.esp differ diff --git a/Data/Source/Scripts/AutoTest_Suite_NPCs.psc b/Data/Source/Scripts/AutoTest_Suite_NPCs.psc index f5fab38..e5eb817 100644 --- a/Data/Source/Scripts/AutoTest_Suite_NPCs.psc +++ b/Data/Source/Scripts/AutoTest_Suite_NPCs.psc @@ -1,6 +1,6 @@ Scriptname AutoTest_Suite_NPCs extends AutoTest_Suite { - Collection of script functions testing NPCs (using screenshots of nakes actors). + Collection of script functions testing NPCs (using screenshots of naked actors). This helps in finding issues with missing textures, not fitting body types... Dependencies: * ConsoleUtil (https://www.nexusmods.com/skyrimspecialedition/mods/24858) diff --git a/Data/Source/Scripts/AutoTest_Suite_NPCsHead.psc b/Data/Source/Scripts/AutoTest_Suite_NPCsHead.psc new file mode 100644 index 0000000..fae8fc3 --- /dev/null +++ b/Data/Source/Scripts/AutoTest_Suite_NPCsHead.psc @@ -0,0 +1,45 @@ +Scriptname AutoTest_Suite_NPCsHead extends AutoTest_Suite_NPCs +{ + Collection of script functions testing NPCs head (using screenshots of naked actors). + This helps in finding issues with neck seams + Dependencies: + * ConsoleUtil (https://www.nexusmods.com/skyrimspecialedition/mods/24858) + * SKSE for StringUtil (https://skse.silverlock.org/) +} + +int gPreviousFov = 90 + +; Initialize the script +; [API] This function is mandatory and has to use SetTestType +function InitTests() + SetTestType("NPCsHead") +endFunction + +; Prepare the runs of tests +; [API] This function is optional +function BeforeTestsRun() + ; Get the fov value so that we can reset it at the end of the tests run + gPreviousFov = Utility.GetINIFloat("fDefault1stPersonFOV:Display") + ConsoleUtil.ExecuteCommand("tgm") + ConsoleUtil.ExecuteCommand("tcai") + ConsoleUtil.ExecuteCommand("tai") + ConsoleUtil.ExecuteCommand("fov 20") +endFunction + +; Finalize the runs of tests +; [API] This function is optional +function AfterTestsRun() + ConsoleUtil.ExecuteCommand("fov " + gPreviousFov) + ConsoleUtil.ExecuteCommand("tai") + ConsoleUtil.ExecuteCommand("tcai") + ConsoleUtil.ExecuteCommand("tgm") +endFunction + +; Register a screenshot test of a given BaseID +; +; Parameters: +; * *baseId* (Integer): The BaseID to clone and take screenshot +; * *espName* (String): The name of the ESP containing this base ID +function RegisterScreenshotOf(int baseId, string espName) + RegisterNewTest(espName + "/" + baseId) +endFunction diff --git a/README.md b/README.md index 14a91ad..ac4d054 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,39 @@ Example of Run file for this test, in `SKSE\Plugins\StorageUtilData\AutoTest_NPC ![Example of NPCs test](https://raw.githubusercontent.com/Muriel-Salvan/AutoTest/master/docs/npcs_example.jpg) +#### NPCsHead + +The `NPCsHead` tests suite will take screenshots of NPCs' head without any inventory. +This is especially useful to detect neck gaps. +Screenshots are taken in the usual game directory, the same way they are taken with the `PrintScreen` key. + +The test names used by this suite have the following format: `esp_name/form_id`. +The `form_id` part can be given either directly as decimal, or hexadecimal (in this case it is prefixed with `0x`). +For example: `skyrim.esm/78433` or `skyrim.esm/0x00013261` for the NPC named Beirand in Skyrim Special Edition. + +A test run will: +1. Put the player in god mode (as some NPCs can be hostile or knock the Player). +2. Disable Combat AI, so that NPCs should not attack player. +3. Disable Non-combat AI, so that NPCs should not initiate actions. +4. Change fov to 20 (as it is much easier to detect neck seams this way). +5. Teleport the player to the test cell `AutoTest_TestHall`. +6. Summon a copy of the NPC to be tested in front of him, without any inventory. +7. Take a screenshot. + +Example of Run file for this test, in `SKSE\Plugins\StorageUtilData\AutoTest_NPCsHead_Run.json`: +```json +{ + "stringList": { + "tests_to_run": [ + "skyrim.esm/78433", + "skyrim.esm/78434" + ] + } +} +``` + +![Example of NPCsHead test](https://raw.githubusercontent.com/Muriel-Salvan/AutoTest/master/docs/npcshead_example.jpg) + #### Locations The `Locations` tests suite will teleport the player to a given location and make a small camera circle around.