[kofi]

The Sims 4 Management Mod – Mods Folder Broom By Aravyn

🛠 แนะนำสคริปต์จัดการ Mod The Sims 4: จบทุกปัญหาไฟล์ซ้ำ ซ้อนลึก และไฟล์ขยะ!

หากคุณเป็นสายโหลดม็อด (Mod) ที่มีไฟล์ในโฟลเดอร์เป็นร้อยเป็นพันไฟล์ คุณน่าจะเคยเจอปัญหาน่าปวดหัวอย่างม็อดไม่ทำงานเพราะใส่โฟลเดอร์ซ้อนลึกเกินไป มีไฟล์ซ้ำ หรือมีไฟล์ขยะปะปนอยู่เต็มไปหมด วันนี้เรามี Windows Console Application ตัวหนึ่งที่จะมาช่วยชีวิตคุณ!

โปรแกรมนี้มีฟีเจอร์เด่นๆ ทั้งการจัดหมวดหมู่ไฟล์ตามเงื่อนไข, วิเคราะห์โฟลเดอร์, ย้ายไฟล์ และลบไฟล์แบบ Soft-delete (ส่งลงถังขยะเพื่อให้กู้คืนได้) ตัวโปรแกรมรองรับ 3 ภาษา (อังกฤษ, รัสเซีย และเยอรมัน) และทำงานผ่านไฟล์ JSON ทำให้ง่ายต่อการแปลเป็นภาษาอื่นๆ ในอนาคต

เมื่อเปิดใช้งานครั้งแรก โปรแกรมจะทำการตรวจสอบหาไฟล์ Resource.cfg ในโฟลเดอร์ Mods เพื่อยืนยันความถูกต้องของ Path และตรวจสอบหาไฟล์ GameVersion.txt ในโฟลเดอร์หลักของเกม

6XsOkXIy o

🌟 ฟีเจอร์หลักของโปรแกรม

1. ค้นหาม็อดที่อยู่ลึกเกินไป (List overly nested mods)
ค้นหาไฟล์ม็อดที่ถูกจัดเก็บในโฟลเดอร์ซ้อนกันลึกเกินกว่า 1 ระดับ (เช่น Mods/Folder/SubFolder/…) โดยค่าเริ่มต้นจะตรวจจับเฉพาะไฟล์นามสกุล .ts4script เนื่องจากม็อดประเภทสคริปต์จะไม่ทำงานหากนำไปไว้ในโฟลเดอร์ที่ซ้อนกันลึกเกินไป

2. ค้นหาไฟล์ซ้ำ (List duplicates)
จับคู่ไฟล์ที่มีชื่อเหมือนกัน ไม่ว่าไฟล์เหล่านั้นจะซ่อนอยู่ซอกไหนของโฟลเดอร์ Mods ก็ตาม

3. จัดการไฟล์ที่ไม่จำเป็น (List unnecessary files)
ค้นหาและช่วยคุณลบ “ไฟล์ขยะ” ที่ไม่ใช่ม็อดและไม่ได้ถูกใช้งานในเกม เช่นไฟล์ .txt, .png ฯลฯ
(คำเตือน: ผู้พัฒนาพยายามรวบรวมนามสกุลไฟล์ม็อดทั้งหมดแล้ว แต่ก็อาจมีตกหล่น โปรดตรวจสอบรายชื่อไฟล์ให้ดีก่อนกดยืนยันการลบ)

4. แสดงรายชื่อไฟล์ทั้งหมด (List all files)
แสดงไฟล์ทั้งหมดโดยเรียงจากเก่าสุดไปใหม่สุด มีประโยชน์มากเวลาที่คุณต้องการโละ CC/Mods เก่าๆ ที่อาจจะพังแล้วทิ้ง (หมายเหตุ: โปรแกรมไม่สามารถบอกได้ว่าม็อดนั้นพังหรือไม่ แต่จะบอกได้แค่วันที่แก้ไขไฟล์ล่าสุดตามระบบของเครื่อง)

  • ค่าเริ่มต้นจะแสดงเฉพาะ .ts4script
  • นามสกุลไฟล์ที่โปรแกรมจะข้ามไป (Ignored): .package, .json, .log, .ini, .dict, .dat, .cfg รวมถึงไฟล์สำคัญของม็อดอื่นๆ เช่น mc_lastexception.html, BE-Scanning.html

5. ค้นหาไฟล์ที่ถูกปรับปรุงก่อนวันที่กำหนด (List files modified before [date])
ทำงานตรงตามชื่อเลย คือค้นหาไฟล์ที่เก่ากว่าวันที่คุณระบุ

6. ค้นหาและจัดการไฟล์ (Find and manage file)
คุณสามารถค้นหาไฟล์ได้ทั่วทั้งโฟลเดอร์ Mods (รองรับการค้นหาแบบ Regular expressions) เมื่อได้ผลลัพธ์แล้ว คุณสามารถ:

  • ย้ายไฟล์ไปยังโฟลเดอร์ที่ต้องการ (หากไม่มีโฟลเดอร์นั้น โปรแกรมจะสร้างให้ใหม่ โดยต้องใส่ Path เต็ม เช่น C:\Users\User\Documents\Electronic Arts\The Sims 4\Mods\My New Folder)
  • ย้ายไฟล์ลงถังขยะ (Recycle bin) เพื่อให้กู้คืนทีหลังได้หากเปลี่ยนใจ
  • หรือแค่กด “Enter” เพื่อข้ามไปโดยไม่ทำอะไรเลย

7. ค้นหาไฟล์ที่คล้ายกัน [โหมดทดลอง] (Find similar files)
ระบบจะให้คุณใส่คำค้นหาและ “ระดับความคล้าย” เพื่อดึงรายชื่อไฟล์ที่ตรงกับเกณฑ์ออกมา โดยคำนวณจากเปอร์เซ็นต์หรือจำนวนตัวอักษรที่ตรงกัน

8. ตั้งค่าโปรแกรม (Edit settings)
ปรับแต่งการทำงานของโปรแกรมผ่านเมนูนี้ หรือจะแก้จากไฟล์ settings.json โดยตรงก็ได้ (บางการตั้งค่าต้องรีสตาร์ทโปรแกรมใหม่)

  • Path to Mods folder: ระบุตำแหน่งโฟลเดอร์ Mods
  • Allowed extensions: นามสกุลไฟล์ที่จะไม่ถูกนับว่าเป็น “ไฟล์ขยะ”
  • Ignored directories/files: โฟลเดอร์และไฟล์ที่ต้องการให้โปรแกรมมองข้าม
  • Search mode for nested files: นามสกุลไฟล์ที่จะใช้ตรวจจับในโฟลเดอร์ที่ซ้อนลึก (รองรับ .ts4script และ .package)

9. เปลี่ยนภาษา (Change language)
ข้อความในโปรแกรมส่วนใหญ่ดึงมาจากไฟล์ .json ทำให้ง่ายต่อการแปล ปัจจุบันมีภาษาอังกฤษ รัสเซีย และเยอรมัน

10. ออกจากโปรแกรม (Exit)
คุณต้องไม่เชื่อแน่ๆ ว่าปุ่มนี้มันทำอะไรได้! (แหมๆ ไม่ลองกดดูละ)


⚙️ วิธีการติดตั้งและการใช้งาน

  1. แตกไฟล์โปรแกรม (Unarchive) นำไปไว้ในโฟลเดอร์ The Sims 4 ของคุณ
  2. เปิดโปรแกรม ไปที่เมนู Settings (หรือเปิดไฟล์ settings.json) แล้วเปลี่ยน Path ให้ชี้ไปยังโฟลเดอร์ Mods ของคุณ
    • สำคัญ: หากแก้ในไฟล์ json โดยตรง ให้ใช้สัญลักษณ์ \\ เป็นตัวคั่นแทน \ หรือ / (เช่น C:\\Users\\user\\Documents\\Electronic Arts\\The Sims 4\\Mods) แต่ถ้าป้อนลงในโปรแกรมโดยตรงสามารถใช้ \ ได้เลย
  3. รีสตาร์ทโปรแกรม หากทำถูกต้อง โปรแกรมจะแสดงเวอร์ชันของเกมขึ้นมา และไม่แจ้งเตือนว่าขาดไฟล์ Resource.cfg

🛡️ หมายเหตุเรื่องแอนตี้ไวรัส:
โปรแกรมนี้เป็น Open-source ที่สามารถตรวจสอบโค้ดได้บน GitHub และผ่านการรีวิวจากทีมงานเว็บ Mod The Sims แล้ว หากโปรแกรมแอนตี้ไวรัสของคุณบล็อกการดาวน์โหลดหรือการทำงาน นั่นเป็นเพราะแอนตี้ไวรัสมักจะระแวงไฟล์ .exe ใหม่ๆ ที่ไม่มีใบรับรองดิจิทัล (ซึ่งใบรับรองนี้มีราคาหลายร้อยเหรียญต่อปี ไม่คุ้มสำหรับผู้พัฒนาโปรแกรมฟรี)
วิธีแก้: คุณสามารถ Compile โค้ดด้วยตัวเอง หรือตั้งค่าแอนตี้ไวรัสให้ยกเว้น (Exclude) โปรแกรมนี้ชั่วคราว


🚀 แผนการในอนาคต

  • เวอร์ชัน MacOS: มีแผนจะปล่อยออกมาเร็วๆ นี้!
  • ฟีเจอร์ลบไฟล์แคช (Cache Cleanup): ผู้พัฒนาแจ้งว่าจะ ไม่ทำ ฟีเจอร์นี้ ด้วยเหตุผลเรื่องมารยาทต่อนักพัฒนาม็อดท่านอื่น (Andirz) ที่ทำสคริปต์ลบแคชอยู่แล้ว แม้ม็อดของ Andirz จะเป็นแบบเสียเงิน แต่การเขียนสคริปต์ลบแคชเป็นสิ่งที่ใครๆ ก็เสิร์ชกูเกิลและทำเองได้ในเวลาไม่ถึง 5 นาที ผู้พัฒนาจึงมองว่ามันคือ “ภาษีของคนขี้เกียจ” (Laziness tax) และเข้าใจได้ที่ Andirz จะทำแบบนั้น
  • การแจ้งบั๊กและข้อเสนอแนะ: หากพบเจอบั๊กหรือมีไอเดียเพิ่มเติม สามารถแจ้งผู้พัฒนาได้เสมอ (ในบางกรณีอาจมีการขอให้คุณบีบอัดไฟล์โฟลเดอร์ Mods ของคุณส่งไปให้เพื่อใช้ทดสอบด้วย)

This script is a Windows console application that offers a few solutions to common headaches when dealing with more than a dozen of mods. Features include forming lists based on various criteria, folder analysis, moving and soft-deleting files (by moving them to the recycle bin so they can be restored if necessary). Supports three languages (English, Russian and German) by default and loads the localization from external JSON files for easy translation process.

On startup, the script verifies the presence of Resource.cfg inside the Mods folder to verify the path and GameVersion.txt in the parent directory.

Core functions:

1. List overly nested mods

  • Lists all the files nested deeper than first nesting level (i.e., starting from Mods/Folder/SubFolder/…).
  • Detects only .ts4script files by default, as script mods simply won’t work when nested too deeply.

2. List duplicates

  • Lists pairs of files with the same name, regardless of where they’re located in the Mods folder.

3. List unnecessary files

  • Lists and prompts to delete “”garbage”” files that are neither mods themselves nor used by mods, such as .txt, .png, and so on.
  • Please note that while I’ve tried to account for all possible file extensions used by mods, I might’ve overlooked something, so read the list carefully before deleting them.

4. List all files

  • Lists all files from oldest to newest. Might be useful when you’re trying to get rid of old and potentially broken CC/mods. DOES NOT tell you if the mods/CC listed are broken or not, only the last date the file was modified (according to the system).
  • Set to .ts4script only by default.

Extensions ignored by default:

  • .ts4script
  • .package
  • .json
  • .log
  • .ini
  • .dict
  • .dat
  • .cfg

Files ignored by default:

  • mc_lastexception.html
  • BE-Scanning.html
  • DO NOT DELETE THIS FOLDER

5. List files modified before [date]

  • Self-explanatory.

6. Find and manage file

  • Prompts a search query (supports regular expressions) and scans the entire Mods folder. After you get the list, you can:
  • Move the files to a specified folder (if the folder doesn’t exist, it will create it for you). Please note than you have to enter the full path to the folder, e.g. C:\Users\User\Documents\Electronic Arts\The Sims 4\Mods\My New Folder
  • Move the files to recycle bin (so you can restore them later if you change your mind).
  • Just hit the “”enter”” button and do nothing.

7. Find similar files

  • [Experimental]
  • Prompts a search query and similarity threshold. Forms a list of files that pass the threshold, which is calculated either in percentages or by a number of matching symbols.

8. Edit settings

  • Allows you to change the settings, duh.
  • You can also do that by editing settings.json file.
  • Some changes require restarting the app.

List:

  1. Path to Mods folder: Self-explanatory.
  2. Allowed extensions: What type of files the app won’t include in “”garbage files”” list.
  3. Which file extensions to list in file list: self-explanatory.
  4. Ignored directories: what folders the app will always ignore.
  5. Ignored files: same but files.
  6. Search mode for nested files: what type of files the app should include in the list. Currently only supports .ts4script and .package.
  7. Include query in similarity calculation: if your query was “”AuthorName””, should it calculate the similarity level including your query or not?
  8. Back to menu.

9. Change language

  • Almost all UI text (with the exception of a few extreme situations) is loaded from an external .json file selected by the user, which makes translation process simple and quick. For now, the app comes with English, Russian and German translations.

10. Exit

  • You won’t believe what it does.

How to install

  1. Unarchive the app to The Sims 4 folder.
  2. Run the script and go to the settings menu or open settings.json file and change the path to the Mods folder to your actual one. If you’ve modified the settings file directly and the script crashes, make sure you use \\ as a separator and not \ or / (e.g. C:\\Users\\user\\Documents\\Electronic Arts\\The Sims 4\\Mods). The script itself should accept it with \
  3. Restart or run the script. If you’ve done everything correctly, it should display the game version and won’t complain about the Resource.cfg missing (this file is not actually required, but it’s the easiest way to verify the path is correct).
  4. This app was reviewed by the Mod The Sims moderation team and has open-source code available on GitHibIf your antivirus blocks the download, unfortunately, there’re only two things I can offer: either compile the source code yourself or tell your antivirus to shut up and temporarily disable it/add necessary exclusions. Why this happens? Some modern antiviruses are overly cautionary towards new and potentially suspicious files and especially apps. Sometimes, they block all .exe files unless they have a special digital signature, which has to be issued by Microsoft and costs a few hundred dollars per year. If you’re a dedicated developer/company that profits from the software you’re developing, it’s a must have, but it’s obviously not an option for independent hobbyists developing freeware.

Future plans

  • MacOS release… sometime soon.
  • I’m NOT planning to add cache cleanup feature. I don’t think it would be ethical towards Andirz to do (as he has a script that does exactly that) – and while yes, it’s locked behind a paywall, it’s also the easiest “script” to write imaginable that anyone can google how to make and make it in less than five minutes, so I frankly consider it a “laziness tax” and I would frankly do the same in his place.
  • If you have any suggestions or found any bugs, please let me know; in that case, I might also ask you to archive your mods folder and send it to me for experiments.
imS2UtsO o

Download

โดเนท

[kofi]

Simscolony
Simscolonyhttp://simscolony.com
ซิมส์โคโลนี

Latest