New Tool WITPAECompare

Please post here for questions and discussion about scenario design, art and sound modding and the game editor for WITP Admiral's Edition.

Moderators: wdolson, MOD_War-in-the-Pacific-Admirals-Edition

Post Reply
morphin
Posts: 754
Joined: Fri Apr 26, 2002 6:51 pm
Location: Switzerland

New Tool WITPAECompare

Post by morphin »

Hi
Many years ago i made a Tool (VBS) for Comparing and updating Scenarios. I have rewritten it (now Powershell instead of Visual Basic Script) and add the Export/Import Functionality (Actually only a Wrapper to the famous WITPLOAD.EXE)
Hence this Tool requires witploadAE.exe in Version 9.0. It search for witploadAE in the script or WITPAE Installation Directory.
Best to use a new Directory in the Tools Directory (e.g. "Compare Directory) and copy this PowershellScript inside.

To Use:
Open an Powershell console and change to the Directory where the script is located
With .\WITPAECompare.ps1 -? you can get more Help:
WITPCompareTool.jpg
WITPCompareTool.jpg (127.5 KiB) Viewed 780 times

Examples:

Export Scenario 001 to CSV Files:
.\WITPAECompare.ps1 -Worktype Export -ExportScenNo 001

Import Scenario No 001 CSV Files into the Directory D:\WITPAE\tools\Compare:
.\WITPAECompare.ps1 -ScenBaseDir D:\WITPAE\tools\Compare -Worktype Import -ImportScenNo 001

Import Scenario No 001 CSV Files into the SCEN Subdirectory of the WITPAE Installation Folder:
.\WITPAECompare.ps1 -Worktype Import -ImportScenNo 001

Compares Scenario 001 with Scenario 002:
.\WITPAECompare.ps1 -Worktype Compare -CompareScenNo1 001 -CompareScenNo2 002

Updates Scenario 077 with the Differences from Scenario 001 to Scenario002_
This is used for example if the Scenario 077 is Based on Scenario 001 and this Base Scenario is Updated and you would like to Update your Scenario with the Changes that were made for Scenario 001. Then Best is to save the old Scenario 001 under a new scnario Number (071) and run WITIPCompare:
.\WITPAECompare.ps1 -Worktype Update -OrigScenNo 071 -PatchedScenNo 001 -ScenToUpdateNo 077

Cheers,
Andy Aka Morphin

-------------------------------
.SYNOPSIS
Export to CSV or Import to DAT-Files. Compare 2 scenarios or Update an modified scenario with differences from 2 scenarios

.DESCRIPTION
Compares all WITP Files for a given scenario with files from another scenario and logs the difference into a logfile.
Instead of comparing it can also updates scenarios file. For this it uses files from original scenario, the updated (patched) files for this original scenario
and the files for scenarios the differences should by applied (Mod). If there are any conflicts it is written to a conflictfile.

.PARAMETER Worktype
Specifies "Export" to export a specific Scenario to CSV Files
Specifies "Import" to import a specific Scenario to DAT Files
Specifies "Compare" to compare 2 scenarios and get a csv file with differences
Specifies "Update" to compare an Original and Patched Scenario and Updates an third Scenario (Mod) with the differences

.PARAMETER ScenBaseDir
Specifies the path to scenario Files. It searches for scenarios in this folder and subfolders. If empty, it searches in the folder where this script is and if nothing found it searches in the WITPAE Installation directory.
All the generated files are located in the script Directory except the DAT-Files that are generated with "Import" Parameter. These files are written to the WITPAE\Scen Directory (the Installation Directory of the WITPAE Game).
If you would like to change the Import Directory you can add the ScenBaseDir togehter with the Import Parameter

.PARAMETER ScenNo
Specifies the Scenario number as 3 numbers string format, e.g. 002 for Scenario Number 2. For Compare and Update it will autogenerate the CSV Files first before it compares/Updates the scenarios

.INPUTS
None. You cannot pipe objects to WITPAECompare.ps1

.OUTPUTS
Writes differences into a log, conflits into another log and creates optional updated scenario files

.EXAMPLE
PS> .\WITPAECompare.ps1 -worktype Export -ExportScenNo 002

----------------------------------------------------------------------
Attachments
Compare.zip
(6.18 KiB) Downloaded 22 times
morphin
Posts: 754
Joined: Fri Apr 26, 2002 6:51 pm
Location: Switzerland

Re: New Tool WITPAECompare

Post by morphin »

New Version with Bugfixes and More Info on Comparison Results or Update conflicts
Attachments
WITPAECompare.zip
(5.15 KiB) Downloaded 32 times
User avatar
BananaConvention
Posts: 721
Joined: Wed Jan 19, 2022 9:04 pm
Location: March ARB, CA

Re: New Tool WITPAECompare

Post by BananaConvention »

morphin wrote: Sat Jan 06, 2024 3:36 pm New Version with Bugfixes and More Info on Comparison Results or Update conflicts
I have archived this tool on my Discord's download section with a link to this thread, thanks!
Jochen Heiden

My WitP Tutorial Playlist:
https://youtube.com/playlist?list=PLFaQ ... Q9HG1hSiAG

Join my WitP Discord! Over 950 members and growing DAILY!
https://discord.gg/v4A9STzW7R
morphin
Posts: 754
Joined: Fri Apr 26, 2002 6:51 pm
Location: Switzerland

Re: New Tool WITPAECompare

Post by morphin »

Thank's

I have made a comparison between original 002 scenario from 1126a Version and your 026 Scenario (see Attachment)..

If your interested to see the differences.........
Attachments
WITPAECompareWITPair002_WITPair026.zip
(14.33 KiB) Downloaded 28 times
Post Reply

Return to “Scenario Design and Modding”