Menu:

GenDev
 
   News
   Forums
   Downloads
   Link Us
   The Team

Cameo Mapper
 
   About
   How to Use
   Download

Tutorials
 
   Modding
   Graphics
   Mapping

Modding Resources
 
   GenDev Utilities
   User Submitted Models
   Alpha/Beta Models
   Tutorial Downloads
   Modding Utilities

Affiliates
 
   CNC DEN
   SDI

Part 2: The weapon itself.
Files to edit:
Commandbutton.ini
Commandset.ini
InGameUI.ini
ObjectCreationList.ini
Object\InfantryGeneral.ini
Object\WeaponObjects.ini
SoundEffects.ini
SpecialPower.ini

Open Commandbutton.ini and find:
CommandButton Command_ChinaHelixDropNapalmBomb 
  Command                 = SPECIAL_POWER 
  SpecialPower            = SpecialAbilityHelixNapalmBomb 
  Options                 = NEED_SPECIAL_POWER_SCIENCE OK_FOR_MULTI_SELECT NEED_TARGET_POS CONTEXTMODE_COMMAND 
  TextLabel               = CONTROLBAR:DropNapalmBomb 
  ButtonImage             = SNHelixUp04 
  ButtonBorderType        = ACTION ; Identifier for the User as to what kind of button this is 
  DescriptLabel           = CONTROLBAR:ToolTipDropNapalmBomb 
  RadiusCursorType        = HELIX_NAPALM_BOMB 
  InvalidCursorName       = GenericInvalid 
  UnitSpecificSound       = NoSound 
End

Replace with:
CommandButton Command_ChinaHelixDropNapalmBomb 
  Command                 = SPECIAL_POWER 
  SpecialPower            = SpecialAbilityHelixNapalmBomb 
  Options                 = NEED_SPECIAL_POWER_SCIENCE OK_FOR_MULTI_SELECT NEED_TARGET_POS CONTEXTMODE_COMMAND 
  TextLabel               = CONTROLBAR:DropNapalmBomb 
  ButtonImage             = SNHelixUp04 
  ButtonBorderType        = ACTION ; Identifier for the User as to what kind of button this is 
  DescriptLabel           = CONTROLBAR:ToolTipDropNapalmBomb 
  RadiusCursorType        = NAPALMSTRIKE 
  InvalidCursorName       = GenericInvalid 
  UnitSpecificSound       = NoSound 
End
This makes the Helix's napalm bomb use the NapalmStrikeRadiusCursor (from the unused Napalm Strike superweapon) instead of the HelixNapalmBombRadiusCursor. It looks a lot better and lets us use NapalmStrikeRadiusCursor for the satellite hack (you can modify existing radial cursors, but can't add new ones).

At the bottom of the file add:
CommandButton Command_SatHack3 
  Command           = SPECIAL_POWER 
  SpecialPower      = SuperweaponSatHack3Targeter 
  Options           = NEED_SPECIAL_POWER_SCIENCE NEED_TARGET_POS CONTEXTMODE_COMMAND NEED_UPGRADE 
  Upgrade           = Upgrade_ChinaSatelliteHackThree 
  TextLabel         = CONTROLBAR:SatHack3 
  ButtonImage       = SSSpySat 
  ButtonBorderType  = ACTION ; Identifier for the User as to what kind of button this is 
  DescriptLabel     = CONTROLBAR:TooltipSatHack3 
  RadiusCursorType  = HELIX_NAPALM_BOMB 
  InvalidCursorName = GenericInvalid 
End 

CommandButton Command_SatHack3FromShortcut 
  Command           = SPECIAL_POWER_FROM_SHORTCUT 
  SpecialPower      = SuperweaponSatHack3Targeter 
  Options           = NEED_SPECIAL_POWER_SCIENCE NEED_TARGET_POS CONTEXTMODE_COMMAND NEED_UPGRADE 
  Upgrade           = Upgrade_ChinaSatelliteHackThree 
  TextLabel         = CONTROLBAR:SatHack3 
  ButtonImage       = SSSpySat 
  ButtonBorderType  = ACTION ; Identifier for the User as to what kind of button this is 
  DescriptLabel     = CONTROLBAR:TooltipSatHack3 
  RadiusCursorType  = HELIX_NAPALM_BOMB 
  InvalidCursorName = GenericInvalid 
End

These are buttons to launch the superweapons from. It uses the now freed up HELIX_NAPALM_BOMB Radius Cursor - which we are about to customise.

Open up InGameUI.ini and find:
  HelixNapalmBombRadiusCursor 
    Texture        = SCCNapalm 
    Style          = SHADOW_ALPHA_DECAL 
    OpacityMin        = 55% 
    OpacityMax        = 75% 
    OpacityThrobTime  = 500 
    Color             = R:255 G:100 B:0 A:255 
    OnlyVisibleToOwningPlayer = Yes 
  End 

Replace it with
  HelixNapalmBombRadiusCursor 
    Texture        = SCCSysHack 
    Style          = SHADOW_ALPHA_DECAL 
    OpacityMin     = 50% 
    OpacityMax     = 100% 
    OpacityThrobTime  = 1000 
    Color          = R:255 G:0 B:0 A:255 
    OnlyVisibleToOwningPlayer = Yes 
  End

SCCSysHack was originally meant for the original system hack superweapon, it fits our new one very well.

Now, go back to Commandset.ini, to the code you added at the end of Part 1. Find:

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

and replace it with:
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 
  10 = Command_SatHack3 
  12 = Command_UpgradeChinaMines 
  14 = Command_Sell  
End

Then find:
CommandSet Infa_SpecialPowerShortcutChina 
  1 = Command_ClusterMinesFromShortcut 
  2 = Command_ArtilleryBarrageFromShortcut 
  3 = Infa_Command_ParadropFromShortcut 
  4 = Command_EmergencyRepairFromShortcut 
  5 = Command_EMPPulseFromShortcut 
  6 = Command_NeutronMissileFromShortcut 
  7 = Early_Command_ChinaCarpetBombFromShortcut 
  8 = Early_Command_FrenzyFromShortcut 
END 

and replace with:
CommandSet Infa_SpecialPowerShortcutChina 
  1 = Command_ClusterMinesFromShortcut 
  2 = Command_ArtilleryBarrageFromShortcut 
  3 = Infa_Command_ParadropFromShortcut 
  4 = Command_EmergencyRepairFromShortcut 
  5 = Command_EMPPulseFromShortcut 
  6 = Command_NeutronMissileFromShortcut 
  7 = Early_Command_ChinaCarpetBombFromShortcut 
  8 = Early_Command_FrenzyFromShortcut 
  9 = Command_SatHack3FromShortcut 
END

This adds the ability to the commandsets, you can fire it from either the internet center or from the special power shortcut bar.

Open SpecialPower.ini and add the following to the bottom of the file:
;----------------------------------------------------------------------------- 
SpecialPower SuperweaponSatHack3Targeter 
  Enum                          = SPECIAL_AMBUSH 
  ReloadTime                    = 350000 ; milliseconds, customise to whatever you want 
  PublicTimer                   = No 
  InitiateSound       = SatHack3Initiated 
  ViewObjectDuration  = 30000 
  ViewObjectRange     = 250 
  RadiusCursorRadius            = 100 
  ShortcutPower                 = Yes 
  AcademyClassify     = ACT_SUPERPOWER 
End

This will make sense in a second.

Now, jump back to InfantryGeneral.ini and add the following module to the internet center, just below the commandset modules we earlier edited:
  Behavior = OCLSpecialPower ModuleTag_33 
    SpecialPowerTemplate = SuperweaponSatHack3Targeter 
    OCL                  = SUPERWEAPON_ChinaSatHack3_Targeter 
    CreateLocation       = CREATE_AT_LOCATION 
  End

and at the bottom of ObjectCreationList.ini add:
;------------------------------------------------------------------------------ 
; OCL's for the Infantry General's "Satellite Hack III" 
;------------------------------------------------------------------------------ 
ObjectCreationList SUPERWEAPON_ChinaSatHack3_Targeter 
  CreateObject 
    ObjectNames = ChinaSatHack3_Targeter 
    Count = 1 
  End 
End

Now, you might be thinking to yourself "hey, this is just a clone of the rebel ambush, whats this got to do with superweapon hacking?". Add the following code to WeaponObjects.ini and you'll find out:
;------------------------------------------------------------------------------ 
; Dummy objects for the Infantry General's "Satellite Hack III" 
;------------------------------------------------------------------------------ 
Object ChinaSatHack3_Targeter 
  Side = China 
  EditorSorting = SYSTEM 
  BuildVariations = ChinaSatHack3_ScudStrike ChinaSatHack3_A10 ChinaSatHack3_CarpetBomb 
  KindOf = PRELOAD CLICK_THROUGH IGNORED_IN_GUI 
End 
Object ChinaSatHack3_ScudStrike 
  Side = China 
  EditorSorting = SYSTEM 
  KindOf = PRELOAD CLICK_THROUGH IGNORED_IN_GUI 
  Behavior = LifetimeUpdate ModuleTag_01 
    MinLifetime = 3 
    MaxLifetime = 3 
  End 
  Behavior       = OCLUpdate ModuleTag_02 
    OCL          = SUPERWEAPON_ChinaSatHack3_ScudStrike 
    MinDelay     = 2 
    MaxDelay     = 2 
    CreateAtEdge = Yes ; as opposed to just creating on self 
  End 
End 

Object ChinaSatHack3_A10 
  Side = China 
  EditorSorting = SYSTEM 
  KindOf = PRELOAD CLICK_THROUGH IGNORED_IN_GUI 
  Behavior = LifetimeUpdate ModuleTag_01 
    MinLifetime = 3 
    MaxLifetime = 3 
  End 
  Behavior       = OCLUpdate ModuleTag_02 
    OCL          = SUPERWEAPON_ChinaSatHack3_ThunderboltStrike 
    MinDelay     = 2 
    MaxDelay     = 2 
    CreateAtEdge = Yes ; as opposed to just creating on self 
  End 
End 

Object ChinaSatHack3_CarpetBomb 
  Side = China 
  EditorSorting = SYSTEM 
  KindOf = PRELOAD CLICK_THROUGH IGNORED_IN_GUI 
  Behavior = LifetimeUpdate ModuleTag_01 
    MinLifetime = 3 
    MaxLifetime = 3 
  End 
  Behavior       = OCLUpdate ModuleTag_02 
    OCL          = SUPERWEAPON_ChinaSatHack3_CarpetBomb 
    MinDelay     = 2 
    MaxDelay     = 2 
    CreateAtEdge = Yes 
  End 
End

Understand now?
If not, this is how it works:
The superweapon spawns a dummy 'targeter' unit which has the buildvariations tag. It works like the Technical, but instead of spawning a unit with a random chassis, it spawns a random unit which has an OCL that calls in the real attack, and then dies.
Adding another superweapon to the mix is as simple as adding another buildvariant and OCL.

Now, lets finish this up and try it out ingame.
Open SoundEffects.ini and at the bottom add:
AudioEvent SatHack3Initiated 
  Sounds =  iblasetb ;use your own sound here 
  Volume = 90 
  PitchShift = -10 10 
  Limit = 2 
  Priority    = normal 
  Type = world shrouded everyone 
End

This makes it play black lotus' hacking initiation sound when you use the superweapon.

Back in ObjectCreationList.ini, add this at the end:
;------------------------------------------------------------------------------ 
ObjectCreationList SUPERWEAPON_ChinaSatHack3_ScudStrike 
  DeliverPayload 
    Transport                       = ChinaArtilleryCannon 
    FormationSize                   = 5 
    FormationSpacing                = 1.0 
    StartAtPreferredHeight          = Yes 
    StartAtMaxSpeed                 = Yes 
    MaxAttempts                     = 1                   ;max attempts 
    DeliveryDistance                = 400                 ;distance from target allowed to start/stop dropping. 
    WeaponErrorRadius               = 100                 ; how bad the artillerist is 
    DelayDeliveryMax                = 3000                ; his delayed reaction to "Fire!" 
    VisibleItemsDroppedPerInterval  = 1                   ;Drops two bombs at a time 
    VisibleDropBoneBaseName         = RootTransform       ;The bombs are created and dropped at this bone base 
    VisibleSubObjectBaseName        = Bomb                ;The bombs are visible until dropped. 
    VisibleNumBones                 = 1                   ;Number of bones. 
    VisiblePayloadTemplateName      = ScudStormMissile  ;Created when payload is dropped. 
    VisiblePayloadWeaponTemplate    = ScudStormDamageWeapon 
    InheritTransportVelocity        = Yes                 ;The bombs will start at transport velocity. 
    ExitPitchRate                   = 30                  ;The bomb will pitch down. 
    SelfDestructObject              = Yes                 ; so the delivery vehicle goes away 'POP!' 
    
    DeliveryDecalRadius = 100 
    DeliveryDecal 
      Texture           = sccsyshack 
      Style             = SHADOW_ALPHA_DECAL 
      OpacityMin        = 25% 
      OpacityMax        = 50% 
      OpacityThrobTime  = 500 
      Color             = R:255 G:0 B:0 A:255 
      OnlyVisibleToOwningPlayer = Yes 
    End 
    
  End 
End 




;------------------------------------------------------------------------------ 
ObjectCreationList SUPERWEAPON_ChinaSatHack3_CarpetBomb 
  DeliverPayload 
    Transport = ChinaJetCarpetBomber 
    StartAtPreferredHeight = Yes 
    StartAtMaxSpeed = Yes 
    MaxAttempts = 1 
    DropOffset = X:0 Y:0 Z:-2 
    DropVariance = X:30 Y:40 Z:0 
    DropDelay = 300  ;500       ; time in between each item dropped (if more than one) 
    Payload = ChinaCarpetBomb 10 
    DeliveryDistance = 350 
    
    DeliveryDecalRadius = 100 
    DeliveryDecal 
      Texture           = sccsyshack 
      Style             = SHADOW_ALPHA_DECAL 
      OpacityMin        = 25% 
      OpacityMax        = 50% 
      OpacityThrobTime  = 500 
      Color             = R:255 G:0 B:0 A:255 
      OnlyVisibleToOwningPlayer = Yes 
    End 
  End 
End 




;------------------------------------------------------------------------------ 
ObjectCreationList SUPERWEAPON_ChinaSatHack3_ThunderboltStrike 
  DeliverPayload 
    Transport                       = AmericaJetA10Thunderbolt 
    FormationSize                   = 2 
    FormationSpacing                = 35.0 
    WeaponConvergenceFactor         = 0.5 
    StartAtPreferredHeight          = Yes 
    StartAtMaxSpeed                 = Yes 
    MaxAttempts                     = 1                   ;max attempts 
    DropDelay                       = 500                 ;time in between each set of items dropped (if more than one) 
    DeliveryDistance                = 450                 ;distance from target allowed to start/stop dropping. 
    VisibleItemsDroppedPerInterval  = 2                   ;Drops two bombs at a time 
    VisibleDropBoneBaseName         = WeaponA             ;The bombs are created and dropped at this bone base 
    VisibleSubObjectBaseName        = Missile             ;The bombs are visible until dropped. 
    VisibleNumBones                 = 6                   ;Number of bones. 
    VisiblePayloadTemplateName      = A10ThunderboltMissile  ;Created when payload is dropped. 
    VisiblePayloadWeaponTemplate    = A10ThunderboltMissileWeapon 
    InheritTransportVelocity        = Yes                 ;The bombs will start at transport velocity. 
    ExitPitchRate                   = 30                  ;The bomb will pitch down. 
    DiveStartDistance               = 500 
    DiveEndDistance                 = 300 
    StrafingWeaponSlot              = PRIMARY             ;Strafe while diving (so long target point is within weapon range) 
    StrafeLength                    = 450 
    StrafeWeaponFX                  = FX_DamageTankStruckSmallArms 
    DeliveryDecalRadius = 100 
    DeliveryDecal 
      Texture           = sccsyshack 
      Style             = SHADOW_ALPHA_DECAL 
      OpacityMin        = 25% 
      OpacityMax        = 50% 
      OpacityThrobTime  = 500 
      Color             = R:255 G:0 B:0 A:255 
      OnlyVisibleToOwningPlayer = Yes 
    End 
  End 
End

These are the OCL's that the objects in weaponobjects.ini are looking for. I could have just used the original superweapons' OCL's, but this way allows you to balance the attacks without affecting the original weapon, and allows you to give each attack the same DeliveryDecal, adding to the mystery of what is going to hit the area.

And now, to get everything displaying right, add these strings to your CSF or STR file:
UPGRADE:SatelliteHackThree
CONTROLBAR:UpgradeChinaSatelliteHackThree
CONTROLBAR:TooltipSatHack3
CONTROLBAR:SatHack3

Thats it! time to try it out ingame

Layout by Origin-Network