precision_bomber
14 years ago
Hello people!
I have a problem with a new SuperWeapon I made for the SuperWeapon General.
It's a 5-star promotion named 'MOAB Carpet Bomb'
Sorry if I have too much to say here...

OCL
ObjectCreationList SupW_SUPERWEAPON_BombingRun
  DeliverPayload
    Transport = AirF_AmericaJetB3
    StartAtPreferredHeight = Yes
    StartAtMaxSpeed = Yes
    MaxAttempts = 1     ; max attempts
    DropDelay = 200     ; time in between each set of items dropped (if more than one)
    DeliveryDistance = 500     ; distance from target allowed to start/stop dropping.
    ; Drops two bombs at a time
    ; The bombs are created and dropped at this bone base
    ; The bombs are visible until dropped.
    VisibleNumBones = 6     ; Number of bones.
    ; Created when payload is dropped.
    ; The bombs will start at transport velocity.
    ; The bomb will pitch down.
    ; Strafe while diving (so long target point is within weapon range)
    DeliveryDecalRadius = 180
    DeliveryDecal
      Texture = SCCA10Strike_USA
      Style = SHADOW_ALPHA_DECAL
      OpacityMin = 25%
      OpacityMax = 50%
      OpacityThrobTime = 500
      Color = R:255 G:156 B:0 A:255
      OnlyVisibleToOwningPlayer = Yes
    End
    DropOffset = X:0 Y:0 Z:-2
    DropVariance = X:30 Y:40 Z:0
    Payload = MOAB 4
  End
  DeliverPayload
    Transport = AirF_AmericaJetB3
    StartAtPreferredHeight = Yes
    StartAtMaxSpeed = Yes
    MaxAttempts = 1     ; max attempts
    DropDelay = 200     ; time in between each set of items dropped (if more than one)
    DeliveryDistance = 500     ; distance from target allowed to start/stop dropping.
    ; Drops two bombs at a time
    ; The bombs are created and dropped at this bone base
    ; The bombs are visible until dropped.
    VisibleNumBones = 6     ; Number of bones.
    ; Created when payload is dropped.
    ; The bombs will start at transport velocity.
    ; The bomb will pitch down.
    ; Strafe while diving (so long target point is within weapon range)
    DeliveryDecalRadius = 180
    DeliveryDecal
      Texture = SCCA10Strike_USA
      Style = SHADOW_ALPHA_DECAL
      OpacityMin = 25%
      OpacityMax = 50%
      OpacityThrobTime = 500
      Color = R:255 G:156 B:0 A:255
      OnlyVisibleToOwningPlayer = Yes
    End
    DropOffset = X:0 Y:0 Z:-2
    DropVariance = X:30 Y:40 Z:0
    Payload = MOAB 4
  End
  DeliverPayload
    Transport = AirF_AmericaJetB3
    StartAtPreferredHeight = Yes
    StartAtMaxSpeed = Yes
    MaxAttempts = 1     ; max attempts
    DropDelay = 200     ; time in between each set of items dropped (if more than one)
    DeliveryDistance = 500     ; distance from target allowed to start/stop dropping.
    ; Drops two bombs at a time
    ; The bombs are created and dropped at this bone base
    ; The bombs are visible until dropped.
    VisibleNumBones = 6     ; Number of bones.
    ; Created when payload is dropped.
    ; The bombs will start at transport velocity.
    ; The bomb will pitch down.
    ; Strafe while diving (so long target point is within weapon range)
    DeliveryDecalRadius = 180
    DeliveryDecal
      Texture = SCCA10Strike_USA
      Style = SHADOW_ALPHA_DECAL
      OpacityMin = 25%
      OpacityMax = 50%
      OpacityThrobTime = 500
      Color = R:255 G:156 B:0 A:255
      OnlyVisibleToOwningPlayer = Yes
    End
    DropOffset = X:0 Y:0 Z:-2
    DropVariance = X:30 Y:40 Z:0
    Payload = MOAB 4
  End
End
; 

OCLSpecialPower Behavior in SupW Gen's Command
Behavior = OCLSpecialPower ModuleTag_26
    SpecialPowerTemplate = SupW_SuperweaponB3BombingRun
    UpgradeOCL = SCIENCE_A10ThunderboltMissileStrike3 SupW_SUPERWEAPON_BombingRun
    UpgradeOCL = SCIENCE_A10ThunderboltMissileStrike2 SUPERWEAPON_A10ThunderboltMissileStrike2
    OCL = SupW_SUPERWEAPON_BombingRun
    CreateLocation = CREATE_AT_EDGE_NEAR_SOURCE
  End
The weird thing here is that this popped out of the raw code, but on not my editor.
Maybe this is what is making the game crash. Though, maybe there is still somethings within my code that is wrong.

Here's the SpecialPower
SpecialPower SupW_SuperweaponB3BombingRun
  Enum = AIRF_SPECIAL_CARPET_BOMB
  ReloadTime = 600000     ; in milliseconds
  RequiredScience = SupW_SCIENCE_B3BombingRun
  PublicTimer = No
  SharedSyncedTimer = Yes
  ViewObjectDuration = 30000
  ViewObjectRange = 250
  RadiusCursorRadius = 50
  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.
  InitiateAtLocationSound = SupW_MOABCarpetBomb
End

I probably don't need to show the science.

But anyway, is the error in raw code my mistake or did I made more mistakes?
Death Label:
Reduced back to 3 main factions(and a couple of extras).
Each faction can choose a(or all of them) tech-tree via General's Powers.
Angel Wings: Jets and Anti-Air, Helicopters and Missiles, Hovercraft and Lasers
Red Skulls: Armor Division, Mecha Armada, Drone Swarm
Earth's Saviors: Air Raid, Homeworld Security, Stealth
Sponsor
acidbrain
14 years ago
Try this stuff...

Add this to Science.ini
Science SCIENCE_Supw_MoabCarpetBomb
  PrerequisiteSciences = SCIENCE_AMERICA SCIENCE_Rank5
  SciencePurchasePointCost = 1
  IsGrantable = Yes
  DisplayName = SCIENCE:ChinaCarpetBomb
  Description = CONTROLBAR:AirF_ToolTipUSAScienceCarpetBomb
End

Add this to CommandButton.ini
CommandButton Command_PurchaseScienceMoabCarpetBomb
  Command           = PURCHASE_SCIENCE
  Science           = SCIENCE_Supw_MoabCarpetBomb
  ButtonImage       = SAMoabCarpet 
  ButtonBorderType  = UPGRADE ; Identifier for the User as to what kind of button this is
End

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

;If you want to use this you have to delete another shortcut...
;CommandButton Supw_Command_MoabCarpetBombFromShortcut
;  Command           = SPECIAL_POWER_FROM_SHORTCUT
;  SpecialPower      = SupW_SuperweaponMoabCarpetBomb
;  Options           = NEED_SPECIAL_POWER_SCIENCE NEED_TARGET_POS CONTEXTMODE_COMMAND
;  TextLabel         = OBJECT:CarpetBomb
;  ButtonImage       = SAMoabCarpet
;  RadiusCursorType  = CARPETBOMB
;  InvalidCursorName = GenericInvalid
;  ;ButtonBorderType = ACTION ; Identifier for the User as to what kind of button this is
;  DescriptLabel     = CONTROLBAR:TooltipCarpetBomb
;End

Add this to CommandSet.ini
CommandSet SupW_SCIENCE_AMERICA_CommandSetRank8
3 = Command_PurchaseScienceMoabCarpetBomb

If you want a shortcutbutton you have to delete another one....
CommandSet SupW_SpecialPowerShortcutUSA
[Number of choice] = Supw_Command_MoabCarpetBombFromShortcut

CommandSet SupW_AmericaCommandCenterCommandSet
3  = Supw_Command_MoabCarpetBomb

Add this to SpecialPower.ini
SpecialPower SupW_SuperweaponMoabCarpetBomb
  Enum = AIRF_SPECIAL_CARPET_BOMB
  ReloadTime = 600000     ; in milliseconds
  RequiredScience = SCIENCE_Supw_MoabCarpetBomb
  PublicTimer = No
  SharedSyncedTimer = Yes
  ViewObjectDuration = 30000
  ViewObjectRange = 250
  RadiusCursorRadius = 50
  ShortcutPower = Yes
  AcademyClassify = ACT_SUPERPOWER
End

Add this to SuperWeaponGeneral.ini
Object SupW_AmericaCommandCenter
Behavior = OCLSpecialPower ModuleTag_29
    SpecialPowerTemplate = SupW_SuperweaponMoabCarpetBomb
    OCL = SupW_SUPERWEAPON_MoabCarpetBomb
    CreateLocation = CREATE_AT_EDGE_NEAR_SOURCE
  End

This is a new B3 bomber, a bit more health and a bit faster.
Object SupW_AmericaJetB3MoabCarpet

  ; *** ART Parameters ***
  Draw = W3DModelDraw ModuleTag_01
    DefaultConditionState
      Model = AVB3bmbr
      ParticleSysBone = Engine01 JetBlackTrailThin
      ParticleSysBone = Engine02 JetBlackTrailThin
      ParticleSysBone = WingTip01 JetContrailThin
      ParticleSysBone = WingTip02 JetContrailThin
      ParticleSysBone = WingTip03 JetContrailThin
      ParticleSysBone = WingTip04 JetContrailThin
    End
    ConditionState = DAMAGED
      Model = AVB3bmbr_D
      ParticleSysBone = Smoke01 JetFireLarge
      ParticleSysBone = Smoke02 JetFireLarge
      ParticleSysBone = Engine01 JetBlackTrailThin
      ParticleSysBone = Engine02 JetBlackTrailThin
      ParticleSysBone = Engine03 JetBlackTrailThin
      ParticleSysBone = Engine04 JetBlackTrailThin
      ParticleSysBone = Smoke01 JetSmokeLarge
      ParticleSysBone = Smoke02 JetSmokeLarge
    End
    ConditionState = REALLYDAMAGED
      Model = AVB3bmbr_D
      ParticleSysBone = Smoke01 JetFireLarge
      ParticleSysBone = Smoke02 JetFireLarge
      ParticleSysBone = Engine01 JetBlackTrailThin
      ParticleSysBone = Engine02 JetBlackTrailThin
      ParticleSysBone = Engine03 JetBlackTrailThin
      ParticleSysBone = Engine04 JetBlackTrailThin
      ParticleSysBone = Smoke01 JetSmokeLarge
      ParticleSysBone = Smoke02 JetSmokeLarge
    End
    ConditionState = RUBBLE
      Model = AVB3bmbr_D1
      ParticleSysBone = Smoke01 JetFireLarge
      ParticleSysBone = Smoke02 JetFireLarge
      ParticleSysBone = Smoke01 JetSmokeLarge
      ParticleSysBone = Smoke02 JetSmokeLarge
    End
    OkToChangeModelColor = Yes
  End
  
  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:B52
  EditorSorting       = VEHICLE
  Side                = AmericaSuperWeaponGeneral
  TransportSlotCount  = 0                 ;how many "slots" we take in a transport (0 == not transportable)
  VisionRange         = 0.0 
  ArmorSet
    Conditions      = None
    Armor           = AirplaneArmor
    DamageFX        = TankDamageFX
  End
  ArmorSet
    Conditions            = PLAYER_UPGRADE
    Armor                 = CountermeasuresAirplaneArmor
    DamageFX              = None
  End
  CommandSet        = Command_ScriptedTransportDrops

  ; *** AUDIO Parameters ***
  SoundAmbient = B3BomberAmbientLoop
  SoundAmbientRubble    = NoSound

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD CAN_CAST_REFLECTIONS CAN_ATTACK  VEHICLE SCORE TRANSPORT AIRCRAFT IGNORED_IN_GUI EMP_HARDENED
  Body = ActiveBody ModuleTag_03
    MaxHealth       = 3000.0
    InitialHealth   = 3000.0
  End

  ExperienceValue     = 50 50 50 50  ; Experience point value at each level
      
  Behavior    = OCLSpecialPower ModuleTag_06
    SpecialPowerTemplate = SupW_SuperweaponMoabCarpetBomb
    OCL                  = SupW_SUPERWEAPON_MoabCarpetBomb
    CreateLocation       = CREATE_AT_EDGE_NEAR_SOURCE
    ScriptedSpecialPowerOnly = Yes
  End

  Behavior = PhysicsBehavior ModuleTag_07
    Mass = 500.0
  End

  Behavior = DeliverPayloadAIUpdate ModuleTag_08
    DoorDelay         = 500
    MaxAttempts       = 4
    DropOffset        = X:0 Y:0 Z:-10
    DropDelay         = 300     ; time in between each item dropped (if more than one)
    PutInContainer    = AmericaParachute
    DeliveryDistance  = 150
  End
  Locomotor = SET_NORMAL B3MoabCarpetLocomotor

  Behavior = TransportContain ModuleTag_09
    Slots                       = 100                     ; hey, it's a BIG transport
    ScatterNearbyOnExit         = No
    OrientLikeContainerOnExit   = Yes
    KeepContainerVelocityOnExit = Yes
    ExitPitchRate               = 30
    ExitBone                    = WeaponA01
    AllowInsideKindOf           = INFANTRY VEHICLE PROJECTILE DOZER PARACHUTABLE
    DoorOpenTime                = 0                ; this prevents the Contain module from messing with the doors, since we want DeliverPayload to handle 'em
    NumberOfExitPaths           = 0
    DestroyRidersWhoAreNotFreeToExit = Yes  ; 'destroy' as opposed to 'kill'
  End
    
  Behavior                          = JetSlowDeathBehavior ModuleTag_10
    DestructionDelay                = 2000 
    RollRate                        = 0.0
    RollRateDelta                   = 100%      ;each frame, rollrate = rollrate * rollrateDelta
    PitchRate                       = 0
    FallHowFast                     = 25.0%    ;Bigger is faster (can be over 100%,it's a fraction of gravity)
    FXInitialDeath                  = FX_JetBigDeathInitial
    OCLInitialDeath                 = OCL_AmericaJetCargoDeathStart
    DelaySecondaryFromInitialDeath  = 2000       ; in milliseconds     This guy won't hit the ground, so this time equals the above time
    OCLSecondary                    = OCL_AmericaJetCargoHulkDeath
    FXSecondary                     = FX_BigPlaneDeath
  End

  Behavior = TransitionDamageFX ModuleTag_11
    DamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_JetBigDamageTransition
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_JetBigDamageTransition
  End

  Geometry = Box
  GeometryIsSmall = No
  GeometryMajorRadius = 60.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 89  ; minimum elevation angle above horizon. Used to limit shadow length

End

Add this to ObjectCreationList.ini
ObjectCreationList SupW_SUPERWEAPON_MoabCarpetBomb
  DeliverPayload
    Transport = SupW_AmericaJetB3MoabCarpet  ;SupW_AmericaJetB3 
    FormationSize = 3 
    FormationSpacing = 85.0 ;Smaller is planes closer together 
    StartAtPreferredHeight = Yes
    StartAtMaxSpeed = Yes
    MaxAttempts = 1     ; max attempts
    DropOffset = X:0 Y:0 Z:-2
    DropVariance = X:30 Y:40 Z:0
    DropDelay = 300     ; time in between each set of items dropped (if more than one)
    Payload = MOAB 2   
    DeliveryDistance = 350  ;500     ; distance from target allowed to start/stop dropping.
    DeliveryDecalRadius = 180
    DeliveryDecal
      Texture = SCCCarpBomb
      Style = SHADOW_ALPHA_DECAL
      OpacityMin = 25%
      OpacityMax = 50%
      OpacityThrobTime = 500
      Color = R:255 G:156 B:0 A:255
      OnlyVisibleToOwningPlayer = Yes
    End   
  End  
End

Add this to your MappedImages
MappedImage SAMoabCarpet
  Texture = SAMoabCarpet.tga
  TextureWidth = 113
  TextureHeight = 81
  Coords = Left:0 Top:0 Right:113 Bottom:81
  Status = NONE
End

Add this to Locomotor.ini
Locomotor B3MoabCarpetLocomotor
  Surfaces                  = AIR
  Speed                     = 275         ; in dist/sec
  SpeedDamaged              = 180         ; in dist/sec
;  MinSpeed                  = 120         ; in dist/sec
; !!! DO NOT REDUCE MinSpeed BELOW 60 UNTIL LANDINGS ARE FIXED (srj)
  MinSpeed                  = 60         ; in dist/sec
  TurnRate                  = 160         ; in degrees/sec
  TurnRateDamaged           = 90          ; in degrees/sec
  Acceleration              = 180         ; in dist/(sec^2)
  AccelerationDamaged       = 120         ; in dist/(sec^2)
  Lift                      = 120         ; in dist/(sec^2)
  LiftDamaged               = 80          ; in dist/(sec^2)
  Braking                   = 10          ; in dist/(sec^2)
  MinTurnSpeed              = 100         ; in dist/sec
  PreferredHeight           = 100
  AllowAirborneMotiveForce  = Yes
  ZAxisBehavior             = SURFACE_RELATIVE_HEIGHT
  CirclingRadius            = 150       ; the radius at which we circle when we are trying to maintain position. 
  Appearance                = WINGS
  PitchInDirectionOfZVelFactor  = 1.0    ;  how much to pitch according to our z-vel. 0=none, 1=lots (0=default)
  PitchStiffness                = 0.5    ;  stiffness of the "springs" in the suspension forward & back.
  RollStiffness                 = 0.4    ;  stiffness of the "springs" in the suspension side to side.
  PitchDamping                  = 0.9    ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  RollDamping                   = 0.8    ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  ForwardVelocityPitchFactor    = 0      ;  How much velocity will cause the front to lift/dip
  LateralVelocityRollFactor     = 0.2    ;  How much cornering will cause the chassis to roll.
  Apply2DFrictionWhenAirborne   = Yes
  AirborneTargetingHeight       = 30
  LocomotorWorksWhenDead        = Yes    ; JetSlowDeathBehavior needs this to function correctly
End

I made a shiny new cameo for the buttons, put it in your Art folder.

Sorry i got a bit carried away...😁

If you run into trouble with this stuff just let me know...

Greetz, acidbrain
SAMoabCarpet.jpg

Click to View Image36 View(s)

  SAMoabCarpet.rar (17kb) downloaded 3 time(s).
Panem et kirkinses
precision_bomber
14 years ago
Thanks now I can relieve sort of overlook for Moddb.

I already have something In mind for it's picture though.

Next thing. ParticleSystem for a shell.
Death Label:
Reduced back to 3 main factions(and a couple of extras).
Each faction can choose a(or all of them) tech-tree via General's Powers.
Angel Wings: Jets and Anti-Air, Helicopters and Missiles, Hovercraft and Lasers
Red Skulls: Armor Division, Mecha Armada, Drone Swarm
Earth's Saviors: Air Raid, Homeworld Security, Stealth