GreyW00lf
  • GreyW00lf
  • 50.25% (Neutral)
  • Captain Topic Starter
9 years ago
Was trying to make a Custom (Daisy Cutter Styled explosion) Tomahawk Missile Weapon for a Custom Long Ranged Tomahawk, I can Spawn in the Vehicle just fine from the War Factory however when I go to Fire the weapon at say a building it kills itself and any thing else near it.

- - -
please note that this is supposed to be A Super long Ranged tomahawk Missile with a Daisy Cutter's Effect when Exploding
- - -


Could I have Someone Look over this Code because I think I missed Something.


Vehicle

Object AmericaVehicleTomahawk2

; *** ART Parameters ***
SelectPortrait = SACTomahawk_L
ButtonImage = SACTomahawk

UpgradeCameo1 = Upgrade_AmericaScoutDrone
UpgradeCameo2 = Upgrade_AmericaBattleDrone
UpgradeCameo3 = Upgrade_AmericaHellfireDrone
UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
;UpgradeCameo5 = XXX

Draw = W3DTankDraw ModuleTag_01
OkToChangeModelColor = Yes

ProjectileBoneFeedbackEnabledSlots = PRIMARY ; WeaponLaunchBone will be shown/hidden, not just used for firing offset

DefaultConditionState
Model = AVTomahawk
Turret = TURRET
TurretPitch = TURRETEL
WeaponLaunchBone = PRIMARY WeaponA
WeaponHideShowBone = PRIMARY MISSILE
End

ConditionState = REALLYDAMAGED
Model = AVTomahawk_D
End
AliasConditionState = RUBBLE

TrackMarks = EXTnkTrack.tga

End

; ***DESIGN parameters ***
DisplayName = OBJECT:Tomahawk
Side = America
EditorSorting = VEHICLE
TransportSlotCount = 3 ;how many "slots" we take in a transport (0 == not transportable)
BuildCost = 24000
BuildTime = 20.0 ;in seconds
VisionRange = 150
ShroudClearingRange = 200
Prerequisites
Object = AmericaWarFactory
Object = AmericaStrategyCenter
End
ExperienceValue = 50 50 100 150 ;Experience point value at each level
ExperienceRequired = 0 200 400 800 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience
WeaponSet
Conditions = None
Weapon = PRIMARY MirvMissileWeapon
End
ArmorSet
Conditions = None
Armor = TruckArmor
DamageFX = TankDamageFX
End
CrusherLevel = 2 ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
CrushableLevel = 2 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = AmericaVehicleTomahawkCommandSet
MaxSimultaneousOfType = 1

; *** AUDIO Parameters ***
VoiceSelect = TomahawkVoiceSelect
VoiceMove = TomahawkVoiceMove
VoiceGuard = TomahawkVoiceMove
VoiceAttack = TomahawkVoiceAttack
SoundMoveStart = TomahawkMoveStart
SoundMoveStartDamaged = TomahawkMoveStart

UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = TomahawkVoiceCreate
TurretMoveStart = NoSound
TurretMoveLoop = TurretMoveLoopLoud
SoundEject = PilotSoundEject
VoiceEject = PilotVoiceEject
VoiceCrush = TomahawkVoiceCrush
VoiceEnter = TomahawkVoiceMove
VoiceBombard = TomahawkVoiceAttack
End

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD SELECTABLE DONT_AUTO_CRUSH_INFANTRY CAN_ATTACK CAN_CAST_REFLECTIONS VEHICLE SCORE

Body = ActiveBody ModuleTag_02
MaxHealth = 180.0
InitialHealth = 180.0

; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
SubdualDamageCap = 360
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End

Behavior = AIUpdateInterface ModuleTag_03
Turret
TurretTurnRate = 60 ; turn rate, in degrees per sec
TurretPitchRate = 60
FirePitch = 70 ; Instead of aiming pitchwise at the target, it will aim here
AllowsPitch = Yes
ControlledWeaponSlots = PRIMARY
End
AutoAcquireEnemiesWhenIdle = No
End
Locomotor = SET_NORMAL TomahawkLocomotor

Behavior = PhysicsBehavior ModuleTag_04
Mass = 50.0
End
Behavior = SlowDeathBehavior ModuleTag_05
DeathTypes = ALL -CRUSHED -SPLATTED
DestructionDelay = 500
DestructionDelayVariance = 100
FX = INITIAL FX_GenericTankDeathEffect
OCL = MIDPOINT OCL_AmericaVehicleTomahawkDie
FX = FINAL FX_AmericaVehicleTomahawkDeathExplosion
End

Behavior = ObjectCreationUpgrade ModuleTag_06
UpgradeObject = OCL_AmericanBattleDrone
TriggeredBy = Upgrade_AmericaBattleDrone
ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
End
Behavior = ObjectCreationUpgrade ModuleTag_07
UpgradeObject = OCL_AmericanScoutDrone
TriggeredBy = Upgrade_AmericaScoutDrone
ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
End
Behavior = ObjectCreationUpgrade ModuleTag_15
UpgradeObject = OCL_AmericanHellfireDrone
TriggeredBy = Upgrade_AmericaHellfireDrone
ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
End

Behavior = ProductionUpdate ModuleTag_08
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
End

Behavior = ExperienceScalarUpgrade ModuleTag_09
TriggeredBy = Upgrade_AmericaAdvancedTraining
AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
End

Behavior = DestroyDie ModuleTag_10
DeathTypes = NONE +CRUSHED +SPLATTED
End

Behavior = CreateCrateDie ModuleTag SalvageData
CrateData = SalvageCrateData
End

Behavior = FXListDie ModuleTag_11
DeathTypes = NONE +CRUSHED +SPLATTED
DeathFX = FX_CarCrush
End

Behavior = CreateObjectDie ModuleTag_12
DeathTypes = NONE +CRUSHED +SPLATTED
CreationList = OCL_CrusaderTank_CrushEffect
End

; Behavior = FXListDie
; DeathTypes = ALL -CRUSHED -SPLATTED
; DeathFX = FX_GenericTankDeathEffect
; End
; Behavior = CreateObjectDie
; DeathTypes = ALL -CRUSHED -SPLATTED
; CreationList = OCL_GenericTankDeathEffect
; End
Behavior = EjectPilotDie ModuleTag_13
DeathTypes = ALL -CRUSHED -SPLATTED
ExemptStatus = HIJACKED
VeterancyLevels = ALL -REGULAR ;only vet+ gives pilot
GroundCreationList = OCL_EjectPilotOnGround
AirCreationList = OCL_EjectPilotViaParachute
End

Behavior = TransitionDamageFX ModuleTag_14
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
End

Behavior = FlammableUpdate ModuleTag_21
AflameDuration = 5000 ; If I catch fire, I'll burn for this long...
AflameDamageAmount = 3 ; taking this much damage...
AflameDamageDelay = 500 ; this often.
End

Geometry = BOX
GeometryMajorRadius = 15.0
GeometryMinorRadius = 10.0
GeometryHeight = 10.0
GeometryIsSmall = Yes
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End


Weapon Object


;------------------------------------------------------------------------------
Object MirvMissile

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
OkToChangeModelColor = Yes
DefaultConditionState
Model = AVTomahawk_M
End
ConditionState = JAMMED
ParticleSysBone = None SparksMedium
End
End

; ***DESIGN parameters ***
DisplayName = OBJECT:TomahawkMissile
EditorSorting = SYSTEM
VisionRange = 0.0
ArmorSet
Conditions = None
;*Be careful with this type, use in conjunction with KindOf = BALLISTIC_MISSILE to restrict targeting
;*to select weapons, because ballistic missile armor is weak! Weapons capable of targeting must have
;*AntiBallisticMissile = Yes set in the Weapon.ini.
Armor = BallisticMissileArmor
DamageFX = None
End

; *** ENGINEERING Parameters ***
KindOf = PROJECTILE BALLISTIC_MISSILE
Body = ActiveBody ModuleTag_02
MaxHealth = 200.0
InitialHealth = 100.0

; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
; A projectile is not disabled, but instead loses target and scatters
SubdualDamageCap = 400
SubdualDamageHealRate = 100000
SubdualDamageHealAmount = 50
End

; ---- begin Projectile death behaviors
Behavior = CreateObjectDie ModuleTag_01
CreationList = OCL_DaisyCutterExplode
End
Behavior = FXListDie ModuleTag_02
DeathFX = FX_DaisyCutterExplode
End
Behavior = DestroyDie ModuleTag_05
;nothing
End
; ---- end Projectile death behaviors

Behavior = PhysicsBehavior ModuleTag_06
Mass = 1
End
Behavior = MissileAIUpdate ModuleTag_07
TryToFollowTarget = Yes
FuelLifetime = 120000
IgnitionDelay = 0
IgnitionFX = FX_TomahawkIgnition
InitialVelocity = 50 ; in dist/sec
DistanceToTravelBeforeTurning = 80
DistanceToTargetBeforeDiving = 200 ; When I hit this close to target, I ignore PreferredHeight.
; Note, if this is too small, the missile will turn too late to hit. And, since we have a 2D
; heart, being over the target counts as "there", so we'll give up and just go straight.

DistanceToTargetForLock = 10 ; Short lock on, as it looks better flying. jba.
End
Locomotor = SET_NORMAL TomahawkMissileLocomotor

Behavior = HeightDieUpdate ModuleTag_08
TargetHeight = 50.0
TargetHeightIncludesStructures = Yes
End

Geometry = Cylinder ; Since collision extents can't tilt, this is a little fake
GeometryMajorRadius = 8.0
GeometryHeight = 4.0
GeometryIsSmall = Yes

Shadow = SHADOW_DECAL
End


Weapon


;------------------------------------------------------------------------------
Weapon MirvMissileWeapon
PrimaryDamage = 150.0
PrimaryDamageRadius = 10.0
SecondaryDamage = 50.0
SecondaryDamageRadius = 25.0
ScatterRadiusVsInfantry = 20.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.

ScatterTargetScalar = 100; replaces the ScatterRadius, above, for scaling this table, below
ScatterTarget = X: 0.000 Y: 0.133
ScatterTarget = X: 0.133 Y:-0.200
ScatterTarget = X:-0.067 Y: 0.667
ScatterTarget = X: 0.300 Y: 0.300
ScatterTarget = X: 0.767 Y: 0.000
ScatterTarget = X: 0.500 Y:-0.567
ScatterTarget = X:-0.333 Y:-0.800
ScatterTarget = X:-0.600 Y:-0.1333
ScatterTarget = X:-0.567 Y: 0.433
ScatterTarget = X: 0.000 Y: 0.133
ScatterTarget = X: 0.133 Y:-0.200
ScatterTarget = X:-0.067 Y: 0.667
ScatterTarget = X: 0.300 Y: 0.300
ScatterTarget = X: 0.767 Y: 0.000
ScatterTarget = X: 0.500 Y:-0.567
ScatterTarget = X:-0.333 Y:-0.800
ScatterTarget = X:-0.600 Y:-0.1333
ScatterTarget = X:-0.567 Y: 0.433
ScatterTarget = X: 0.000 Y: 0.133
ScatterTarget = X: 0.133 Y:-0.200

AttackRange = 9999.0
PreAttackDelay = 250
PreAttackType = PER_SHOT ; Do the delay every single shot
MinimumAttackRange = 125.0
DamageType = EXPLOSION
DeathType = EXPLODED
FireFX = FX_TomahawkIgnition
ProjectileObject = MirvMissile
ProjectileExhaust = TomahawkMissileExhaust
VeterancyProjectileExhaust = HEROIC HeroicTomahawkMissileExhaust
; ProjectileDetonationFX = WeaponFX_TomahawkMissileDetonation
ProjectileDetonationFX = WeaponFX_BombTruckDefaultBombDetonation
RadiusDamageAffects = SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR
FireSound = TomahawkWeapon
DelayBetweenShots = 1
ClipSize = 12 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 300000 ; how long to reload a Clip, msec
; Uses a clip of one to get the Reloading modelcondition
CapableOfFollowingWaypoints = Yes

; note, these only apply to units that aren't the explicit target
; (ie, units that just happen to "get in the way"... projectiles
; always collide with the Designated Target, regardless of these flags
ProjectileCollidesWith = STRUCTURES
End
Sponsor
Zatsupachi
9 years ago
Looks overly complicated.

Why don't you just make a copy of the Tomahawk Missile weapon.
And change some things.
(I changed ProjectileDetonationFX, and added a ProjectileDetonationOCL.)



;------------------------------------------------------------------------------
Weapon DaisyCutter_TomahawkMissileWeapon
  PrimaryDamage               = 150.0            
  PrimaryDamageRadius         = 10.0      
  SecondaryDamage             = 50.0          
  SecondaryDamageRadius       = 25.0    
  ScatterRadiusVsInfantry     = 20.0     ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
  AttackRange                 = 900.0
  PreAttackDelay              = 250
  PreAttackType               = PER_SHOT ; Do the delay every single shot
  MinimumAttackRange          = 100.0
  DamageType                  = EXPLOSION 
  DeathType                   = EXPLODED
  FireFX                      = FX_TomahawkIgnition
  ProjectileObject            = DaisyCutter_TomahawkMissile
  ProjectileExhaust           = TomahawkMissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicTomahawkMissileExhaust
  ProjectileDetonationFX      = FX_DaisyCutterExplode
  ProjectileDetonationOCL = OCL_TomahawkDaisyCutterExplode
  RadiusDamageAffects         = SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR
  FireSound                   = TomahawkWeapon
  DelayBetweenShots           = 0
  ClipSize                    = 1                   ; how many shots in a Clip (0 == infinite)
  ClipReloadTime              = 8000               ; how long to reload a Clip, msec
  ; Uses a clip of one to get the Reloading modelcondition
  CapableOfFollowingWaypoints = Yes

  ; note, these only apply to units that aren't the explicit target 
  ; (ie, units that just happen to "get in the way"... projectiles
  ; always collide with the Designated Target, regardless of these flags
  ProjectileCollidesWith = STRUCTURES
End


Also note the ProjectileObject "DaisyCutter_TomahawkMissile."
Its essentially a copy of TomahawkMissile, with a higher FuelLifeTime.

There's a some custom objects I had to make to have it work properly.


Object, its a copy of DaisyCutterGas, instead of HeightDieUpdate, its a LifetimeUpdate

;------------------------------------------------------------------------------
Object Tomahawk_DaisyCutterGas

  ; *** ART Parameters ***
;  Draw = W3DModelDraw
;;    ConditionState      = NONE
;      Model             = PMDumpst04
;    End
;  End

  ; *** DESIGN Parameters ***

  ; *** ENGINEERING Parameters ***
  KindOf = IMMOBILE
  Body                  = ActiveBody ModuleTag_01
    MaxHealth           = 1.0
    InitialHealth       = 1.0
  End

  Behavior = PhysicsBehavior ModuleTag_02
    Mass                = 150.0
    AerodynamicFriction = 7  ; this is now friction-per-sec
    ForwardFriction     = 200   ; this is now friction-per-sec
  End
  Behavior = LifetimeUpdate ModuleTag_03
    MinLifetime = 1000
    MaxLifetime = 1000
  End
  Behavior = SlowDeathBehavior ModuleTag_04
    DestructionDelay        = 1000
    DestructionDelayVariance = 100
    FX                  = INITIAL FX_DaisyCutterIgnite
    FX                  = FINAL   FX_DaisyCutterFinalExplosion
    Weapon              = MIDPOINT   DaisyCutterFlameWeapon    ; Just a spot of flame to light trees on fire
    Weapon              = FINAL   DaisyCutterDetonationWeapon
  End

End

OCL to spawn the object

ObjectCreationList OCL_TomahawkDaisyCutterExplode

  ; This daisy cutter gas is the actual object that does the damage
  CreateObject
    ObjectNames = Tomahawk_DaisyCutterGas
    Disposition = LIKE_EXISTING
  End
  
  ; Random debris for the bomb shell breaking up
  CreateDebris
    ModelNames = GXMammoth_D01 GXMammoth_D02 GXMammoth_D03 GXMammoth_D04
    Count = 4
    Mass = 5.0
    Disposition = SEND_IT_FLYING
    DispositionIntensity = 1.5
  End
  
End


Here's a video of it working

"It's precision_bomber."
Death Label HAS BEEN RELEASED(go get v0.99):
http://www.moddb.com/mods/death-label/downloads/death-label-ver-099 
Next Episode:
precision_bomber's Zero Hour SCIENCE!