nsfwmodszzz Posted July 18, 2018 Posted July 18, 2018 (edited) It's been 20+ years since I did any fancy batch file writing and I have no idea how to do this anymore. My original goal was to display a random painting every time I enter a cell. Doing it in CK will consume ridiculous amount of time for me to learn how to do it so I had another idea. A batch file renaming from a random selection of DDS texture to the one linked to the painting's nif. I won't have a new painting every time in a cell but will have one every time I launch Skyrim. So here is the logic: >>> goto folder \textures\randomPaintings\ (this will contain all the candidate DDS files. the actual DDS linked to the nif is target.DDS. All other DDS files have names in 1.DDS, 2.DDS etc). Say there are 11 files in the directory (target.DDS + 10 other DDS files from 1 to 10) t = a random number from 1 to 10 rename target.DDS to target.DDS.tmp rename t.DDS to target.DDS rename target.DDS.tmp to t.DDS end >>> I want to combine and run this before SKSE64 in a single batch file. Thanks EDIT: Never mind, I guess batch file it's kinda like riding a bicycle. Here is the sample code in case anyone wants to try: >>> @ECHO OFF chdir /d "D:\\z" SET /a _rand=(%RANDOM%*5/32768)+1 ECHO Random number %_rand% rename 0.txt 0.%_rand% rename %_rand%.txt 0.txt rename 0.%_rand% %_rand%.txt >>> In this example there are 6 txt files in the folder d:\z going from 0.txt, 1.txt etc to 5.txt Edited July 18, 2018 by nsfwmodszzz solved Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.