View Single Post
Old 05-12-2004, 09:11 PM   #1 (permalink)
Juggernaut1985
Senior Member
 
Join Date: Jul 2003
Location: Great Republic err State of Texas
Posts: 457
Default Coding Question on a Generals Power

I was coding the K-Wing Strike for Imperial assault and got everything done except that it won't execute the power. Here's my code.

SpecialPower.INI
Code:
SpecialPower SuperweaponK_WingStrike
  Enum                = SPECIAL_NAPALM_STRIKE
  ReloadTime          = 1000   ; in milliseconds
  RequiredScience     = SCIENCE_KWingStrike
  PublicTimer         = Yes
  SharedSyncedTimer   = Yes
  ViewObjectDuration  = 30000
  ViewObjectRange     = 250
  RadiusCursorRadius  = 100
  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
Science.INI
Code:
Science SCIENCE_KWingStrike
  PrerequisiteSciences = SCIENCE_CHINA SCIENCE_Rank1
  SciencePurchasePointCost = 1
  IsGrantable = Yes
  DisplayName = SCIENCE:ChinaNapalmStrike
  Description = CONTROLBAR:ToolTipChinaScienceNapalmStrike
END
ObjectCreationList.INI
Code:
ObjectCreationList SUPERWEAPON_KWingStrike
  DeliverPayload
    Transport                       = AmericaJetAurora
    FormationSize                   = 5
    FormationSpacing                = 35.0
    StartAtPreferredHeight          = Yes
    StartAtMaxSpeed                 = Yes
    MaxAttempts                     = 1
    DropOffset                      = X:0 Y:0 Z:-10
    DropDelay                       = 0
    Payload                         = AuroraBomb 1
    FireWeapon                      = Yes
    DeliveryDistance                = 300
    WeaponConvergenceFactor         = 1.0
    DeliveryDecalRadius = 100
    DeliveryDecal
      Texture           = SCCNapalmStrike_China
      Style             = SHADOW_ALPHA_DECAL
      OpacityMin        = 25%
      OpacityMax        = 50%
      OpacityThrobTime  = 500
      Color             = R:255 G:156 B:0 A:255 
      OnlyVisibleToOwningPlayer = Yes
    End
  End
End
CommandButton.INI
Code:
CommandButton Command_PurchaseScienceKWingStrike
  Command = PURCHASE_SCIENCE
  Science = SCIENCE_KWingStrike
  ButtonImage = SNFirestorm
  ButtonBorderType = UPGRADE
END

CommandButton Command_KWingStrike
  Command = SPECIAL_POWER
  SpecialPower = SuperweaponK_WingStrike
  Options = NEED_SPECIAL_POWER_SCIENCE NEED_TARGET_POS CONTEXTMODE_COMMAND
  Science = SCIENCE_KWingStrike
  TextLabel = CONTROLBAR:NapalmStrike
  ButtonImage = SNFirestorm
  ButtonBorderType = ACTION
  DescriptLabel = CONTROLBAR:TooltipNapalmStrike
  RadiusCursorType = NAPALMSTRIKE
  InvalidCursorName = GenericInvalid
END

CommandButton Command_KWingStrike
  Command = SPECIAL_POWER_FROM_SHORTCUT
  SpecialPower = SuperweaponK_WingStrike
  Options = NEED_SPECIAL_POWER_SCIENCE NEED_TARGET_POS CONTEXTMODE_COMMAND
  Science = SCIENCE_KWingStrike
  TextLabel = CONTROLBAR:NapalmStrike
  ButtonImage = SNFirestorm
  ButtonBorderType = ACTION
  DescriptLabel = CONTROLBAR:TooltipNapalmStrike
  RadiusCursorType = NAPALMSTRIKE
  InvalidCursorName = GenericInvalid
END
CommandSet.INI
Code:
CommandSet ChinaCommandCenterCommandSet
  1 = Command_ConstructChinaDozer
  2 = Early_Command_ChinaCarpetBomb
  3 = Command_NapalmStrike
  4 = Command_ClusterMines
  5 = Command_CashHack
  6 = Command_ArtilleryBarrage
  7 = Command_EmergencyRepair
  8 = Command_EMPPulse
  10 = Command_KWingStrike
  11 = Command_UpgradeChinaRadar
  12 = Command_UpgradeChinaMines
  13 = Command_SetRallyPoint
  14 = Command_Sell
End

CommandSet Command_KWingStrike
  1= Command_KWingStrike
End

CommandSet SCIENCE_CHINA_CommandSetRank3
  1 = Command_PurchaseScienceClusterMines
  2 = Command_PurchaseScienceKWingStrike
  3 = Early_Command_PurchaseScienceCarpetBomb
  4 = Command_PurchaseScienceArtilleryBarrage1
  5 = Command_PurchaseScienceArtilleryBarrage2
  6 = Command_PurchaseScienceArtilleryBarrage3
  7 = Command_PurchaseScienceCashHack1
  8 = Command_PurchaseScienceCashHack2
  9 = Command_PurchaseScienceCashHack3
  10 = Command_PurchaseScienceEmergencyRepair1
  11 = Command_PurchaseScienceEmergencyRepair2
  12 = Command_PurchaseScienceEmergencyRepair3
  13 = Command_PurchaseScienceFrenzy1
  14 = Command_PurchaseScienceFrenzy2
  15 = Command_PurchaseScienceFrenzy3
End
AmericaAir.INI
Code:
Object AmericaJetAurora
  SelectPortrait = SAAurora_L
  ButtonImage = SAAurora  
  UpgradeCameo1 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo2 = Upgrade_AmericaCountermeasures
  Draw = W3DModelDraw ModuleTag_01
    DefaultConditionState
      Model = AVAurora
      HideSubObject = BurnerFX03 BurnerFX04
      WeaponLaunchBone = PRIMARY WeaponA
    End
    ConditionState = JETEXHAUST
      ParticleSysBone = Wingtip01 JetContrail
      ParticleSysBone = Wingtip02 JetContrail
    End
    ConditionState = JETEXHAUST JETAFTERBURNER
      ParticleSysBone = Wingtip01 JetContrail
      ParticleSysBone = Wingtip02 JetContrail
      ShowSubObject = BurnerFX03 BurnerFX04
      ParticleSysBone = Engine01 JetLenzflare
      ParticleSysBone = Engine02 JetLenzflare
    End
    ConditionState = REALLYDAMAGED
      Model = AVAurora_D
      ParticleSysBone = Smoke01 JetSmoke
      ParticleSysBone = Engine01 JetEngineDamagedSmoke
    End    
    ConditionState = REALLYDAMAGED JETEXHAUST
      Model = AVAurora_D
      ParticleSysBone = Smoke01 JetSmoke
      ParticleSysBone = Engine01 JetEngineDamagedSmoke
      ParticleSysBone = Wingtip01 JetContrail
      ParticleSysBone = Wingtip02 JetContrail
    End
    ConditionState = REALLYDAMAGED JETEXHAUST JETAFTERBURNER
      Model = AVAurora_D
      ParticleSysBone = Smoke01 JetSmoke
      ParticleSysBone = Engine01 JetEngineDamagedSmoke
      ShowSubObject = BurnerFX03 BurnerFX04
      ParticleSysBone = Engine01 JetLenzflare
      ParticleSysBone = Engine02 JetLenzflare
      ParticleSysBone = Wingtip01 JetContrail
      ParticleSysBone = Wingtip02 JetContrail
    End
    ConditionState = RUBBLE
      Model = AVAurora_D1
      HideSubObject = None 
      ShowSubObject = None
    End
    ConditionState = RUBBLE JETEXHAUST JETAFTERBURNER
      Model = AVAurora_D1
      HideSubObject = None 
      ShowSubObject = None
      ParticleSysBone = Engine01 JetExhaust
      ParticleSysBone = Engine02 JetExhaust
      ParticleSysBone = Wingtip01 JetContrail
      ParticleSysBone = Wingtip02 JetContrail
    End
    OkToChangeModelColor = Yes
  End
  DisplayName = OBJECT:Aurora
  EditorSorting = VEHICLE
  Side = America
  TransportSlotCount = 0
  VisionRange = 180.0 
  ShroudClearingRange = 600
  Prerequisites
    Object = AmericaAirfield
    Object = AmericaStrategyCenter
  End
  BuildCost = 2500
  BuildTime = 30.0
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY AuroraBombWeapon
  End
  ArmorSet
    Conditions = None
    Armor = AirplaneArmor
    DamageFX = None
  End
  ArmorSet
    Conditions = PLAYER_UPGRADE
    Armor = CountermeasuresAirplaneArmor
    DamageFX = None
  End
  ExperienceValue = 200 200 400 400
  ExperienceRequired = 0 200 400 800
  IsTrainable = Yes
  CrusherLevel = 1
  CrushableLevel = 2
  CommandSet = AmericaJetAuroraCommandSet
  VoiceSelect = AuroraBomberVoiceSelect
  VoiceMove = AuroraBomberVoiceMove
  VoiceGuard = AuroraBomberVoiceSuperSonic
  VoiceAttack = AuroraBomberVoiceAttack
  VoiceDefect = AuroraBomberVoiceCreate
  SoundAmbient = AuroraBomberAmbientLoop
  SoundAmbientRubble = NoSound
  UnitSpecificSounds
    VoiceCreate = AuroraBomberVoiceCreate
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    Afterburner = RaptorAfterburner
    VoiceLowFuel = AuroraBomberVoiceLowFuel
  End
  RadarPriority = UNIT
  KindOf = PRELOAD CAN_CAST_REFLECTIONS CAN_ATTACK SELECTABLE VEHICLE SCORE AIRCRAFT
  Body = ActiveBody ModuleTag_02
    MaxHealth = 80.0
    InitialHealth = 80.0
  End
  Behavior = JetSlowDeathBehavior ModuleTag_30
    FXOnGroundDeath = FX_JetOnGroundDeath
    OCLOnGroundDeath = OCL_AuroraDeathFinalBlowUp
    DestructionDelay = 99999999
    RollRate = 0.2
    RollRateDelta = 100%
    PitchRate = 0.0
    FallHowFast = 110.0%
    FXInitialDeath = FX_AuroraDeathInitial
    OCLInitialDeath = OCL_AuroraDeathHitGround
    DelaySecondaryFromInitialDeath = 500
    FXSecondary = FX_JetDeathSecondary
    FXHitGround = FX_JetDeathHitGround
    OCLHitGround = OCL_AuroraDeathHitGround
    DelayFinalBlowUpFromHitGround = 200
    FXFinalBlowUp = FX_JetDeathFinalBlowUp
    OCLFinalBlowUp = OCL_AuroraDeathFinalBlowUp
    DeathLoopSound = Cin_MigFalling
  End
  Behavior = SpecialPowerCompletionDie ModuleTag_03
    SpecialPowerTemplate = SuperweaponK_WingStrike
  End
  Behavior = OCLSpecialPower ModuleTag_05
    SpecialPowerTemplate = SuperweaponK_WingStrike
    OCL = SUPERWEAPON_K_WingStrike
    CreateLocation = USE_OWNER_OBJECT
  End
  Behavior = DeliverPayloadAIUpdate ModuleTag_60
    DoorDelay = 0
  End
  Behavior = EjectPilotDie ModuleTag_40
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels = ALL -REGULAR
  End
  Behavior = PhysicsBehavior ModuleTag_15
    Mass = 500.0
  End
  Behavior = ExperienceScalarUpgrade ModuleTag_06
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0
  End
  Behavior = JetAIUpdate ModuleTag_07
    OutOfAmmoDamagePerSecond = 10%
    TakeoffDistForMaxLift = 0%
    TakeoffPause = 500
    MinHeight = 5
    SneakyOffsetWhenAttacking = -20.0
    AttackLocomotorType = SET_SUPERSONIC
    AttackLocomotorPersistTime = 1100
    AttackersMissPersistTime = 3000
    ReturnForAmmoLocomotorType = SET_SLUGGISH
    ReturnToBaseIdleTime = 10000
  End
  Locomotor = SET_NORMAL AuroraJetLocomotor
  Locomotor = SET_SUPERSONIC AuroraJetSupersonicLocomotor
  Locomotor = SET_SLUGGISH AuroraJetSluggishLocomotor
  Locomotor = SET_TAXIING BasicJetTaxiLocomotor
  Behavior = ArmorUpgrade ModuleTag_Armor01
    TriggeredBy = Upgrade_AmericaCountermeasures
  End
  Behavior = CountermeasuresBehavior ModuleTag_10
    TriggeredBy = Upgrade_AmericaCountermeasures
    FlareTemplateName = CountermeasureFlare
    FlareBoneBaseName = Flare
    VolleySize = 2
    VolleyArcAngle = 60.0
    VolleyVelocityFactor = 2.0
    DelayBetweenVolleys = 1000
    NumberOfVolleys = 3
    ReloadTime = 0
    EvasionRate = 25%
    ReactionLaunchLatency = 0
    MissileDecoyDelay = 200
  End
  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000
    AflameDamageAmount = 3
    AflameDamageDelay = 500
  End
  Behavior = TransitionDamageFX ModuleTag_22
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes Psys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_MIGDamageTransition
  End
  Geometry = Box
  GeometryIsSmall = Yes
  GeometryMajorRadius = 14.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 5.0
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 89
End


Thats my code. I ran it through WB and it came up clean. The attack just won't execute.

And where would I find "SPECIAL_NAPALM_STRIKE"?

Thank you to all you coders who work so hard. This was the first time I realized that coding was so hard.
Juggernaut1985 is offline   Reply With Quote