kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
hello to you all 😁

i want to make china nuke missile fires 3 nuke warhead before reaching the target so when i launch at enemy base the missile fly in the air and when reach enemy base it explode in the air and fire 3 warheads one after the other by 3 seconds
please help me make this i spent many many hours trying to figure out how
Sponsor
Zatsupachi
9 years ago
Can I clarify?

Do you want THREE NUCLEAR MISSILES to launch?
Or...
Do you want ONE CLUSTER MISSILE that splits into THREE NUKES?
"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!
kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
i want one nuke missile to split in to 3 nuke warheads
Zatsupachi
9 years ago
I'll try my best to break it down for you.

1)Make the weapon for the main warhead.



;------------------------------------------------------------------------------
Weapon MultiWarheadNukeWeapon
  PrimaryDamage = 0               ; not used for this weapon (it's "special")            
  PrimaryDamageRadius = 0         ; not used for this weapon (it's "special")     
  AttackRange = 99999             ; not used for this weapon (it's "special")
  DamageType = RADIATION          ; not used for this weapon (it's "special")
  DeathType = NORMAL
  WeaponSpeed = 99999             ; not used for this weapon (it's "special")
  ProjectileObject = MultiWarheadNukeMissile
  ProjectileExhaust = NeutronMissileExhaust
  FireFX = WeaponFX_NeutronMissile
  ProjectileDetonationFX = None   ; not used for this weapon (it's "special")
  RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
  DelayBetweenShots = 0           ; not used for this weapon (it's "special")
  ClipSize = 1                    ; not used for this weapon (it's "special")
  ClipReloadTime = 0              ; not used for this weapon (it's "special")
  AutoReloadsClip = No            ; not used for this weapon (it's "special")
End


2)Make the weapon for the Sub-Warheads



;------------------------------------------------------------------------------
Weapon SmallNukeWeapon
  PrimaryDamage           = 3000.0            
  PrimaryDamageRadius     = 300.0      
  AttackRange             = 600.0
  ScatterRadius           = 110 ;You can reduce this if you want it to be more clumped up
  DamageType              = EXPLOSION
  DeathType               = EXPLODED
  WeaponSpeed             = 99999
  ProjectileObject        = SmallNukeBomb
  FireFX                  = WeaponFX_NukeCannonMuzzleFlash
  ProjectileDetonationFX = FX_Nuke
  ProjectileDetonationOCL = OCL_NukeRadiationField
  RadiusDamageAffects     = ALLIES ENEMIES NEUTRALS NOT_SIMILAR
  ClipSize                = 1                        ; how many shots in a Clip (0 == infinite)
  ClipReloadTime          = 99999              ; how long to reload a Clip, msec
  AutoReloadsClip         = RETURN_TO_BASE                 ; must return to base to reload this weapon
  ShowsAmmoPips           = 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


3)Make the weapon objects



;------------------------------------------------------------------------------
Object MultiWarheadNukeMissile

  ; *** ART Parameters ***
  Draw               = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes
    ConditionState   = NONE
      Model          = NBNRocket
    End
    ConditionState   = DAMAGED REALLYDAMAGED RUBBLE
      Model          = NONE
    End
    
  End

  ; ***DESIGN parameters ***
  DisplayName        = OBJECT:NeutronMissile
  KindOf             = UNATTACKABLE
  EditorSorting      = SYSTEM
  VisionRange = 300.0  
  ShroudClearingRange = 0
  TransportSlotCount = 10
  ArmorSet
    Conditions       = None
    Armor            = ProjectileArmor
    DamageFX         = None
  End

  ; *** AUDIO Parameters ***
  ; SoundFallingFromPlane = DaisyCutterWeapon
    
  ; *** ENGINEERING Parameters ***
  Body = ActiveBody ModuleTag_02
    MaxHealth        = 99999999.0
    InitialHealth    = 99999999.0
  End

  Behavior = NeutronMissileUpdate ModuleTag_03
    DistanceToTravelBeforeTurning = 300       ; goes straight up a long ways first
    MaxTurnRate = 7200                        ; huge, since it turns off-camera
    ForwardDamping = 0.1
    RelativeSpeed = 2.0
    LaunchFX = FX_NeutronMissileLaunch
    IgnitionFX = FX_NeutronMissileIgnition
    TargetFromDirectlyAbove = 500      ; aim for an intermed spot directly above the target, so we come straight down onto it
    SpecialAccelFactor = 1
    SpecialSpeedTime = 1500
    SpecialSpeedHeight = 160
    SpecialJitterDistance = 0.4
    DeliveryDecalRadius = 210
    DeliveryDecal
      Texture           = SCCNuclearMissile_China
      Style             = SHADOW_ALPHA_DECAL
      OpacityMin        = 25%
      OpacityMax        = 50%
      OpacityThrobTime  = 500
      Color             = R:255 G:0 B:0 A:255 
      OnlyVisibleToOwningPlayer = Yes
    End
  End

  Behavior = HeightDieUpdate ModuleTag_04
    TargetHeight        = 80.0 ;airburst
    TargetHeightIncludesStructures = No
    OnlyWhenMovingDown  = Yes
    SnapToGroundOnDeath = Yes
    InitialDelay                    = 1000 ; Can't explode in the first second so we don't explode on the pad
  End

  Behavior = SpecialPowerCompletionDie ModuleTag_05
    SpecialPowerTemplate = SuperweaponMultiWarheadNuke
  End

 ;------You can declare these repeatedly for more nukes!----------
 ;------Just make sure to give them unique ModuleTags   ----------
  Behavior = FireWeaponWhenDeadBehavior ModuleTag_10
    DeathWeapon   = SmallNukeWeapon
    StartsActive  = Yes                      
  End
  Behavior = FireWeaponWhenDeadBehavior ModuleTag_102
    DeathWeapon   = SmallNukeWeapon
    StartsActive  = Yes                      
  End
  Behavior = FireWeaponWhenDeadBehavior ModuleTag_103
    DeathWeapon   = SmallNukeWeapon
    StartsActive  = Yes                      
  End

  Geometry = CYLINDER
  GeometryIsSmall = Yes
  GeometryMajorRadius = 7.0
  GeometryHeight = 60.0

End

;-----------------------------------------------------------------------
Object SmallNukeBomb

  ; *** ART Parameters ***
  Draw = W3DModelDraw ModuleTag_01
    ConditionState = NONE
      Model = NBNRocket
      ParticleSysBone = NONE NeutronMissileExhaust
    End
  End

  ; ***DESIGN parameters ***
  Side = China
  EditorSorting     = SYSTEM
  ArmorSet
    Conditions      = None
    Armor           = ProjectileArmor
    DamageFX        = None
  End
  VisionRange       = 0.0  

  ; *** AUDIO Parameters ***

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

  Behavior              = PhysicsBehavior ModuleTag_03
    Mass                = 75.0
    AerodynamicFriction = 2     ; this is now friction-per-sec
    ForwardFriction     = 2     ; this is now friction-per-sec
    CenterOfMassOffset  = 2     ; Default of 0 means nothing tips as it falls.  Positive tips forward, negative tips back
  End

  ; it may seem odd to have a "bomb" with a Locomotor, especially a Thrust locomotor,
  ; but there's a good reason: the Aurora moves so freakin' fast that it's really
  ; hard to (1) find a reliable drop location, and (2) actually get it close enough to
  ; that location. So we cheat: just get fairly close, then let the "bomb" do a little (subtle)
  ; navigation on the way down. This works pretty well and actually looks much better
  ; than you might think. (srj)
  Behavior = MissileAIUpdate ModuleTag_04
    TryToFollowTarget   = No 
    FuelLifetime        = 0
    IgnitionDelay       = 0
    InitialVelocity     = 0                ; in dist/sec
    DistanceToTravelBeforeTurning = 0
    DistanceToTargetBeforeDiving  = 0
  End
  Locomotor = SET_NORMAL AuroraBombLocomotor   ; yes, that's right.



  Scale = 0.75
  Geometry = Sphere
  GeometryIsSmall = Yes
  GeometryMajorRadius = 1.0

End


4)Now, go back to WeaponObject 'MultiWarheadNukeMissile' you'll see that it has SpecialPowerTemplate 'SuperweaponMultiWarheadNuke'.
Go make that.



;-----------------------------------------------------------------------------
SpecialPower SuperweaponMultiWarheadNuke
  Enum                    = SPECIAL_NEUTRON_MISSILE
  ReloadTime              = 600000   ; in milliseconds.
  InitiateAtLocationSound = AirRaidSiren  ; plays at target
  PublicTimer             = Yes
  ViewObjectDuration      = 40000
  ViewObjectRange         = 250
  RadiusCursorRadius      = 210
  ShortcutPower           = Yes
  AcademyClassify     = ACT_SUPERPOWER
End


5)Go find a ChinaNuclearMissileLauncher object. Or make a copy of it.
Find this module and replace it the SpecialPower.



  Behavior    = OCLSpecialPower ModuleTag_07
    SpecialPowerTemplate = SuperweaponMultiWarheadNuke
    OCL                  = SUPERWEAPON_MultiWarheadNuke
  End


6)Finally, make the OCL.



ObjectCreationList SUPERWEAPON_MultiWarheadNuke
  FireWeapon
    Weapon = MultiWarheadNukeWeapon
  End
End

"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!
AdrianeMapMaker
9 years ago
is This Codes is Tested ??

"I will Copy All Them Now"
thought this will be Extremely Fun
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage




kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
you da man thanks a heap i testing now
AdrianeMapMaker
9 years ago
It worked ?? if is Other Faction will be **packed Up** 😁 😁

Gonna need some Counter Fire

UserPostedImage
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage




kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
😞 it not work very sad

copied everything like you say but the weapon dont fire when put the crouser on target and click the marker dont disappear and a small red cross on it
AdrianeMapMaker
9 years ago
tsk We should ask How to Fix this

Look Something in the INI is wrong
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage




kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
im not trying to launch it from the nuck missile silo building i have made a model like topol launcher and trying to implement this code on it but sadly no luck

not text i copied directly to INIs
AdrianeMapMaker
9 years ago
Better to Ask Zatsupachi

... And i will Test this code in mine Tomorrow Thought this will work

Better luck Next Time Some Ini's Dont work easily ,This is very badly when we Modded it but it Doesnt Work 😞 😞 😞
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage




kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
he offline 😞
Zatsupachi
9 years ago
Can you show me the code?
Sorry, this code wasn't tested. I will be replicating it now. I'll just provide the thing when I'm done.
"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!
kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
Zatsupachi
9 years ago
So okay.
I've tested it and yeah I was missing certain things.

I missed the fact we created a new SpecialPower, it has to have a unique button.
So I provided the button and a new commandset for the building.

I also changed up certain things to make it look slightly nicer.

So... Here.

https://drive.google.com/open?id=0B3ms6bA5tuiuY1VWOWJGSnUwU1U 

You'll have to place them in the appropriate ini files.

[EDIT]
Video Demo:


If you're wondering my nuke is different it's because I changed up the graphics for all nukes in my mod.
"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!
kores
  • kores
  • 50.25% (Neutral)
  • Private Topic Starter
9 years ago
man you are awesome taaaankssss
AdrianeMapMaker
9 years ago
Did It work??????????😀 😀


UserPostedImage
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage




Zatsupachi
9 years ago
You can refer to the video or download the code to see it in action.
"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!
zero hour mad map maker
9 years ago
Could you also put the coding inside of a map.ini file? Or would that not work xD
Ready for Anything! --- C&C Labs Staff , Maps Staff , Moderator
Zatsupachi
9 years ago
You do not have to use a unique building to launch it. You just change the OCL of it under OCLSpecialPower.

Not entirely sure if you can have unique OCLs in a map.ini

Not entirely sure if you can create new weapons in map.ini

Not entirely sure if you can create new objects in map.ini
"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!