Help - Search - Members - Calendar
Full Version: Damage radius
SWR Productions Forum > Game Modding and Development > Generals/Zerohour Modding
Oliver
I changed the topic since i resolved the other one and since there were no replies (i think there should't be any problem, if there is, i'm sorry)

How do i do to alter the damage according to the positioning to an explosion radius.. Like the more close to the center, the more dmg it deals?
Chappi55
QUOTE (Oliver @ 24 Sep 2013, 17:20) *
I changed the topic since i resolved the other one and since there were no replies (i think there should't be any problem, if there is, i'm sorry)

How do i do to alter the damage according to the positioning to an explosion radius.. Like the more close to the center, the more dmg it deals?


There are two ways to do this.
You can simply use a PrimaryDamageRadius for the big damage inside a small radius, and then add SecondaryDamageRadius at a bigger distance.
Example - EA did the Scorpion's missile this way.
CODE
;------------------------------------------------------------------------------
Weapon ScorpionMissileWeapon
PrimaryDamage = 100.0
PrimaryDamageRadius = 5.0
SecondaryDamage = 80.0
SecondaryDamageRadius = 25.0

ScatterRadiusVsInfantry = 10.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
AttackRange = 150.0
MinimumAttackRange = 40.0
DamageType = EXPLOSION ; ignored for projectile weapons
DeathType = EXPLODED
WeaponSpeed = 600 ; ignored for projectile weapons
ProjectileObject = ScorpionMissile
ProjectileExhaust = MissileExhaust
VeterancyProjectileExhaust = HEROIC HeroicMissileExhaust
FireFX = FX_BuggyMissileIgnition
FireSound = ScorpionMissileWeapon
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 200 ; time between shots, msec
ClipSize = 1 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 15000 ; how long to reload a Clip, msec
AutoReloadsClip = Yes
ProjectileDetonationFX = WeaponFX_RocketBuggyMissileDetonation

; 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
WeaponBonus = PLAYER_UPGRADE DAMAGE 125% ; AP weapon upgrade
End

Second way is using the neutron missile logic.
This is only a part of the code, but you already know that stock nuke has got multiple blasts. This will give you more power over the gradually decreasing damage ( and it will topple tree's).
CODE
Blast1Enabled = Yes
Blast1Delay = 580 ;in milliseconds
Blast1ScorchDelay = 100 ;in milliseconds
Blast1InnerRadius = 60.0 ;objects inside this get the full damage
Blast1OuterRadius = 60.0 ;objects inside this get some of the full damage

Blast1MaxDamage = 0.0 ;damage within inner radius of blast
Blast1MinDamage = 0.0 ;always do at least this much damage to objects
Blast1ToppleSpeed = 0.5 ;higher #'s topple faster
Blast1PushForce = 10.0 ;higher #'s push more
Oliver
Yh i used the first one, the second one was already giving me problems by not doing any kind of damage... Is there any way to delay the destruction just like the neutron missile does?

WeaponObjects.ini (part of the code used for the special power)
CODE
  Behavior = FireWeaponWhenDeadBehavior ModuleTag_03
    DeathWeapon   = HydrogenBombWeapon
    StartsActive  = Yes
  End

  Behavior = NeutronMissileSlowDeathBehavior ModuleTag_04
    FXList        = FX_HydrogenBombExplosion
  End


Weapon.ini
CODE
Weapon HydrogenBombWeapon
  PrimaryDamage               = 5000.0            
  PrimaryDamageRadius         = 100.0
  SecondaryDamage             = 2000.0
  SecondaryDamageRadius       = 300.0
  AttackRange                 = 200.0
  DamageType                  = EXPLOSION        
  DeathType                   = EXPLODED
  WeaponSpeed                 = 99999.0            
  FireOCL                     = OCL_RadiationFieldLarge
  RadiusDamageAffects         = ALLIES ENEMIES NEUTRALS
  DelayBetweenShots           = 0                  ; time between shots, msec
  ClipSize                    = 1                       ; how many shots in a Clip (0 == infinite)
  ClipReloadTime              = 0              ; how long to reload a Clip, msec
  AutoReloadsClip             = No
  ShockWaveAmount             = 250.0; represents the shockwave amount. The larger the amount, the greater and more dramatic the shockwave effect    
  ShockWaveRadius             = 250.0; should be no more than the primary/secondary damage radius, whichever is larger.
  ShockWaveTaperOff           = 0.50   ; 0.33 means at the shockwave edge, the shockwave amount is 33%.
End


ObjectionCreationList.ini
CODE
ObjectCreationList SUPERWEAPON_HydrogenBomb
  DeliverPayload
    Transport               = AmericaJetB3
    StartAtPreferredHeight  = Yes
    StartAtMaxSpeed         = Yes
    MaxAttempts             = 1
    DropOffset              = X:0 Y:0 Z:-10
    Payload                 = HydrogenBomb
    DeliveryDistance = 235
    DeliveryDecalRadius = 325    
    DeliveryDecal
      Texture           = SCCNuclearMissile_China
      Style             = SHADOW_ALPHA_DECAL
      OpacityMin        = 25%
      OpacityMax        = 50%
      OpacityThrobTime  = 500
      Color             = R:0 G:0 B:255 A:255
      OnlyVisibleToOwningPlayer = Yes
    End
  End
End
Chappi55
Don't use the neutron missile death behavior only for spawning the effect.
Better do a FireFX in the weapon code and link the effect there.

To nicely delay the damage/effect check the code from DaisyCutterGas. It's an entity that's spawned when Daisy "impacts" and then it spawns the proper explosion.
CODE
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
Oliver
Damn, i can't...

Or the fx effect has wrong offsets, or the fx effect doesnt appear at all, or it deals no damage, sometimes the bomb just do nothing
Chappi55
QUOTE (Oliver @ 25 Sep 2013, 23:47) *
Damn, i can't...

Or the fx effect has wrong offsets, or the fx effect doesnt appear at all, or it deals no damage, sometimes the bomb just do nothing


Use the code I gave you above only using a single Weapon. No fx or anything.
In the weapon code add a FireOCL that spawns the entity which in turn spawns the FX to preserve the offsets.
Oliver
Behavior = SlowDeathBehavior ModuleTag_04
DestructionDelay = 1000
DestructionDelayVariance = 100
Weapon = FINAL HydrogenBombWeapon ; INITIAL HydrogenBombWeapon ; MIDPOINT HydrogenBombWeapon
End

I used all the three above, and even deleted de destructions delay... No dmg created

And how do i spawn the fx through ocl? In the codes there is only fx to create debris
Chappi55
QUOTE (Oliver @ 26 Sep 2013, 15:29) *
Behavior = SlowDeathBehavior ModuleTag_04
DestructionDelay = 1000
DestructionDelayVariance = 100
Weapon = FINAL HydrogenBombWeapon ; INITIAL HydrogenBombWeapon ; MIDPOINT HydrogenBombWeapon
End

I used all the three above, and even deleted de destructions delay... No dmg created

And how do i spawn the fx through ocl? In the codes there is only fx to create debris

Paste the entire bomb code from weaponobjects here.
Oliver
Sorry for my noobish tongue.gif

WeaponObjects.ini
CODE
Object HydrogenBomb

; *** ART Parameters ***
  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes
    DefaultConditionState
      Model = AVBomber_B
    End
  End

; ***DESIGN parameters ***
  DisplayName         = OBJECT:DaisyCutterBomb
  EditorSorting       = SYSTEM
  TransportSlotCount  = 10                ;how many "slots" we take in a transport (0 == not transportable)
  VisionRange         = 300.0  
  ShroudClearingRange = 0
  ArmorSet
    Conditions      = None
    Armor           = ProjectileArmor
    DamageFX        = None
  End

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

  Behavior = FireWeaponWhenDeadBehavior ModuleTag_03
    DeathWeapon   = HydrogenBombWeapon
    StartsActive  = Yes
  End

  Behavior = NeutronMissileSlowDeathBehavior ModuleTag_04
    FXList        = FX_HydrogenBombExplosion
  End

  Behavior = DestroyDie ModuleTag_05
   ;nothing
  End
    
  Behavior = AIUpdateInterface ModuleTag_06
  End

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

  Behavior = HeightDieUpdate ModuleTag_08
    TargetHeight = 5.0
    TargetHeightIncludesStructures = Yes
  End

  Behavior = SpecialPowerCompletionDie ModuleTag_09
    SpecialPowerTemplate = SuperweaponHydrogenBomb
  End

  Geometry = Sphere
  GeometryIsSmall = Yes
  GeometryMajorRadius = 12.0
End
n5p29
QUOTE (Oliver @ 26 Sep 2013, 22:46) *
CODE
  Behavior = NeutronMissileSlowDeathBehavior ModuleTag_04
    FXList        = FX_HydrogenBombExplosion
  End

what kind of evil coder that use this module to trigger a simple FXList? you could just use FXListDie module instead. D:
Oliver
QUOTE (n5p29 @ 26 Sep 2013, 17:44) *
what kind of evil coder that use this module to trigger a simple FXList? you could just use FXListDie module instead. D:


Evil coder? lol

I did, but the offsets were all wrong
Chappi55
QUOTE (Oliver @ 26 Sep 2013, 19:43) *
Evil coder? lol

I did, but the offsets were all wrong



Do it the way daisy cutter explodes you have everything there.
Oliver
QUOTE (Chappi55 @ 27 Sep 2013, 14:59) *
Do it the way daisy cutter explodes you have everything there.


Ok something is not right...

I used this code....
CODE
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


... to see what was the problem, if it worked with daisycutter code... the fx are ok, but it shows no damage, and i checked if it was the weapon codes... but it wasn't, they are very similar

And using the fx and weapon of the hydrogen bomb on that code of the daisycutter it works, but the fx gain wrong offsets
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.