New Tool WITPAECompare
Posted: Thu Jan 04, 2024 6:47 pm
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:
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
----------------------------------------------------------------------
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:
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
----------------------------------------------------------------------