Skip to content

Commit

Permalink
Add xml schema validation. Some minor script fixes
Browse files Browse the repository at this point in the history
SC2 itself ignores that declaration, Editor removes it
Use the script to re-attach them
  • Loading branch information
Ziktofel committed Jun 18, 2024
1 parent bf235fb commit 7d68f08
Show file tree
Hide file tree
Showing 29 changed files with 37 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement id="AP_HaveImpaler">
<EditorCategories value="Race:Zerg,TechType:Unit"/>
<NodeArray index="Show" Link="AP_CountUpgradeHotSImpalerCompleteOnlyTechTreeCheat"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_HotSRapidMetamorph">
<!-- Override -->
<EffectArray index="1" removed="1"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement id="AP_HaveRaptorSwarmling">
<EditorCategories value="Race:Zerg,TechType:Unit"/>
<NodeArray index="Show" Link="AP_CountUpgradeHotSHaveRaptorSwarmlingCompleteOnly"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementAnd id="And3031542424CountUpgradeHotSHaveSwarmlingCompleteOnlyCountUpgradeHotSHaveRaptorCompleteOnly">
<OperandArray value="CountUpgradeHotSHaveSwarmlingCompleteOnly"/>
<OperandArray value="CountUpgradeHotSHaveRaptorCompleteOnly"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_BaseZergGroundArmors">
<!-- Override -->
<EffectArray Reference="Unit,LarvalQueen,LifeArmorLevel" Value="1"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement id="HatcherySpawnLarvaFrenzy">
<EditorCategories value="Race:Zerg,TechType:Unit"/>
<NodeArray index="Show" Link="LTCountUnitLarvaCompleteOnlyAtUnit20"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementConst id="20"/>
<CRequirementLT id="LTCountUnitLarvaCompleteOnlyAtUnit20">
<OperandArray index="0" value="CountUnitLarvaCompleteOnlyAtUnit"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="SwarmFrenzy">
<EffectArray Operation="Divide" Reference="Abil,MindBolt,Cost[0].Cooldown[0].TimeUse[0]" Value="2.000000"/>
<EffectArray Operation="Divide" Reference="Abil,PsionicLift,Cost[0].Cooldown[0].TimeUse[0]" Value="2.000000"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?><CEffectApplyBehavior id="PoisonGasCloudAB">
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement id="HaveHotSScavengerRoach">
<NodeArray index="Use" Link="CountUpgradeHotSScavengerRoachInstallationCompleteOnly3515923415"/>
<NodeArray index="Show" Link="CountUpgradeHotSScavengerRoachCompleteOnlyTechTreeCheat"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementCountUpgrade id="CountUpgradeHotSScavengerRoachInstallationCompleteOnly3515923415">
<Flags index="TechTreeCheat" value="0"/>
</CRequirementCountUpgrade>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement id="AP_AllowHyperionBuild">
<NodeArray index="Show" Link="AP_CountUpgradeHyperionAllowBuildCompleteOnly"/>
</CRequirement>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementCountUpgrade id="AP_CountUpgradeHyperionAllowBuildCompleteOnly">
<Flags index="TechTreeCheat" value="0"/>
<Count Link="AP_HyperionAllowBuild" State="CompleteOnly"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_FastBuildBattlecruiser">
<!-- Override -->
<EffectArray Operation="Subtract" Reference="Abil,AP_HyperionTrain,InfoArray[Train1].Time" Value="15.000000"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementCountUpgrade id="CountUpgradeHardenedShield2QueuedOrBetter3126218829">
<Count Link="ZenithArmor"/>
</CRequirementCountUpgrade>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_BaseZergGroundArmors">
<!-- Override -->
<EffectArray Reference="Unit,ZaGara,LifeArmorLevel" Value="1"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement id="LearnProtossAirArmor1">
<NodeArray index="Show" Link="EqCountUpgradeProtossAirArmorsLevel1QueuedOrBetter0"/>
</CRequirement>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementCountUpgrade id="CountUpgradeTerranInfantryWeaponsUltraCapacitorsLevel1QueuedOnly">
<Flags index="TechTreeCheat" value="0"/>
<Tooltip value="RequirementNode/Tooltip/##id##"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement id="LearnProtossAirArmor1">
<NodeArray index="Show" Link="AndEqCountUpgradeProtossAirArmorsLevel1QueuedOrBetter0AllowUnitStargate"/>
</CRequirement>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementAllowUnit id="AllowUnitStargate">
<Tooltip value="RequirementNode/Tooltip/##id##"/>
<Link value="Stargate"/>
Expand Down
4 changes: 2 additions & 2 deletions Maps/ArchipelagoCampaign/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ process_map() {
mpqfile="$campaign"_build/$(sed "s/^$campaign\///g" <<< "$map")
smpq -c $mpqfile
pushd $map
for file in $(find . -type f) ; do
while read -r -d "" file ; do
file=$(cut -c 3- <<< "$file")
smpq -a ../../$mpqfile $file
done
done < <(find . -type f -print0)
popd
}
export -f process_map
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_Core_SupplyPerStack">
<EffectArray Reference="Unit,AP_Core_SupplyHolder,Food" Value="1"/>
<AffectedUnitArray value="AP_Core_SupplyHolder"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">
<CRequirement default="1" id="AP_SCBW_AbilReq">
<?token id="Race" value="Terran"?>
<EditorCategories value="Race:##Race##,TechType:Ability"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">
<CRequirementCountUpgrade id="AP_CountUpgradeHotSHaveRaptorCompleteOnly">
<Flags index="TechTreeCheat" value="0"/>
<Count Link="AP_HotSHaveRaptor" State="CompleteOnly"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade default="1" id="AP_BaseTerranInfantryArmors">
<Name value="Upgrade/Name/AP_BaseTerranInfantryArmors"/>
<!-- Set the values here -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_BaseZergGroundArmors">
<!-- Override -->
<EffectArray Reference="Unit,Brutalisk,LifeArmorLevel" Value="1"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_SOAUIFreezePrevent">
<EffectArray Reference="Behavior,IceWaveFrozen,Modification.TimeScale" Value="0.1"/>
<EffectArray Reference="Behavior,PurifierStasisLongTerm,Modification.TimeScale" Value="0.1"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_BaseProtossGroundWeapons">
<!-- Override -->
<EffectArray Reference="Weapon,PrologueZeratul,Level" Value="1"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">
<CUpgrade id="AP_RegenerativeBioSteel">
<!-- Override -->
<EffectArray Operation="Set" Reference="Unit,Odin,LifeRegenDelay" Value="3.000000"/>
Expand Down
8 changes: 8 additions & 0 deletions scripts/setup_xml_schema_validation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

script_dir=$PWD
cd "$script_dir/.."
find . -name "UpgradeData.xml" -exec sed -Ei 's#^<Catalog>#<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaUpgradeData.xsd">#g' {} \;
find . -name "RequirementData.xml" -exec sed -Ei 's#^<Catalog>#<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/SchemaRequirementData.xsd">#g' {} \;
find . -name "RequirementNodeData.xml" -exec sed -Ei 's#^<Catalog>#<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../schemas/RequirementNodeData.xsd">#g' {} \;

0 comments on commit 7d68f08

Please sign in to comment.