From bf544b43a1bd24fe094158d713c1f3a0e5e0fcd4 Mon Sep 17 00:00:00 2001 From: Muriel Salvan Date: Mon, 18 Jan 2021 15:13:07 +0100 Subject: [PATCH] [Feature] Add NPCsHead tests suite to detect neck seams --- Data/AutoTest.esp | Bin 10136 -> 10686 bytes Data/Source/Scripts/AutoTest_Suite_NPCs.psc | 2 +- .../Scripts/AutoTest_Suite_NPCsHead.psc | 45 ++++++++++++++++++ README.md | 33 +++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 Data/Source/Scripts/AutoTest_Suite_NPCsHead.psc diff --git a/Data/AutoTest.esp b/Data/AutoTest.esp index 7ee05c9df4260d8049e466dbaf766d690cef8fd6..28104665317f258481ffd64444d8c6c6ae1a910b 100644 GIT binary patch delta 1238 zcmZ`(OH5Ny5S`Z_tp&;vlQo)5jH+?&X{jMg9T%Q z+@9?McmY~9%5iVGz~>lPxQHpah#s+5py(tlmF!Q}((ug09kVcGPEHR_6sFAr4J8Is zF6u@?GLcO*!Y?QB=plOZ7GB1pJVsN!qvvG;*tma-zzAoOq`VZf-Xe|!Uj%fEF+Lscy z^}zer=(Q-^_4G4A>P#}XA zMy)VNp+%N`FhQ11-WdN050vUHFt#9#1=bcMQB^VSjr8)1a3!k-#DHyyoTyjgk*~mB z9fAp4i3i{@*I;Y|OXJ-V_6OmSXUon63rcC^S=hBkoh^9|_)x687vUf^*nu^O=)qWGs`FQ<1AFL*Anfeje$n{)LMve*iIZ@{h<8 zE|Qa$b8fdR7!;($Trr4-N+R8#^wBmDx3+%_`e|eiJu;Jp+-$Lo^T6+M M^V9Y=K7I7&UmDR_dH?_b delta 816 zcmZ9Ky>Ami6vX%Z6@OuZ?F5sAfY-!vL zl)AUEwFRI$Yf5?i9z5Lbz5t&Ai~Wc1fhWP@XSi&5HSeSBdx!N;8u1^MOq~l@-Jmh6 z!_!kiCblWFrDQ6h)SKU)WaGEy9P4j&%F3Lp<;TLd=<7!8q7k2UTr$$n7zwXYFR@S3 z18=7I(nb;&jC6|h=ZxrOBNg~f`2IZD6(d9X_Og*EZscUv$f($oZYeDR+RjBI?Yxl! z`ibK)!!E$Pgckjz&?0nNG~Pd%8{rw@uWLpgQ-{p0l&75V1~r*Gc<8J6!|5m3SNY)S z3bVm{=8y38SKyb81myDZ?ck|d12lcIHD|!d@8exyX2{vvWYl0M=p)WJA$y_#hdCiW zmR{g=_=k8|G6h-o)Pc)RFXRqG%^r_Fy*{{)cE~JEHcKvxmrq`w^Jr#R?!v+e9Y!xA zqtBTvbsK+8KY`woRih8cHUtm2t4R(FzY*sfagHWhOI>hx%>U@KZ<52h%q#1XFXhF@ zvx!zOy%xRLlAE~?5@lQRt+*-O^8ID^a`JJdc6NJ@csOSd*sZQU@?^b!yCA$)_lDi4 xVlt?|l_#rvUR=Jc9?C)EvwUw<=W}Z3)wBMf_w?od^MU6nb$WW7OG$6-;2#Qo^)Ubd 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.