Private Joined: 4/1/2018(UTC) Posts: 9
Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
hi,is it possible to make a unit fire a projectile which splits into a couple smaller submunitions midair that damage ground troops in a certain area? like the chinese clusterbomb from a cargo plane but instead of releasing landmines it should simply deal explosive damage upon impact right away
what i want to do later is to assign this weapon to an artillery or air unit so it attacks opponents with its cluster bombs that cover a large area but do not deal too much damage
thanks!
|
|
|
|
Major Joined: 3/27/2015(UTC) Posts: 490
Thanks: 5 times Was thanked: 213 time(s) in 155 post(s)
|
First we need to make the projectile:
Code:
;------------------------------------------------------------------------------
Object ASpt_NukeCannonShell
; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = AVTankShel
ParticleSysBone = NONE ArtilleryBarrageTrail
ParticleSysBone = NONE ArtilleryBarrageTrailRing
End
End
; ***DESIGN parameters ***
DisplayName = OBJECT:TankShell
EditorSorting = SYSTEM
ArmorSet
Armor = ProjectileArmor
End
VisionRange = 0.0
; *** AUDIO Parameters ***
SoundAmbient = NukeCannonIncomingWhistle
; *** ENGINEERING Parameters ***
KindOf = PROJECTILE
Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End
Behavior = DestroyDie ModuleTag_03
;nothing
End
Behavior = DumbProjectileBehavior ModuleTag_04
; To tweak a Bezier path, please see GS
FirstHeight = 50 ; Height of Bezier control points above highest intervening terrain
SecondHeight = 150
FirstPercentIndent = 30% ; Percentage of shot distance control points are placed
SecondPercentIndent = 70%
FlightPathAdjustDistPerSecond = 0 ; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag.
End
Behavior = PhysicsBehavior ModuleTag_05
Mass = 0.01 ; we can't have a zero mass, but we want it pretty tiny...
End
;--- This part will make it detonate after a set time--------
;--- I calculated these values precisely from range --------
;--- If this weapon had a different range change the --------
;--- values accordingly. ~precision_bomber --------
;--- Alternatively you can use HeightDieUpdate --------
Behavior = LifetimeUpdate ModuleTag_06
MinLifetime = 1500
MaxLifetime = 1800
End
;----------- This will create random scatter-----------------
;--Alternatively, you can use 1 FireWeaponWhenDeadBehavior---
;--Just make sure all the projectiles are shot immediately---
;--You can use code from Scud Storm to make a fixed spread---
Behavior = FireWeaponWhenDeadBehavior ModuleTag_10
DeathWeapon = ASpt_ScatterShellAestheticWeapon
StartsActive = Yes
End
Behavior = FireWeaponWhenDeadBehavior ModuleTag_102
DeathWeapon = ASpt_ScatterShellAestheticWeapon
StartsActive = Yes
End
Behavior = FireWeaponWhenDeadBehavior ModuleTag_103
DeathWeapon = ASpt_ScatterShellAestheticWeapon
StartsActive = Yes
End
Behavior = FireWeaponWhenDeadBehavior ModuleTag_104
DeathWeapon = ASpt_ScatterShellAestheticWeapon
StartsActive = Yes
End
Behavior = FireWeaponWhenDeadBehavior ModuleTag_105
DeathWeapon = ASpt_ScatterShellAestheticWeapon
StartsActive = Yes
End
Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 1.0
End
Second, the weapon object for the submunitions... You can though indeed just use regular shells, just make sure you swap it out on the weapon code for submunitions.
Code:
Object ASpt_MiniShells
; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = AVTankShel
ParticleSysBone = NONE CzAM_MiniShellTrail ;Do not use this particle system, this one is unique to my mod.
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
Then, The Weapon that goes on to the unit:
Code:
;------------------------------------------------------------------------------
Weapon ASpt_ShellCannonWeapon ;wouldn't be used till later part of modding.
PrimaryDamage = 400.0
PrimaryDamageRadius = 50.0
SecondaryDamage = 20.0
SecondaryDamageRadius = 60.0
ScatterRadiusVsInfantry = 30.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
AttackRange = 350.0
MinimumAttackRange = 150.0
DamageType = EXPLOSION
DeathType = EXPLODED
WeaponSpeed = 200 ; dist/sec
ProjectileObject = ASpt_NukeCannonShell
;FireFX = WeaponFX_NukeCannonMuzzleFlash
FireSound = NukeCannonWeapon
;VeterancyFireFX = HEROIC WeaponFX_HeroicNukeCannonMuzzleFlash
;ProjectileDetonationFX = WeaponFX_NukeCannon
;ProjectileDetonationOCL = OCL_RadiationFieldMedium
RadiusDamageAffects = SUICIDE SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR
DelayBetweenShots = 10000 ; time between shots, msec
ClipSize = 0 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 0 ; how long to reload a Clip, msec
End
Then finally, the submunitions weapon
Code:
;------------------------------------------------------------------------------
Weapon ASpt_ScatterShellAestheticWeapon
PrimaryDamage = 120.0
PrimaryDamageRadius = 30.0
AttackRange = 300.0
ScatterRadius = 80
DamageType = EXPLOSION
DeathType = EXPLODED
WeaponSpeed = 99999
ProjectileObject = ASpt_MiniShells
FireFX = WeaponFX_NukeCannonMuzzleFlash
VeterancyFireFX = HEROIC WeaponFX_HeroicNukeCannonMuzzleFlash
ProjectileDetonationFX = WeaponFX_NukeCannon
ProjectileDetonationOCL = OCL_RadiationFieldMedium
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
|
|
1 user thanked Zatsupachi for this useful post.
|
|
|
Private Joined: 4/1/2018(UTC) Posts: 9
Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
whoa, this worked perfectly THANK YOU! i have adjusted my code a little and now my inferno cannon spits cluster ammo that destroys pretty much any tank (was a little weak with the flame attack before)
|
|
|
|
Private Joined: 4/1/2018(UTC) Posts: 9
Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
me again, what i noticed is my unit with the cluster weapon (in this case, inferno cannon) doesnt gain veterancy even after destroying several units and important structures. could this be fixed?
|
|
|
|
Major Joined: 3/27/2015(UTC) Posts: 490
Thanks: 5 times Was thanked: 213 time(s) in 155 post(s)
|
Well, that's the side effect of this. Mainly because it's not killing with the object's weapon, but the weapon object's weapon, if that makes sense. You can try HeightDieUpdate instead of LifetimeUpdate Replace the ModuleTag with this: Code:
Behavior = HeightDieUpdate ModuleTag_06
TargetHeight = 1 ;somewhere maybe slightly above ground like 50? or 25?
TargetHeightIncludesStructures = Yes ;detonates on top of buildings.
OnlyWhenMovingDown = Yes ;Only when the projectile is moving ground
End
|
|
|
|
|
Private Joined: 4/1/2018(UTC) Posts: 9
Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Zatsupachi Well, that's the side effect of this. Mainly because it's not killing with the object's weapon, but the weapon object's weapon, if that makes sense. You can try HeightDieUpdate instead of LifetimeUpdate Replace the ModuleTag with this: Code:
Behavior = HeightDieUpdate ModuleTag_06
TargetHeight = 1 ;somewhere maybe slightly above ground like 50? or 25?
TargetHeightIncludesStructures = Yes ;detonates on top of buildings.
OnlyWhenMovingDown = Yes ;Only when the projectile is moving ground
End
thanks but whenever i enter a value around 50+ for TargetHeight my Inferno Cannon commits suicide with its own cluster rounds.. which i dont understand as i was under the impression the round will explode only when moving towards ground (why is that last code line not working anyway) the veterancy thing is not that big of a deal. i was just wondering whether i did something wrong on my part. the weapon is strong enough even without heroic unit status
|
|
|
|
Major Joined: 9/5/2014(UTC) Posts: 144 Location: KL Thanks: 14 times Was thanked: 15 time(s) in 13 post(s)
|
HeightDieUpdate TargetHeight = [real number] TargetHeightIncludesStructures = [Yes/No] OnlyWhenMovingDown = [Yes/No] InitialDelay = [integer, milliseconds] SnapToGroundOnDeath = [Yes/No] DestroyAttachedParticlesAtHeight = [real number] End
I think you need InitialDelay, to prevent the weapon from suiciding.
Superweapons have delay times also, to animate with the building doors. And theres the comment in the nuclear missile building, that the delay prevents it exploding right on launch.
|
1 user thanked zzc for this useful post.
|
|
|
Private Joined: 4/1/2018(UTC) Posts: 9
Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: zzc I think you need InitialDelay, to prevent the weapon from suiciding. thanks a ton! that was indeed it. now the cluster bombs will detonate at a fixed height which works much better at different ranges compared to the time fuze it didn't fix the veterancy issue though, but anyway
|
|
|
|
Major Joined: 9/5/2014(UTC) Posts: 144 Location: KL Thanks: 14 times Was thanked: 15 time(s) in 13 post(s)
|
The veterancy thing is probaly caused by the weapon already being dead before doing damage, as damage is being done by the subweapon.
But you could still gain xp by running over infantry.... give it a really fast locomotor ;)
|
|
|
|
General Joined: 8/2/2008(UTC) Posts: 1,779 Thanks: 26 times Was thanked: 475 time(s) in 331 post(s)
|
Originally Posted by: Ace40k thanks a ton! that was indeed it. now the cluster bombs will detonate at a fixed height which works much better at different ranges compared to the time fuze
it didn't fix the veterancy issue though, but anyway This is a problem for the inferno cannon too. Whilst they do gain EXP for killing units with their shells, they often kill units with the fire instead. And the fire doesn't count. :/ |
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.
I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me. |
|
|
|
Users browsing this topic |
Guest
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.