Repository navigation
Custom Soldier Names via soldier_names.txt - #137
Conversation
If a soldier_names.txt file is present in the current version's game resources folder, its names replace the original 360 recruit names (JOOLS, JOPS, STOO, ...). One name per line, A-Z only, up to 6 letters; blank lines and '#' comments are ignored, names are upper-cased, and a short list cycles through all recruits. Without the file the original names are used unchanged. Names are looked up through a new Recruit_Get() accessor used by every name display (squad list, hero list, sidebar, service screen). Loading is lazy on first lookup and repeats on version switch, so each version can have its own list. The file is read via the resource manager (FileReadStr), not fileGet(), as the CD resource's fileGet() exits the process for a missing file.
First and last names split across entries (JEAN / LUC / PICARD, LUKE / SKY / WALKER), each cut to the 6 characters the name displays show.
…ents in Recruits.cpp.
|
No real issues here, the only thing that i am wondering, would this be better to just live in Data/ rather than a specific version |
|
I was thinking to have different names per game (CF1 vs CF2 etc.) with this approach, which also aligns with my approach for loading custom sprite tile sets. If we were to support both per game and global mods, where in the file structure would the global data files live? Is there a function already in place to discover / query that folder? |
|
yeah im not sure actually, its probably a rare problem, but also given there is an open request about it, feel like it will be complained about if not done in a way that works across the board 😄 |
Keep the per-version list as the primary lookup; when a version has no soldier_names.txt of its own, fall back to a single list in Data/soldier_names.txt shared by all versions. A per-version file always wins, even if it is empty. New ResourceMan::GetGlobalDataFilePath() resolves the shared file against the install roots, reusing the existing Data/ path generation and case-insensitive resolution.
… folder function.
|
@segrax the latest update now allows the soldier_names in the Data/ folder. Can you test it on Linux? I'm always nervous about the file handling on different file systems. |
|
Thanks! |
Ref feature request #65 - All 360 original soldier names can be overridden by placing a
soldier_names.txtin each game resources folder or globally in the /Data/ folder. Seesoldier_names.txt.example. One name per line, letters A-Z only, up to six letters long. Currently if fewer than 360 names are provided, the list will recycle at the top.