I'm new here and I'm just doing a little modding around for myself, and I have a question concerning hordes.
What I am trying to do is creating a ChildObject of the Unit "DwarvenMenOfDale" called "DwarvenMenOfDaleInn" (very much like there's "GondorRangerInn" and "GondorRanger") and making the ChildObject "DwarvenMenOfDaleInnHorde" using the CO "DwarvenMenOfDaleInn". Well, this kind of works, but the units don't group together. They are not together in the horde, it's just 12 single Men of Dale archers.
I've basically copied the entire MenOfDaleHorde Object content into the InnHorde ChildObject, and copied the MenOfDale content to the MenOfDaleInn ChildObject, but it doesn't work at all. Of course I changed the InitialPaylod to "12 DwarvenMenOfDaleInn", and as soon as I change it back to the normal Men of Dale it works fine. I've also added the "DwarvenMenOfDaleHordeInn" and "DwarvenMenOfDaleInn" to the GOOD_ELITE constant in experiencelevels.ini, so I have selection decals, but I don't think that matters.
Anyway, here's the code for both ChildObjects the original Objects ones are untouched. The only thing I've changed are the description text for the Inn archers and "OkToChangeModelColor = No" for the single Inn archers. I've cut out the all the W3D animations, since they're exactly the same.
Oh, and this is for RotWK.
DwarvenMenOfDaleInn
ChildObject DwarvenMenOfDaleInn DwarvenMenOfDale ; *** ART Parameters *** UpgradeCameo1 = Upgrade_RohanFireArrows SelectPortrait = UPDwarven_MenofDale ButtonImage = WOR_MenofDale ;EquivalentTo = DwarvenMenOfDale Draw = W3DHordeModelDraw ModuleTag_01 OkToChangeModelColor = No ;--- ;cut animations ; End #include "..\..\..\includes\StunDrawModuleSmall.inc" ; ***DESIGN parameters *** Side = Dwarves EditorSorting = UNIT ThreatLevel = 1.0 ThingClass = HORDE_UNIT CommandPoints = 6 CommandSet = DwarvenMenOfDaleCommandSet TransportSlotCount = TRANSPORTSLOTCOUNT_UNIT WeaponSet Conditions = None Weapon = PRIMARY DwarvenArcherBow Weapon = TERTIARY DwarvenArcherBowBombard Weapon = QUINARY DwarvenMenOfDaleBlackArrows AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI AutoChooseSources = QUINARY FROM_PLAYER FROM_SCRIPT ; not from ai End WeaponSet Conditions = CLOSE_RANGE CONTESTING_BUILDING Weapon = PRIMARY DwarvenArcherBow ;Weapon = SECONDARY GondorArcherBowMelee Weapon = TERTIARY DwarvenArcherBowBombard ;OnlyAgainst = PRIMARY STRUCTURE End ArmorSet Conditions = None Armor = ArcherEliteArmor DamageFX = NormalDamageFX End ArmorSet Conditions = PLAYER_UPGRADE Armor = ArcherEliteHeavyArmor DamageFX = NormalDamageFX End BountyValue = DWARVEN_MENOFDALE_BOUNTY_VALUE VisionRange = DWARVEN_MENOFDALE_VISION_RANGE VisionSide = 35% VisionRear = 25% VisionBonusPercentPerFoot = 2.0% MaxVisionBonusPercent = 300% VisionBonusTestRadius = 200 ShroudClearingRange = SHROUD_CLEAR_STANDARD DisplayName = OBJECT:DwarvenMenOfDale CrushableLevel = 0 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles CrushRevengeWeapon = RangedInfantryCrushRevenge ; *** AUDIO Parameters ***; VoiceAttack = MenOfDaleVoiceAttack VoiceAttackCharge = MenOfDaleVoiceAttackCharge VoiceAttackMachine = MenOfDaleVoiceAttack VoiceAttackStructure = MenOfDaleVoiceAttackBuilding VoiceCreated = MenOfDaleVoiceSalute VoiceFullyCreated = MenOfDaleVoiceSalute VoiceGuard = MenOfDaleVoiceMove VoiceMove = MenOfDaleVoiceMove VoiceMoveToCamp = MenOfDaleVoiceMoveCamp VoiceMoveToHigherGround = MenOfDaleVoiceMoveHighGround VoiceMoveWhileAttacking = MenOfDaleVoiceDisengage VoicePriority = 45 VoiceRetreatToCastle = MenOfDaleVoiceRetreat VoiceSelect = MenOfDaleVoiceSelectMS VoiceSelectBattle = MenOfDaleVoiceSelectBattle MinZIncreaseForVoiceMoveToHigherGround = 45 VoiceEnterStateAttack = MenOfDaleVoiceEnterStateAttack VoiceEnterStateAttackCharge = MenOfDaleVoiceEnterStateAttackCharge VoiceEnterStateAttackMachine = MenOfDaleVoiceEnterStateAttackBuilding VoiceEnterStateAttackStructure = MenOfDaleVoiceEnterStateAttackBuilding VoiceEnterStateMove = MenOfDaleVoiceEnterStateMove VoiceEnterStateMoveToCamp = MenOfDaleVoiceEnterStateMoveCamp VoiceEnterStateMoveToHigherGround = MenOfDaleVoiceEnterStateMoveHighGround VoiceEnterStateMoveWhileAttacking = MenOfDaleVoiceEnterStateDisengage VoiceEnterStateRetreatToCastle = MenOfDaleVoiceEnterStateRetreat SoundImpact = ImpactHorse UnitSpecificSounds VoiceCreatedFromInn = MenOfDaleVoiceSalute-Inn VoiceEnterUnitElvenTransportShip = MenOfDaleVoiceMoveShip VoiceFullyCreatedFromInn = MenOfDaleVoiceSalute-Inn VoiceGarrison = MenOfDaleVoiceMoveGarrison VoiceInitiateCaptureBuilding = MenOfDaleVoiceCaptureBuilding VoiceInitiateBlackArrowsAttack = MenOfDaleVoiceAttack End #include "..\..\..\includes\StandardUnitEvaEvents.inc" CrowdResponseKey = GoodMen ClientBehavior = ModelConditionAudioLoopClientBehavior ModuleTag_foo ModelCondition = Required:EMOTION_CELEBRATING Excluded:DYING ENGAGED Sound:EmotionMenGoodCompilationVoxCheerSinglesLoop ;MOVING ATTACKING ModelCondition = Required:EMOTION_POINTING Excluded:DYING ENGAGED Sound:EmotionMenGoodCompilationBFME1and2VoxTauntSinglesLoop ;MOVING ATTACKING ModelCondition = Required:EMOTION_TAUNTING Excluded:DYING ENGAGED Sound:EmotionMenGoodCompilationBFME1and2VoxTauntSinglesLoop ;MOVING ATTACKING ModelCondition = Required:RAISING_FLAG Excluded:DYING ENGAGED Sound:EmotionMenGoodCompilationBFME1and2VoxTauntSinglesLoop End Behavior = LargeGroupAudioUpdate ModuleTag_LGAU Key = Humanoid_Male Man Man_Male Dwarf_MenOfDale End ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior MaxUpdateRangeCap = 800 AnimationSound = Sound:BodyFallGeneric1 Animation:GUArcher_SKL.GUArcher_DIEB Frames:19 AnimationSound = Sound:BodyFallGeneric1 Animation:GUArcher_SKL.GUArcher_DIED Frames:53 AnimationSound = Sound:BodyFallGeneric1 Animation:GUArcher_SKL.GUArcher_LNDA Frames:1 AnimationSound = Sound:BodyFallGenericNoArmor Animation:GUArcher_SKL.GUArcher_LNDA Frames:14 End ; *** ENGINEERING Parameters *** RadarPriority = UNIT KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE THROWN_OBJECT ARCHER GRAB_AND_DROP ATTACK_NEEDS_LINE_OF_SIGHT ;GRAB_AND_KILL Body = ActiveBody ModuleTag_02 CheerRadius = EMOTION_CHEER_RADIUS MaxHealth = DWARVEN_MENOFDALE_HEALTH ;BALANCE Archer Health MaxHealthDamaged = DWARVEN_MENOFDALE_HEALTH_DAMAGED BurningDeathBehavior = Yes BurningDeathFX = FX_InfantryBurningFlame End Behavior = AIUpdateInterface ModuleTag_03 AutoAcquireEnemiesWhenIdle = Yes ATTACK_BUILDINGS CanAttackWhileContained = Yes AILuaEventsList = RohanArcherFunctions AttackPriority = AttackPriority_Archer BurningDeathTime = BURNINGDEATH_DURATION_INFANTRY End LocomotorSet Locomotor = HumanLocomotor Condition = SET_NORMAL Speed = NORMAL_FOOT_MED_MEMBER_SPEED End LocomotorSet Locomotor = HumanWanderLocomotor Condition = SET_WANDER Speed = NORMAL_FOOT_MED_MEMBER_SPEED End LocomotorSet Locomotor = BurningDeathLocomotorInfantry Condition = SET_BURNINGDEATH Speed = BURNINGDEATH_WANDERSPEED_INFANTRY End Behavior = PhysicsBehavior ModuleTag_04 GravityMult = 1.0 End Behavior = AimWeaponBehavior AimWeaponModuleTag AimLowThreshold = -0.15 AimHighThreshold = 0.15 End Behavior = SlowDeathBehavior ModuleTag_05 DeathTypes = ALL -FADED SinkDelay = 3000 SinkRate = 0.600 ; in Dist/Sec DestructionDelay = 12000 Sound = INITIAL HumanVoiceDie End Behavior = SlowDeathBehavior ModuleTag_SlowDeathFaded DeathTypes = NONE +FADED FadeDelay = 0 FadeTime = 4000 DestructionDelay = 4000 DeathFlags = DEATH_1 End Behavior = SquishCollide ModuleTag_06 ;nothing End ; RohanArcher Behavior = HordeMemberCollide ModuleTag_HMC ;nothing End Behavior = BezierProjectileBehavior ModuleTag_07 ; Module starts asleep, and wakes up when thrown. FirstHeight = 24 ; Height of Bezier control points above highest intervening terrain SecondHeight = 24 FirstPercentIndent = 30% ; Percentage of shot distance control points are placed SecondPercentIndent = 70% TumbleRandomly = Yes CrushStyle = Yes ; I don't detonate, I just hit DieOnImpact = Yes BounceCount = 1 ; When I hit the ground, I'll arc again BounceDistance = 40 ; this far BounceFirstHeight = 24 ; Height of Bezier control points above highest intervening terrain BounceSecondHeight = 24 BounceFirstPercentIndent = 20% ; Percentage of shot distance control points are placed BounceSecondPercentIndent = 80% GroundHitFX = FX_ThrownRockGroundHit GroundBounceFX = FX_ThrownRockBounceHit End ;-------------------------------------------------------------------------- ; Upgrades. ;-------------------------------------------------------------------------- Behavior = ArmorUpgrade ModuleTag_ArmorUpgrade TriggeredBy = Upgrade_DwarvenMithrilMail ;ArmorSetFlag = PLAYER_UPGRADE End Behavior = SubObjectsUpgrade Armor_Upgrade TriggeredBy = Upgrade_DwarvenMithrilMail UpgradeTexture = RUArcher.tga 0 RUArcherHA.tga UpgradeTexture = RUArcher_M.tga 0 RUArcherHA.tga ShowSubObjects = ARMOR RecolorHouse = Yes ExcludeSubobjects = FireArowTip End ; Fire arrow upgrade Behavior = WeaponSetUpgrade ModuleTag_08 TriggeredBy = Upgrade_DwarvenFireArrows ; Turn off fire arrow visuals -- will be redone like Peasant drafting. ;CustomAnimAndDuration = AnimState:USER_4 AnimTime:0 TriggerTime:0 ;set flag forever End Behavior = SubObjectsUpgrade FireArrows_Upgrade TriggeredBy = Upgrade_DwarvenFireArrows ShowSubObjects = FireArowTip ;ArrowNock ; yes, it's a typo. ;HideSubObjects = arrow End ;-------------------------------------------------------------------------- ; Behavior = DualWeaponBehavior ModuleTag_09 ; SwitchWeaponOnCloseRangeDistance = 40 ; End Behavior = HitReactionBehavior HitReactionBehaviorModuleTag HitReactionLifeTimer1 = 1993 ; level 1 (light damage) hit reaction animations in ms HitReactionLifeTimer2 = 1993 ; level 2 (medium damage) hit reaction animations in ms HitReactionLifeTimer3 = 1993 ; level 3 (heavy damage) hit reaction animations in ms HitReactionThreshold1 = 5.0 ; level 1 (light damage) threshold trigger HitReactionThreshold2 = 25.0 ; level 2 (medium damage) threshold trigger HitReactionThreshold3 = 50.0 ; level 3 (heavy damage) threshold trigger FastHitsResetReaction = Yes ;If set -- when hits occur faster than the reaction animations, it will reset the animation. (like getting riddled with machine gun bullets) End Geometry = CYLINDER GeometryMajorRadius = 8.0 GeometryMinorRadius = 8.0 GeometryHeight = 19.2 GeometryIsSmall = Yes Shadow = SHADOW_DECAL ShadowSizeX = 19; ShadowSizeY = 19; ShadowTexture = ShadowI; End
DwarvenMenOfDaleHordeInn
ChildObject DwarvenMenOfDaleHordeInn DwarvenMenOfDaleHorde ;YeomanArcher ; This is required for garrisoned objects - please put in all objects. ButtonImage = WOR_MenofDale SelectPortrait = UPDwarven_MenofDale Draw = W3DScriptedModelDraw ModuleTag_W3DModelDraw DependencySharedModelFlags = EMOTION_ALERT EMOTION_MORALE_HIGH EMOTION_MORALE_LOW EMOTION_AFRAID EMOTION_COWER SELECTED EMOTION_TERROR DefaultModelConditionState Model = None ;InvisHrdeTmp5x2 End ModelConditionState = HORDE_EMPTY Model = None End ModelConditionState = WORLD_BUILDER Model = HordeMarkRUYeo End End Side = Dwarves EditorSorting = UNIT EmotionRange = 240 DisplayName = OBJECT:HordeRohanArcher DisplayNameStrategic = CONTROLBAR:LW_Unit_DwarvenMenOfDaleHorde DescriptionStrategic = CONTROLBAR:LW_ToolTip_DwarvenMenOfDaleHorde WeaponSet Conditions = None Weapon = PRIMARY NormalMissileHordeRangefinder Weapon = TERTIARY NormalMissileHordeRangefinderBombard AutoChooseSources = TERTIARY FROM_PLAYER FROM_SCRIPT ; Not AI. End CommandSet = DwarvenMenOfDaleHordeCommandSet ; *** AUDIO Parameters *** ; Note: Don't put voice parameters here -- they will be ignored. Voice play requests ; are always passed through to members #include "..\..\..\includes\StandardHordeEvaEvents.inc" CrushableLevel = 0 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles CrusherLevel = 0 UseCrushAttack = No ;Archer hordes cannot crush or Bombard will not work BuildCost = INN_UNIT_BUILDCOST_DWARVEN ; originally ROHAN_YEOMAN_BUILDCOST BuildTime = DWARVEN_MENOFDALE_BUILDTIME ; originally ROHAN_YEOMAN_BUILDTIME VisionRange = DWARVEN_MENOFDALE_HORDE_VISION_RANGE ; ROHAN_YEOMAN_HORDE_VISION_RANGE ShroudClearingRange = ROHAN_YEOMAN_SHROUD_RANGE VisionSide = 50% VisionRear = 25% MaxVisionBonusPercent = 300% VisionBonusTestRadius = 200 VisionBonusPercentPerFoot = 1.0% CommandPoints = 72 ; originally 60 FormationWidth = 2 ; Width it occupies in formations. Current choices are 1 or 2. FormationDepth = 1 ; Depth it occupies in formations. Current choices are 1 or 2. TransportSlotCount = TRANSPORTSLOTCOUNT_SMALL_HORDE KindOf = SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT INFANTRY HORDE ARCHER ARMY_SUMMARY LARGE_RECTANGLE_PATHFIND;UNATTACKABLE ThreatLevel = DWARVEN_MENOFDALE_HORDE_THREAT ThreatBreakdown DwarvenMenOfDaleHorde_DetailedThreat AIKindOf = ARCHER End Body = ImmortalBody ModuleTag_ImmortalBody MaxHealth = 1 End Behavior = SpecialPowerModule ModuleTag_BlackArrowsStarter SpecialPowerTemplate = SpecialAbilityBlackArrows UpdateModuleStartsAttack = Yes End Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_BlackArrowsWeaponFireUpdate SpecialPowerTemplate = SpecialAbilityBlackArrows ; this has to be longer than the weapon firing time on the members or ; else the horde will fire its regular weapon and blow away the members' ai. PackTime = 2000 StartAbilityRange = #SUBTRACT( DWARVEN_MENOFDALE_RANGE 100 ) SpecialWeapon = DwarvenMenOfDaleBlackArrowsRangeFinder ApproachUntilMembersInRange = Yes TriggerSound = YeomanArcherVoiceAttackCharge End #include "..\..\..\includes\CaptureBuilding.inc" Behavior = StancesBehavior ModuleTag_StancesBehavior StanceTemplate = ArcherHorde End Behavior = HordeAIUpdate ModuleTag_HordeAIUpdate AutoAcquireEnemiesWhenIdle = Yes ATTACK_BUILDINGS MoodAttackCheckRate = 500 MaxCowerTime = 5000 MinCowerTime = 3000 CanAttackWhileContained = Yes ; Can fire out of garrisoned building AILuaEventsList = InfantryFunctions AttackPriority = AttackPriority_Archer End Behavior = HordeContain ModuleTag_HordeContain ObjectStatusOfContained = InitialPayload = DwarvenMenOfDaleInn 12 Slots = 12 PassengerFilter = NONE +INFANTRY ShowPips = No ThisFormationIsTheMainFormation = Yes ;Used to determine which armorset to use (and anything else we want!) MeleeBehavior = Amoeba End ; Banner Carrier info BannerCarriersAllowed = DwarvenBanner ; types of units that are allowed as banner carriers BannerCarrierPosition = UnitType:DwarvenMenOfDale Pos:X:40.0 Y:0.0 ; (DEFAULT) position of banner carrier for archer horde ; Positions for 5 RandomOffset = X:0 Y:-12 RankInfo = RankNumber:1 UnitType:DwarvenMenOfDale Position:X:0 Y:12 Position:X:0 Y:-12 Position:X:0 Y:-36 Position:X:0 Y:36 Position:X:0 Y:-60 Position:X:0 Y:60 RankInfo = RankNumber:2 UnitType:DwarvenMenOfDale Position:X:20 Y:12 Position:X:15 Y:-12 Position:X:20 Y:-36 Position:X:20 Y:36 Position:X:20 Y:-60 Position:X:20 Y:60 RanksToReleaseWhenAttacking = 1 2 MeleeAttackLeashDistance = 1 //How far the hordes can move from the center of the horde when melee attacking. BackUpMinDelayTime = 1 //The minimum amount of time to delay before backing up BackUpMaxDelayTime = 3000 //The maximum amount of time to delay before backing up BackUpMinDistance = 1 //The minimum number of cells to backup BackUpMaxDistance = 3 //The maximum number of cells to backup BackupPercentage = 80% //The amount of chance that a unit will back up. End Behavior = PhysicsBehavior ModuleTag_PhysicsBehavior GravityMult = 1.0 End Behavior = EmotionTrackerUpdate Module_EmotionTracker TauntAndPointDistance = INFANTRY_TAUNT_POINT_RADIUS ; max distance to taunted/pointed objet TauntAndPointUpdateDelay = 1000 ; how often scan (milliseconds) TauntAndPointExcluded = NONE AfraidOf = EMOTION_AFRAIDOF_OBJECTFILTER AlwaysAfraidOf = EMOTION_ALWAYS_AFRAIDOF_OBJECTFILTER PointAt = EMOTION_POINTAT_OBJECTFILTER HeroScanDistance = 150 FearScanDistance = CAVALRY_FEAR_SCAN_RADIUS AddEmotion = Terror_Base AddEmotion = Doom_Base AddEmotion = BraceForBeingCrushed_Base AddEmotion = UncontrollableFear_Base AddEmotion = FearIdle_Base AddEmotion = FearBusy_Base AddEmotion = Point_Base AddEmotion = Taunt_Base AddEmotion = CheerIdle_Base AddEmotion = CheerBusy_Base AddEmotion = HeroCheerIdle_Base AddEmotion = HeroCheerBusy_Base AddEmotion = Alert_Base End LocomotorSet Locomotor = NormalRangedHordeLocomotor Condition = SET_NORMAL Speed = NORMAL_FOOT_MED_HORDE_SPEED End Behavior = ProductionUpdate ProductionUpdateModuleTag GiveNoXP = Yes End Behavior = LevelUpUpgrade ModuleTag_BasicTraining TriggeredBy = Upgrade_DwarvenBasicTraining LevelsToGain = 1 LevelCap = 2 End Behavior = StatusBitsUpgrade ModuleTag_ProductionLegality TriggeredBy = Upgrade_DwarvenFireArrows End Behavior = StatusBitsUpgrade ModuleTag_ProductionLegality2 TriggeredBy = Upgrade_DwarvenMithrilMail End Behavior = PickupStuffUpdate ModuleTag_PickupStuffUpdate SkirmishAIOnly = Yes StuffToPickUp = NONE +CRATE ScanRange = 200 ScanIntervalSeconds = 0.5 End ///////////////////// // AISpecialPowers ///////////////////// Behavior = AISpecialPowerUpdate DwarvenMenOfDaleHordeCaptureBuildingAI CommandButtonName = Command_CaptureBuilding SpecialPowerAIType = AI_SPECIAL_POWER_CAPTURE_BUILDING End Behavior = AISpecialPowerUpdate GondorFighterHordeStanceBattle CommandButtonName = Command_SetStanceBattle SpecialPowerAIType = AI_SPECIAL_POWER_STANCEBATTLE End Behavior = AISpecialPowerUpdate GondorFighterHordeStanceAggressive CommandButtonName = Command_SetStanceAggressive SpecialPowerAIType = AI_SPECIAL_POWER_STANCEAGGRESSIVE End Behavior = AISpecialPowerUpdate GondorFighterHordeHoldGround CommandButtonName = Command_SetStanceHoldGround SpecialPowerAIType = AI_SPECIAL_POWER_STANCEHOLDGROUND End Behavior = AISpecialPowerUpdate DwarvenMenOfDaleHordeBlackArrowAI CommandButtonName = Command_BlackArrows SpecialPowerAIType = AI_SPECIAL_POWER_ENEMY_TYPE_KILLER_RANGED End Geometry = BOX GeometryMajorRadius = 20.0 GeometryMinorRadius = 60.0 GeometryHeight = 10.0 GeometryIsSmall = No ; *** AUTO RESOLVE DATA *** AutoResolveUnitType = AutoResolveUnit_Archer AutoResolveCombatChain = AutoResolve_ArcherCombatChain AutoResolveBody = AutoResolve_DwarvenMenOfDaleHordeBody AutoResolveArmor RequiredUpgrades = Upgrade_DwarvenMithrilMail Armor = AutoResolve_DwarvenMenOfDaleHeavyArmor End AutoResolveArmor ExcludedUpgrades = Upgrade_DwarvenMithrilMail Armor = AutoResolve_DwarvenMenOfDaleArmor End AutoResolveWeapon RequiredUpgrades = Upgrade_DwarvenFireArrows Weapon = AutoResolve_DwarvenMenOfDaleUpgradedWeapon End AutoResolveWeapon ExcludedUpgrades = Upgrade_DwarvenFireArrows Weapon = AutoResolve_DwarvenMenOfDaleWeapon End WorldMapArmoryUpgradesAllowed = Upgrade_DwarvenBasicTraining Upgrade_DwarvenFireArrows Upgrade_DwarvenMithrilMail End
I hope that somebody around here can help me, I don't really know what to do here and where to look for it.
Edited by withmorten, 22 June 2012 - 01:54 AM.