Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
10 years ago
So what I'm trying to do here is give the GLA Demolitions General a carpet bombing General's Ability similar to the USA Air Force General's. It's fired from the Palace.

I've followed CommieDog's tutorial  for cloning a General's Ability, and it almost works. I can "purchase" the new General's Ability, and select it from the Palace, but when I hover my mouse over terrain, I get the "cannot attack" icon. What am I doing wrong?



ObjectCreationList.ini:


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




CommandButton.ini:


CommandButton Demo_Command_CarpetBomb
  Command       = SPECIAL_POWER
  SpecialPower  = SuperweaponCarpetBomb
  Options       = NEED_SPECIAL_POWER_SCIENCE NEED_TARGET_POS CONTEXTMODE_COMMAND
  TextLabel     = CONTROLBAR:CarpetBomb
  ButtonImage   = SSCarpetBomb
  RadiusCursorType  = CARPETBOMB
  InvalidCursorName = GenericInvalid
  ButtonBorderType        = ACTION ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:TooltipCarpetBomb
End

CommandButton Demo_Command_CarpetBombFromShortcut
  Command       = SPECIAL_POWER_FROM_SHORTCUT
  SpecialPower  = SuperweaponCarpetBomb
  Options       = NEED_SPECIAL_POWER_SCIENCE NEED_TARGET_POS CONTEXTMODE_COMMAND
  TextLabel     = OBJECT:CarpetBomb
  ButtonImage   = SSCarpetBomb
  RadiusCursorType  = CARPETBOMB
  InvalidCursorName = GenericInvalid
  ;ButtonBorderType        = ACTION ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:TooltipCarpetBomb
End
  
CommandButton Demo_Command_PurchaseScienceGLACarpetBomb
  Command           = PURCHASE_SCIENCE
  Science           = Demo_SCIENCE_GLACarpetBomb
  ButtonImage       = SSCarpetBomb
  ButtonBorderType  = UPGRADE ; Identifier for the User as to what kind of button this is
End  




CommandSet.ini:


CommandSet Demo_SCIENCE_GLA_CommandSetRank1
  1 = Command_PurchaseScienceScudLauncher
  2 = Command_PurchaseScienceMarauderTank
  3 = Command_PurchaseScienceTechnicalTraining
  4 = Demo_Command_PurchaseScienceGLACarpetBomb
END



CommandSet Demo_SpecialPowerShortcutGLA
  1 = Command_AmbushFromShortcut
  2 = Command_EmergencyRepairFromShortcut
  3 = Command_AnthraxBombFromShortcut
  4 = Command_ScudStormFromShortcut
  5 = Command_RadarVanScanFromShortcut
  6 = Command_SneakAttackFromShortcut
  7 = Command_GPSScramblerFromShortcut
  8 = Demo_Command_CarpetBombFromShortcut
END



CommandSet Demo_GLAPalaceCommandSet
  1  = Command_StructureExit 
  2  = Command_StructureExit
  3  = Command_StructureExit
  4  = Command_StructureExit
  5  = Command_StructureExit
  6  = Command_Evacuate
  7  = Command_UpgradeGLAFortifiedStructure
  8  = Command_UpgradeGLAArmTheMob
  9  = Demo_Command_CarpetBomb
; 12 = Demo_Command_UpgradeGLADemoTrapHighExplosiveBomb*
  13 = Demo_UpgradeSuicideBomb
  14 = Command_Sell
End

*This line of code is already there in the unmodded files



SpecialPower.ini:
;-----------------------------------------------------------------------------
SpecialPower Demo_SuperweaponGLACarpetBomb
  Enum                = SPECIAL_CHINA_CARPET_BOMB ;SPECIAL_NAPALM_STRIKE* 
  ReloadTime          = 150000   ; in milliseconds
  RequiredScience     = Demo_SCIENCE_GLACarpetBomb
  PublicTimer         = No
  SharedSyncedTimer   = Yes
  ViewObjectDuration  = 40000
  ViewObjectRange     = 250
  RadiusCursorRadius  = 180
  ShortcutPower       = Yes     ;Capable of being fired by the side-bar shortcut.
  AcademyClassify     = ACT_SUPERPOWER ;Considered a powerful special power that a player could fire. Not for simpler unit based powers.
End


*I've already tried using both of these. Still can't fire.





Palace in DemoGeneral.ini:



  Behavior           = OCLSpecialPower ModuleTag_24
    SpecialPowerTemplate = Demo_SuperweaponGLACarpetBomb
    OCL                  = Demo_SUPERWEAPON_GLACarpetBomb
    CreateLocation       = CREATE_AT_EDGE_NEAR_SOURCE
  End 




(You can't see the mouse icon in either of the two pics attached, unfortunately.)   sshot257.bmp (3,841kb) downloaded 9 time(s).   sshot258.bmp (3,841kb) downloaded 8 time(s).
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Sponsor
acidbrain
10 years ago
Did you add this module to the GLAJetCargoPlane?

Behavior = OCLSpecialPower ModuleTag_11
  SpecialPowerTemplate = Demo_SuperweaponGLACarpetBomb
  OCL                  = Demo_SUPERWEAPON_GLACarpetBomb
  CreateLocation       = CREATE_AT_EDGE_NEAR_SOURCE
End

Panem et kirkinses
Annihilationzh
10 years ago
You have Demo_SuperweaponGLACarpetBomb in most of it but SuperweaponGLACarpetBomb in the buttons. They need to be the same.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
10 years ago
Alright, thank you both! I've done what AcidBrain and AZH said to do and now it works perfectly!

Well, except for one thing. The button at the Palace causes the game to crash with a "Serious Error" when I click it. Furthermore it doesn't match up with the timer of the power from the shortcut.   sshot259.bmp (3,841kb) downloaded 6 time(s).   sshot261.bmp (3,841kb) downloaded 5 time(s).
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
10 years ago
Nevermind, I found the problem. I accidently put "Demo_SuperweaponGLACarpetBombb" instead of "Demo_SuperweaponGLACarpetBomb"


Thank you guys for your help!

On a side note, it's great to see that you're back, AZH. 😃
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Annihilationzh
10 years ago

Nevermind, I found the problem. I accidently put "Demo_SuperweaponGLACarpetBombb" instead of "Demo_SuperweaponGLACarpetBomb"

Originally Posted by: Gameanater 


Copy and Paste would solve so many of your problems.

As you can probably tell from CommieDog's tutorial, the cargo plane step isn't actually necessary.

On a side note, it's great to see that you're back, AZH. :D

Originally Posted by: Gameanater 


Shh. It wasn't me that was missing. I swear it was the forum that was missing.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
10 years ago

Nevermind, I found the problem. I accidently put "Demo_SuperweaponGLACarpetBombb" instead of "Demo_SuperweaponGLACarpetBomb"

Originally Posted by: Annihilationzh 


Copy and Paste would solve so many of your problems.

As you can probably tell from CommieDog's tutorial, the cargo plane step isn't actually necessary.

On a side note, it's great to see that you're back, AZH. :D

Originally Posted by: Gameanater 


Shh. It wasn't me that was missing. I swear it was the forum that was missing.

Originally Posted by: Gameanater 



I used copy and paste. I just made an error in doing it.


Well, it worked, and I'm happy now. :D



XD
No I'm pretty sure you were missing.







For anyone wondering looking at the code, no, this isn't going to be the same OP early-or-mid-game carpet bombing thing in my mod that Granger has in vanilla ZH. Yes, it drops more bombs, but the only reason it was available THAT early was just for testing purposes. It now requires the same level of General's Points as a Rebel Ambush.
Also, keep in mind that the GLA Cargo Plane is actually pretty fragile compared to the Granger B-52 Bomber, and a heckovalot slower.
Granger also will get his carpet bombing purchase button moved to the same level as a Ranger Drop for better balancing.


Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.