Jump to content


The_Morgul_Lord

Member Since 22 Jun 2010
Offline Last Active Jul 08 2010 02:38 AM

Topics I've Started

How to Add Power to Normal Units

04 July 2010 - 12:27 AM

Is it possible to add a special attack (in this case wounding arrow) to a normal unit (in this case a Mirkwood Archer)?

I am just gonna do this for the individual unit, not a whole horde.

Also, when making a map in worlbuilder, if a single unit is added, their commandset doesn't... umm... function.
For example, they have no option for ugrades or abilities, and the stance button it there, but it is unable to be changed. Any idea on how to fix this?

I have tried using scripting in worldbuilder, but failed. Is there a (relatively easy i hope) way to accomplish this in coding?

How to add special abilites to a non-hero unit

03 July 2010 - 02:09 AM

Is it possible to add a hero's special attack to a normal unit? If so, how would I go about doing it? For example, adding some sort of special arrow attack to an archer.


Also, in world builder, if you make a map, and create a single unit, they do not have their command set (i think that's what its called). For example, a single ranger does not have its bombard ability, or any upgrades. You can't even change its stance. how can I avoid this, but still have one unit?


And I am only planning on adding it to a single unit, not a whole horde, in case that information was necessary...

Code Help -More Damage

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?

Help Wanted

27 June 2010 - 01:30 AM

I know that many people feel that new users should just read tutorials and learn coding on their own. I agree that for many people that can work, and it has helped me a little. I am brand new to coding, and I just wish that there was an example of what i wanted to do out there, so that I can take step in the right direction. What I want to do is have objects (new units) that look like pre-made ones but behave more like heroes. For example a mirkwood archer that can shoot dual shots or switch weapons, or a rohirrim that can throw a spear. Is there anyone out there who would like to aid me in making this?

What I am asking for is for someone to make the code for say, a mirkwood archer to shoot the thorn of vengeance (or whatever it is that thranduil has as his level 10 attack) by adding a command button. Also, I would like the archer to be named "SuperArcher" and have that name appear when selected. And if possible, made to pretty much be a simple hero that just looks like a mirkwood archer.

My hope is that after viewing the code I can move on to make "SuperRohirrim" and others to use in my maps. I have been working day and night on trying to accomplish this and failed at every turn. Would anyone help me by making this code, so that I can study it and apply its concepts so I can make all the other units myself? And if you can help, could u tell me where to add all the files? Thank you so much if you agree to help. :)

And please, don't post any comments here saying "don't be lazy, do it yourself" or anything of the sort. I know some may think I'm lazy, but by actually seeing what I want done I can apply it to all the things I want to do. Reading tutorials about miscellaneous topics provides little help for me.

Credit will be given if wished.

What is wrong with this code?

26 June 2010 - 04:55 PM

I am trying to increase the attack speed and damage done by mirkwood archers. Here is my code:

CODE
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;Mirkwood Archers
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Object ElvenMirkwoodArcher

CommandPoints = 100

WeaponSet
Conditions = None
Weapon = PRIMARY SuperBow
Weapon = TERTIARY SuperBowBombard
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
AutoChooseSources = TERTIARY FROM_PLAYER FROM_SCRIPT ; Not AI.
End
End


Object ElvenMirkwoodArcherHorde

CommandPoints = 1000

WeaponSet
Conditions = None
Weapon = PRIMARY SuperMissileHordeRangefinder
Weapon = TERTIARY SuperMissileHordeRangefinderBombard
AutoChooseSources = TERTIARY FROM_PLAYER FROM_SCRIPT ; Not AI.
End
End


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

Weapon SuperBow
AttackRange = 400


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

WeaponSpeed = 350 ; dist/sec
MinWeaponSpeed = 250
MaxWeaponSpeed = 490 ; 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 50% of the time.
ScatterRadius = 16.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 = 450
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 = Yes ; Will check for a DodgePercent on the target to have a second chance at failing HitPercent

ProjectileNugget ; Default arrow
ProjectileTemplateName = GoodFactionArrow
WarheadTemplateName = SuperBowWarhead
ForbiddenUpgradeNames = Upgrade_RohanFireArrows
End
ProjectileNugget ; Fire arrow avialble through fire upgrade
ProjectileTemplateName = GoodFactionFireArrow
WarheadTemplateName = RohanArcherBowFireWarhead
RequiredUpgradeNames = Upgrade_RohanFireArrows
End
End

Weapon SuperBowBombard
AttackRange = 300
MinimumAttackRange = #SUBTRACT( ELVEN_MIRKWOOD_ARCHER_BOMBARD_MINRANGE 75 )

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

WeaponSpeed = 350 ; dist/sec
MinWeaponSpeed = 250
MaxWeaponSpeed = 490 ; 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 = 0 ;Always scatter
ScatterRadius = ARCHER_BOMBARD_SCATTER_RADIUS ;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 = 450
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 = Yes ; Will check for a DodgePercent on the target to have a second chance at failing HitPercent

NoVictimNeeded = Yes
BombardType = Yes

ProjectileNugget ; Default arrow
ProjectileTemplateName = GoodFactionArrowBombard
WarheadTemplateName = SuperBowBombardWarhead
ForbiddenUpgradeNames = Upgrade_RohanFireArrows
End
ProjectileNugget ; Fire arrow avialble through fire upgrade
ProjectileTemplateName = GoodFactionFireArrowBombard
WarheadTemplateName = RohanArcherBowBombardFireWarhead
RequiredUpgradeNames = Upgrade_RohanFireArrows
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 = 450
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 SuperBowBombardWarhead
ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS
RadiusDamageAffects = ENEMIES NEUTRALS NOT_SIMILAR ;ALLIES
HitStoredTarget = No
DamageNugget ; A basic Nugget that just does damage
Damage = 450
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 SuperMissileHordeRangefinder
AttackRange = 400

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

DelayBetweenShots = 1000
LeechRangeWeapon = Yes
AcceptableAimDelta = 45
AntiAirborneVehicle = Yes
AntiAirborneMonster = Yes
CanFireWhileMoving = Yes ; When aboard a ship.
FinishAttackOnceStarted = No
HordeAttackNugget
End
End

Weapon SuperMissileHordeRangefinderBombard
AttackRange = 300
MinimumAttackRange = ELVEN_MIRKWOOD_ARCHER_BOMBARD_MINRANGE

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

DelayBetweenShots = 1000
LeechRangeWeapon = Yes
AcceptableAimDelta = 45
AntiAirborneVehicle = Yes
AntiAirborneMonster = Yes
CanFireWhileMoving = Yes ; When aboard a ship.
FinishAttackOnceStarted = No
NoVictimNeeded = Yes
BombardType = Yes
ScatterRadius = ARCHER_BOMBARD_SCATTER_RADIUS ; Only used for cursor radius

HordeAttackNugget
End
End



The problem is that when I try to click on enemies to attack them, the cursor turns into the red circle with a slash, and my archers cant attack. They cant attack anything. Also, when I have this added to my code in the beginning, various errors pop up.

CODE
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;Mirkwood Archers
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Object ElvenMirkwoodArcher

CommandPoints = 100

WeaponSet
Conditions = None
Weapon = PRIMARY SuperBow
Weapon = TERTIARY SuperBowBombard
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
AutoChooseSources = TERTIARY FROM_PLAYER FROM_SCRIPT ; Not AI.
End
End

ReplaceModule ModuleTag_02
Body = ActiveBody ModuleTag_ElvenMirkwoodArcher
MaxHealth = 20000
End
End


LocomotorSet
Locomotor = HumanLocomotor
Condition = SET_NORMAL
Speed = 200

End
End


Object ElvenMirkwoodArcherHorde

CommandPoints = 1000

WeaponSet
Conditions = None
Weapon = PRIMARY SuperMissileHordeRangefinder
Weapon = TERTIARY SuperMissileHordeRangefinderBombard
AutoChooseSources = TERTIARY FROM_PLAYER FROM_SCRIPT ; Not AI.
End
End

LocomotorSet
Locomotor = HumanLocomotor
Condition = SET_NORMAL
Speed = 195
End
End


It seems like it all depends on the order. If LocomotorSet comes first, then it will say unknown "WeaponSet", and if I change the ReplaceModule to first, something else will come up unknown. It all worked until I added WeaponSet.