By: Sleipnir
In the early stages of Zero Hour, China had a 'System Hack' ability which allowed you to steal a random Science from an opponents Command Center and add it to your EXP menu. This tutorial is based off that idea, but, IMO, fits in with the final ZH gameplay more than the original idea would have.
This tutorial explains how to allow the Chinese infantry general to upgrade his Internet Center to a 3rd Satellite hack level, where the hackers can hack into superweapon targeting systems and fire them at an area.
The superweapon itself is chosen randomly, for the sake of the tutorial it will either be a Scud Strike (like a scud storm, but with only 5 missles), Level 2 A10 strike, or carpet bombing. More options can be easily added.
This tutorial also removes the EMP mines from the internet center - the way the upgrade for them is coded wouldn't allow for a 3rd satellite hack level. (this makes sense anyway, why would you want EMP going off around all that sensitive equipment?), it also improves the Napalm Bomb radial cursor for the Helix.
I've written this tutorial in three parts, the first explains how to set up the Internet Center to recieve the superweapon, the 2nd is how to set up the superweapon itself, and the third is how to add/customise your own attacks. If you just want to see how the random superweapon works, skip straight to Part 2.
Part 1: Setting up the Internet Center
Files to edit:
Commandbutton.ini
Commandset.ini
Object\InfantryGeneral.ini
Upgrade.ini
Now, first off, lets set up the extra upgrades on the Internet center:
Open InfantryGeneral.ini and scroll down to Infa_ChinaInternetCenter
Find:
Behavior = ArmorUpgrade ModuleTag_30
TriggeredBy = Upgrade_ChinaEMPMines
End
Behavior = CommandSetUpgrade ModuleTag_31
CommandSet = Infa_ChinaInternetCenterCommandSetOneUpgrade
TriggeredBy = Upgrade_ChinaMines
CommandSetAlt = Infa_ChinaInternetCenterCommandSetTwoUpgrade
TriggerAlt = Upgrade_ChinaSatelliteHackOne
End
Behavior = CommandSetUpgrade ModuleTag_32
CommandSet = Infa_ChinaInternetCenterCommandSetTwo
TriggeredBy = Upgrade_ChinaSatelliteHackOne
CommandSetAlt = Infa_ChinaInternetCenterCommandSetTwoUpgrade
TriggerAlt = Upgrade_ChinaMines
End
and replace it with:
Behavior = CommandSetUpgrade ModuleTag_30
CommandSet = Infa_ChinaInternetCenterCommandSetTwo
TriggeredBy = Upgrade_ChinaSatelliteHackOne
End
Behavior = CommandSetUpgrade ModuleTag_31
CommandSet = Infa_ChinaInternetCenterCommandSetThree
TriggeredBy = Upgrade_ChinaSatelliteHackTwo
End
Behavior = CommandSetUpgrade ModuleTag_32
CommandSet = Infa_ChinaInternetCenterCommandSetFour
TriggeredBy = Upgrade_ChinaSatelliteHackThree
End
This adds the extra Commandset upgrades we need (one lets you purchase the upgrade, the other lets you use it) and gets rid of most of the EMP mines upgrade code.
Find:
Behavior = GenerateMinefieldBehavior ModuleTag_23
TriggeredBy = Upgrade_ChinaMines
MineName = ChinaStandardMine
SmartBorder = Yes
AlwaysCircular = Yes
Upgradable = Yes
UpgradedTriggeredBy = Upgrade_ChinaEMPMines
UpgradedMineName = ChinaEMPMine
End
Replace with:
Upgrade Upgrade_ChinaSatelliteHackThree
DisplayName = UPGRADE:SatelliteHackThree
BuildTime = 20.0 ;Edit to however long you want the research to take
BuildCost = 4000 ;Edit to whatever you want the upgrade to cost
ButtonImage = SSSpySat
UnitSpecificSound = CIAIntelligenceActivate
End
It's just a regular upgrade, nothing fancy. You'll need to add UPGRADE:SatelliteHackThree to your CSF or STR file, but this comes later. At the moment, it uses the same button as the US spy satellite.
Open Commandbutton.ini
Find:
CommandButton Command_UpgradeChinaSatelliteHackTwo
Command = PLAYER_UPGRADE
Upgrade = Upgrade_ChinaSatelliteHackTwo
TextLabel = CONTROLBAR:UpgradeChinaSatelliteHackTwo
ButtonImage = SNIntCntup02
ButtonBorderType = UPGRADE ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:TooltipChinaUpgradeSatelliteHackTwo
End
After, add:
CommandButton Command_UpgradeChinaSatelliteHackThree
Command = PLAYER_UPGRADE
Upgrade = Upgrade_ChinaSatelliteHackThree
TextLabel = CONTROLBAR:UpgradeChinaSatelliteHackThree
ButtonImage = SSSpySat
ButtonBorderType = UPGRADE ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:TooltipChinaUpgradeSatelliteHackThree
End
Once again, just a regular button. There's a list of all the strings you need to add at the end, you don't need to worry about them here.
Finally, open Commandset.ini
Find:
CommandSet Infa_ChinaInternetCenterCommandSetOne
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
10 = Command_UpgradeChinaSatelliteHackOne
12 = Command_UpgradeChinaMines
14 = Command_Sell
End
CommandSet Infa_ChinaInternetCenterCommandSetOneUpgrade
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
10 = Command_UpgradeChinaSatelliteHackOne
12 = Command_UpgradeEMPMines
14 = Command_Sell
End
CommandSet Infa_ChinaInternetCenterCommandSetTwo
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
10 = Command_UpgradeChinaSatelliteHackTwo
12 = Command_UpgradeChinaMines
14 = Command_Sell
End
CommandSet Infa_ChinaInternetCenterCommandSetTwoUpgrade
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
10 = Command_UpgradeChinaSatelliteHackTwo
12 = Command_UpgradeEMPMines
14 = Command_Sell
End
and replace it with:
CommandSet Infa_ChinaInternetCenterCommandSetOne
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
10 = Command_UpgradeChinaSatelliteHackOne
12 = Command_UpgradeChinaMines
14 = Command_Sell
End
CommandSet Infa_ChinaInternetCenterCommandSetTwo
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
10 = Command_UpgradeChinaSatelliteHackTwo
12 = Command_UpgradeChinaMines
14 = Command_Sell
End
CommandSet Infa_ChinaInternetCenterCommandSetThree
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
10 = Command_UpgradeChinaSatelliteHackThree
12 = Command_UpgradeChinaMines
14 = Command_Sell
End
CommandSet Infa_ChinaInternetCenterCommandSetFour
1 = Command_StructureExit
2 = Command_StructureExit
3 = Command_StructureExit
4 = Command_StructureExit
5 = Command_StructureExit
6 = Command_StructureExit
7 = Command_StructureExit
8 = Command_StructureExit
9 = Command_Evacuate
12 = Command_UpgradeChinaMines
14 = Command_Sell
End
This cuts out the (now unused) commandsets to upgrade the internet center with emp mines and adds the commandsets to purchase and use the new satellite hack.