[Utility] Witcher 3 ModCopy v1.32 - Wcc_lite.exe and w3strings.exe front-end script.

+
modcopy.png
Script Features:
- Imports, cooks and packs mod assets and encodes w3strings at the press of a single button.
- Unpacks, uncooks and exports all game assets and decodes w3strings using a step-by-step process.
- Seamless integrated environment between text editors, wcc_lite, w3strings, ScriptStudio and Witcher 3.
- Automatically launches scriptstudio.exe / witcher3.exe and 'reloads' scripts after transfer complete.
- Improves ScriptStudio by not requiring mods to be 'installed', breakpoints still work after 'reload'.
- Fixes a ScriptStudio (redscm.dll) crash error and wcc_lite.exe ACL folder permissions issue.
- Generates incremental, date-time-stamped backups and release.zip archives using WinRAR.

Script Warning:
- Scripts have the potential to break in mysterious ways when used incorrectly, due to parsing issues.
- Double-check all path variables and strings, removing any invalid characters and "quotation" marks.
- Files and folders removed by the script are prefixed with '.\name' (current folder) as an extra precaution.
- Do not modify the script without a full understanding of syntax and how strings/commands are parsed.
- Do not run scripts from untrusted sources, including myself, unless you know exactly what you are doing.

prompt.png
Requirements:
- 50-100 GB free space to uncook game assets, if necessary.
- The Witcher 3: Wild Hunt, Hearts of Stone / Blood and Wine.
- ModKit: https://www.nexusmods.com/witcher3/mods/3173
- w3strings: https://www.nexusmods.com/witcher3/mods/1055
- WinRAR: https://www.win-rar.com (optional, backup/release purposes)

Installation:
- Download and install ModKit (Witcher 3 Modding Tools) and WinRAR (optional).
- Download and rename modcopy.txt to modcopy.cmd (not .bat); attached.
- Create a folder named 'modcopy' and place the modcopy.cmd file there.
- Manually backup your mod or 'The Witcher 3\mods\modname' folder.

Configuration:
- Edit the modcopy.cmd file and update the 'modname' and 'idspace' variables.
- Update the 'witcher3, modkit, winrar' variables and autostart parameters.
Code:
@SET     modname=mod test
@SET     idspace=1234
@SET      images=png
:: ---- modname/idspace (4 digits): must be unique (w3strings)
:: ---- images (format): bmp, dds, jpg, png and tga (wcc_lite)
@SET    witcher3=%programfiles(x86)%\Steam\steamapps\common\The Witcher 3
@SET      modkit=%programfiles(x86)%\Witcher 3 Mod Tools
@SET      winrar=%programfiles%\WinRAR
@SET      params=-displayfps -net -debugscripts -forcescriptcompilation
- Save the file, run the script once to create folder structure, then exit.
- Copy w3strings.exe only (without documentation) to the 'modcopy\~w3strings' folder.
- Optionally, create additional application shortcuts in the 'modcopy' folder.

Getting Started:
- Place your mod files in the appropriate 'modcopy\mods\modname' folders.
- Maintain the same folder structure as in the original files, due to local depot.
- Start modcopy.cmd and select one of the following options:
Code:
-  [S]CRIPTS : transfer config+scripts+w3strings to witcher 3\mods (autostart)
-  PA[C]K    : import/cook/pack mod asset files and metadata to witcher 3\mods
-  [R]ELEASE : compress files for backup/release (reset +a attrib, recreate mod)
-  [T]OOLS   : export config+scripts+decode w3strings+uncook assets (UAC prompt)
- E[X]IT     : exit modcopy.
- [R]ELEASE will delete 'The Witcher 3\mods\modname' folder, then recreate it anew.
- You _must_ delete 'The Witcher 3\mods\modname' or [R]ELEASE at least once to reset +a attributes.
- You _must_ run [T]OOLS at least once to fix a ScriptStudio crash bug (step #4) or rename redscm.dll.

Archive Attribute:
- Modcopy will clear and reset +a (archive) attributes to copy only those files which have been altered.
- To reset all archive attributes, select [R]ELEASE or delete 'The Witcher 3\mods\modname' folder.
- If you recently copied a file to the mods folder, without making changes, the attribute may not be set.
- Backup applications will reset all archive attributes, and incremental backups will omit those files.

Known/Unknown Issues:
- When using 'reload scripts' in ScriptStudio, it is advisable not to save any games, although I haven't experienced issues.
- Avoid using path and file names with !exclamation! marks, as this will break 'delayedexpansion' variables in .cmd scripts.
- To pause the script, press Ctrl+C or Ctrl+Break. However, this will cancel the current wcc_lite or w3strings operation.
- When reloading scripts in ScriptStudio, select Compile Mod > Action > Use Existing Scripts > Always take this action > OK.

- Updated June 12, 2020 at 00:01 EST to prevent PA[C]K, [R]ELEASE and [T]OOLS execution while witcher3.exe is running.
- Updated June 12, 2020 at 17:38 EST fixed running process checks, adds an extra check for ScriptStudio window activation.
- Updated June 12, 2020 at 21:20 EST forces script re-compilation to enable breakpoints, may be disabled under %params%.
- Updated June 13, 2020 at 04:35 EST full ScriptStudio integration, including function list/completion and local/source files.
- Updated June 13, 2020 at 21:45 EST added SendKeys information message, vbs script file name, 1000 line scroll-back buffer.

- Need some model/texture modders to test this, since I only edit Witcher 3 scripts, strings and definition files: see next post.
 

Attachments

  • modcopy.txt
    20.4 KB · Views: 274
Last edited:
I still have several unresolved questions, which I'll ask here, but I'll still release it as is:

I suppose I could test all of these things, but that takes time, and I don't need to import/cook assets.

1. do files other than .bmp .dds .jpg .png .tga (.xbm) .fbx .re (.w2mesh) need to be cooked?
a. or can they simply be copied to the cooked folder, before packing, without cooking?
b. they don't need to be imported, that much is clear, less clear is if they are required for cooking.
c. will wcc_lite skip over them even if they are present while cooking?

if it doesn't work, then change the following line to the one after it instead (~import folder):
Code:
cd "%moddir%" && xcopy ".\%modassets%" ".\%modcooked%" /s /i /y /m && echo. 
cd "%moddir%" && xcopy ".\%modassets%" ".\%modimport%" /s /i /y /m && echo.

2. what should 'depot' point to?
a. the modkit\r4data folder (same as local)?
b. the uncooked game files folder?
c. your mod's pre-cooked files folder?

if it doesn't work, then change the following line to the one after it instead (~uncooked folder):
Code:
wcc_lite.exe import -depot="local" -file="%%~fF" -out="!destination!"
wcc_lite.exe import -depot="%basedir%\~%modassets%" -file="%%~fF" -out="!destination!"
obviously, you will have to export assets first using [T]OOLS, or copy them to ~uncooked, or it will fail to find depot.

3. what exactly is the depot, some catalogue of assets and cached metadata?
a. can assets be imported correctly using local depot, or do game files need to be unpacked?
b. what is the purpose in using the depot when importing files?

edit: modkit\r4data seems like it contains resources for scriptstudio and some other editors we don't have; quest/scene/dialog?

r4data\gameplay\globals: that explains it. so the radish 'quest editor' mod tried to leverage these to roll-their-own quest editor?

there are various references to texture, template, mesh and material editors in those files as well.
 
Last edited:
hej @PrincessMassacre you seem to be very proficient with the modding tools :D would you want to help in the development of WolvenKit? We have most of the steps above automatized in WolvenKit lately.

to answer your questions:
1. do files other than .bmp .dds .jpg .png .tga (.xbm) .fbx .re (.w2mesh) need to be cooked?
I don't think so. w2cube is a variation of textures, as is texarrays. I know that the first gets cooked, not sure about texarrays to be honest. redswf and redapex I think get cooked?

the workflow for Wolvenkit is something like this:

1. [Raw assets: tga, fbx, apb...] --> wcc_lite import --> [Uncooked folder: xbm, w2mesh, redapex]
2a. [Uncooked assets, w2mesh, xbm, redapex] --> wcc_lite cook --> [Bundle folder: w2mesh, xbm, redapex retain their extension but some source data is removed in the cooked file]
2b. [Uncooked assets, xbm, redapex] --> wcc_lite buildcache --> [Output: texture.cache, collision.cache get built directly from the imported/uncooked assets]
3. [Bundle folder: w2mesh, xbm, redapex + all the other files] --> wcc_lite pack --> [Output: blob.bundle packed from the cooked folder]
 
Top Bottom