Jump to content


Photo

Code Help -More Damage


  • Please log in to reply
1 reply to this topic

#1 The_Morgul_Lord

The_Morgul_Lord
  • Members
  • 21 posts

Posted 29 June 2010 - 09:04 PM

I am trying to change the damage that an arrow does. All i did was replace all of the "Damage = X" to "Damage = 99999999." just so if the archer killed everything in one shot, then I know it worked. Nothing happened. Please tell me if I did it the wrong way, or if the code is just wrong. Thanks.

FYI: I am only changing it for when there is ONE unit on the field, which is why I have nothing for the Mirkwood Archer horde.

CODE
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;Mirkwood Archer
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Object ElvenMirkwoodArcher

CommandPoints = 0


ReplaceModule ModuleTag_02
Body = ActiveBody ModuleTag_ElvenMirkwoodArcher
MaxHealth = 200000
End
End


LocomotorSet
Locomotor = HumanLocomotor
Condition = SET_NORMAL
Speed = 200

End
End


;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;WEAPONS
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Weapon MirkwoodArcherSilverthornBowWarhead
RadiusDamageAffects = ENEMIES
HitStoredTarget = Yes ; Always hits initial target.

; Damage to structures is the same as before
DamageNugget
;SpecialObjectFilter = NONE +STRUCTURE
Damage = 99999999
Radius = 0.0
DelayTime = 0
DamageType = PIERCE
DamageFXType = GOOD_ARROW_PIERCE
DeathType = EXPLODED
End

; Damage to everything else is increased
DamageNugget
;SpecialObjectFilter = ALL -STRUCTURE
Damage = 99999999
Radius = 0.0
DelayTime = 0
DamageType = MAGIC
DamageFXType = MAGIC
DeathType = EXPLODED
DamageScalar = 25% NONE +STRUCTURE +SUMMONED ; ;
End

; ..and meta impact damage on infantry
MetaImpactNugget
SpecialObjectFilter = NONE +INFANTRY
ShockWaveAmount = 50.0
ShockWaveRadius = 10.0
ShockWaveArc = 90 ; in degrees to each side 180 is full circle
ShockWaveTaperOff = 1.0
ShockWaveSpeed = 0.0
ShockWaveZMult = 1.0
OnlyWhenJustDied = Yes
End

End

Weapon ElvenMirkwoodArcherBowWarhead
ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS
RadiusDamageAffects = ENEMIES NEUTRALS NOT_SIMILAR ;ALLIES
HitStoredTarget = Yes ; Always hits initial target.
DamageNugget ; A basic Nugget that just does damage
Damage = 99999999
Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
DelayTime = 0
DamageType = PIERCE
DamageFXType = GOOD_ARROW_PIERCE
DeathType = NORMAL
End
End

Weapon ElvenMirkwoodArcherBowBombardWarhead
ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS
RadiusDamageAffects = ENEMIES NEUTRALS NOT_SIMILAR ;ALLIES
HitStoredTarget = No
DamageNugget ; A basic Nugget that just does damage
Damage = 99999999
Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
DelayTime = 0
DamageType = PIERCE
DamageFXType = GOOD_ARROW_PIERCE
DeathType = NORMAL
End
End

Weapon MirkwoodArcherSilverthornBowWarheadStructural
RadiusDamageAffects = ENEMIES
HitStoredTarget = Yes ; Always hits initial target.

DamageNugget ; A basic Nugget that just does damage
Damage = 99999999
Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
DelayTime = 0
DamageType = STRUCTURAL ; Moving all structure-based weapons over to Structural Damage for balance reasons - GB
DamageFXType = GOOD_ARROW_PIERCE
DeathType = NORMAL
DamageScalar = 0% NONE +EntMoot +ElvenEntMoot
End



; Damage to everything else is increased
DamageNugget
Damage = 99999999
Radius = 0.0
DelayTime = 0
DamageType = MAGIC
DamageFXType = MAGIC
DeathType = EXPLODED
DamageScalar = 25% NONE +STRUCTURE +SUMMONED ; ;
End


; ..and meta impact damage on infantry
MetaImpactNugget
SpecialObjectFilter = NONE +INFANTRY
ShockWaveAmount = 50.0
ShockWaveRadius = 10.0
ShockWaveArc = 90 ; in degrees to each side 180 is full circle
ShockWaveTaperOff = 1.0
ShockWaveSpeed = 0.0
ShockWaveZMult = 1.0
OnlyWhenJustDied = Yes
End

End

Weapon MirkwoodArcherSilverthornBowBombardWarhead
RadiusDamageAffects = ENEMIES
HitStoredTarget = No

; Damage to structures is the same as before
DamageNugget
;SpecialObjectFilter = NONE +STRUCTURE
Damage = 99999999
Radius = 0.0
DelayTime = 0
DamageType = PIERCE
DamageFXType = GOOD_ARROW_PIERCE
DeathType = EXPLODED
End

; Damage to everything else is increased
DamageNugget
;SpecialObjectFilter = ALL -STRUCTURE
Damage = 99999999
Radius = 0.0
DelayTime = 0
DamageType = MAGIC
DamageFXType = MAGIC
DeathType = EXPLODED
DamageScalar = 25% NONE +STRUCTURE
End

; ..and meta impact damage on infantry
MetaImpactNugget
SpecialObjectFilter = NONE +INFANTRY
ShockWaveAmount = 50.0
ShockWaveRadius = 10.0
ShockWaveArc = 90 ; in degrees to each side 180 is full circle
ShockWaveTaperOff = 1.0
ShockWaveSpeed = 0.0
ShockWaveZMult = 1.0
OnlyWhenJustDied = Yes
End




I later tried creating a new warhead on impact. It still failed. Here is the code for that.

CODE
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;WEAPONS
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Weapon MirkwoodArcherBow
AttackRange = 350


RangeBonusMinHeight = 10
RangeBonus = 1
RangeBonusPerFoot = 1 ; ;#MULTIPLY( ELVEN_MIRKWOOD_ARCHER_RANGE .01 )

WeaponSpeed = 321 ; dist/sec
MinWeaponSpeed = 241
MaxWeaponSpeed = 481 ; dist/sec Upper limit on scaling, when attacking past nominal "max" range
FireFX = FX_RohanArcherBowWeapon
ScaleWeaponSpeed = Yes ; Used for lob weapons, scales speed proportional to range
HitPercentage = 100 ;When this weapon is used it will hit exactly 100% of the time.
ScatterRadius = 5.0 ;When this weapon misses it can randomly miss by as much as this distance.

AcceptableAimDelta = 20 ; prevent twitchy reaiming in horde on horde
DelayBetweenShots = 0
PreAttackDelay = ELVEN_MIRKWOOD_ARCHER_BOW_PREATTACKDELAY
PreAttackRandomAmount = 200
PreAttackType = PER_POSITION
FiringDuration = 0

ClipSize = 1
AutoReloadsClip = Yes
AutoReloadWhenIdle = 1
ClipReloadTime = Min:ELVEN_MIRKWOOD_ARCHER_BOW_RELOADTIME_MIN Max:ELVEN_MIRKWOOD_ARCHER_BOW_RELOADTIME_MAX
ContinuousFireOne = 0
ContinuousFireCoast = ELVEN_MIRKWOOD_ARCHER_BOW_RELOADTIME_MAX

AntiAirborneVehicle = Yes
AntiAirborneMonster = Yes
HitPassengerPercentage = 20%
CanBeDodged = No ; Will check for a DodgePercent on the target to have a second chance at failing HitPercent

ProjectileNugget ; Default arrow
ProjectileTemplateName = GoodFactionArrow
WarheadTemplateName = ElvenMirkwoodArcherBowWarhead
End
End



Weapon ElvenMirkwoodArcherBowWarhead
ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS
RadiusDamageAffects = ENEMIES NEUTRALS NOT_SIMILAR ;ALLIES
HitStoredTarget = Yes ; Always hits initial target.
DamageNugget ; A basic Nugget that just does damage
Damage = 10000
Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
DelayTime = 0
DamageType = HERO
DamageFXType = GOOD_ARROW_PIERCE
DeathType = NORMAL
End
End



Weapon ElvenMirkwoodArcherBowBombardWarhead
ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS
RadiusDamageAffects = ENEMIES NEUTRALS NOT_SIMILAR ;ALLIES
HitStoredTarget = No
DamageNugget ; A basic Nugget that just does damage
Damage = 10000
Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
DelayTime = 0
DamageType = HERO
DamageFXType = GOOD_ARROW_PIERCE
DeathType = NORMAL
End
End


Weapon SuperBowWarhead
ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS
RadiusDamageAffects = ENEMIES NEUTRALS NOT_SIMILAR ;ALLIES
HitStoredTarget = Yes ; Always hits initial target.
DamageNugget ; A basic Nugget that just does damage
Damage = 10000
Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
DelayTime = 0
DamageType = HERO
DamageFXType = GOOD_ARROW_PIERCE
DeathType = NORMAL
End
End

Object GoodFactionArrow

AddModule ModuleTag_SuperBowWarheadCreate
Behavior = FireWeaponWhenDeadBehavior ModuleTag_DIELIKETHIS
StartsActive = Yes
DeathWeapon = SuperBowWarhead
End
End
End



Is that the right spot for the AddModule? Would it be on the GoodFactionArrow or is it supposed to go elsewhere?

Edited by The_Morgul_Lord, 30 June 2010 - 12:32 AM.


#2 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 14 August 2010 - 12:18 PM

Your problem might be with making it override properly. I'm not very good at being able to work out in which cases you need to override something and when to just change values but you may need to try a different approach here.
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users