Jump to content


Photo

Problem with new horde


Best Answer Goldo, 20 October 2020 - 11:58 AM

For anyone having the same problem, I found my solution. There was nothing wrong with the miner's code, it was the mineshaft code that needed an extra line of code to be able to properly produce units. Here is the tutorial on how to do it:

 

https://www.the3rdag...tem-548?addview

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 Goldo

Goldo
  • Members
  • 57 posts

Posted 07 September 2020 - 01:39 PM

After succeeding with adding a new goblin spearmen unit, I thought I'd add a new miner unit for the Dwarves that could be produced from the mine shaft. Problem is this time, the unit does not come out in a horde but breaks up into individual soldiers as soon as it spawns. I take it this is a problem with my hordes.ini and not the fact that I use the mine shaft as their spawning building? Anyway here is the code. I pretty much just copied the Guardian entry:

;//------------------------------------------------------------------------------
Object DwarvenMinerHorde

	; This is required for garrisoned objects - please put in all objects.
	ButtonImage		= BDFortress_Porter
	SelectPortrait	= UPDwarvenMiner

	Draw = W3DScriptedModelDraw ModuleTag_W3DModelDraw
	    DependencySharedModelFlags = EMOTION_ALERT EMOTION_MORALE_HIGH EMOTION_MORALE_LOW EMOTION_AFRAID EMOTION_COWER EMOTION_TERROR EMOTION_LOOK_TO_SKY SELECTED
		DefaultModelConditionState
			Model = None ;InvisHrdeTmp5x2
		End

		ModelConditionState = HORDE_EMPTY
			Model = None
		End		
		
		ModelConditionState = WORLD_BUILDER
			Model = HordeMarkEUDFG
		End		
	End
	
	Side = Dwarves
	EditorSorting = UNIT
	EmotionRange = 240
	DisplayName = OBJECT:HordeDwarvenMiner
	DisplayNameStrategic = CONTROLBAR:LW_Unit_DwarvenMinerHorde
	DescriptionStrategic = CONTROLBAR:LW_ToolTip_DwarvenMinerHorde
		
	WeaponSet
		Conditions = None 
		Weapon = PRIMARY    NormalMeleeHordeRangefinder
	End

	; *** 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"

	UnitSpecificSounds
		VoiceDesperateAttack  = GondorSoldierVoiceDesperateCharge 
	End

	BuildCost = DWARVEN_GUARDIAN_BUILDCOST
	BuildTime = 1    
	VisionRange = DWARVEN_GUARDIAN_HORDE_VISION_RANGE
	ShroudClearingRange = DWARVEN_GUARDIAN_SHROUD_RANGE
	VisionSide = 50%
	VisionRear = 25%
	
	MaxVisionBonusPercent = 300%
	VisionBonusTestRadius = 200
	VisionBonusPercentPerFoot = 1.0%
	CommandPoints = 60 ;;,;; 70		; 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.
	
	CrushableLevel = 0  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
	CrusherLevel = 1 
	
	CrushOnlyWhileCharging = YES ; // the guardian is only supposed to crush during his special charge ability
	
	MinCrushVelocityPercent = 50% ; Has to be moving at least xx% of full speed
	CrushDecelerationPercent = 90% ; Lose xx% max velocity when crushing -- thus they only crush 1 row of infantry
	
	CrushKnockback = 40  ; how hard we knock back crushed units.
	CrushZFactor = 1.0  ; How much we knock upwards.

    TransportSlotCount = TRANSPORTSLOTCOUNT_SMALL_HORDE
	KindOf = SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT INFANTRY HORDE MELEE_HORDE NOTIFY_OF_PREATTACK ARMY_SUMMARY LARGE_RECTANGLE_PATHFIND ;;UNATTACKABLE 
	
	ThreatLevel = DWARVEN_GUARDIAN_HORDE_THREAT
	ThreatBreakdown DwarvenGuardianHorde_DetailedThreat
		AIKindOf = INFANTRY
	End
	
	Body = ImmortalBody ModuleTag_ImmortalBody
		MaxHealth = 1
	End
	
	#include "..\..\..\includes\CaptureBuilding.inc"
	
	Behavior = StancesBehavior ModuleTag_StancesBehavior
        StanceTemplate = FighterHorde
    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_Infantry
	End

	Behavior = HordeContain ModuleTag_HordeContain
		FrontAngle = 270
		FlankedDelay =  GENERAL_UNIT_FLANKED_DELAY ;,; 2000
		ObjectStatusOfContained			= 
		InitialPayload				= DwarvenMiner 10  	;15
		Slots					= 10   			;15
		PassengerFilter				= NONE +INFANTRY
		ShowPips				= No
		ThisFormationIsTheMainFormation = Yes	;//Used to determine which armorset to use (and anything else we want!)
		RandomOffset = X:0 Y:0
		
		MeleeBehavior = Amoeba
		End					

		; Banner Carrier info		
		BannerCarriersAllowed	= DwarvenBanner							;// types of units that are allowed as banner carriers
		BannerCarrierPosition	= UnitType:DwarvenMiner	Pos:X:70.0 Y:0.0		;// (DEFAULT) position of banner carrier
		
		RankInfo = RankNumber:1 UnitType:DwarvenMiner Position:X:50 Y:0		Position:X:50 Y:20		Position:X:50 Y:-20		Position:X:50 Y:40		Position:X:50 Y:-40 
		RankInfo = RankNumber:2 UnitType:DwarvenMiner Position:X:30 Y:0 Leader 1 0	Position:X:30 Y:20 Leader 1 1	Position:X:30 Y:-20 Leader 1 2	Position:X:30 Y:40 Leader 1 3	Position:X:30 Y:-40 Leader 1 4
;		RankInfo = RankNumber:3 UnitType:DwarvenMiner Position:X:10 Y:0 Leader 2 0	Position:X:10 Y:20 Leader 2 1	Position:X:10 Y:-20 Leader 2 2	Position:X:10 Y:40 Leader 2 3	Position:X:10 Y:-40 Leader 2 4
		
		
		;// Positions for 5
		
		RanksToReleaseWhenAttacking		= 1 2 ;;,;; 1 
		
		MeleeAttackLeashDistance		= 50 ;;,;; 25	;// 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 = CommandButtonHuntUpdate ModuleTag_CommandButtonHuntUpdate
	End
  
	Behavior = HordeNotifyTargetsOfImminentProbableCrushingUpdate ModuleTag_NotifyCrushScan
		ScanWidth = 60.0 ; A little less than the width of the horde (which is 2 * 35 = 70)
	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		=	INFANTRY_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
		AddEmotion			=   	CheerForAboutToCrush_Base
	End	
  
	LocomotorSet
		Locomotor     = NormalChargeMeleeHordeLocomotor
		Condition     = SET_NORMAL
		Speed         = NORMAL_FOOT_SLOW_HORDE_SPEED
	End
	
	LocomotorSet
		Locomotor     = ScaredMeleeHordeLocomotor
		Condition     = SET_SCARED
		Speed         = NORMAL_FOOT_SLOW_HORDE_SPEED
	End
	
	Behavior = ProductionUpdate ProductionUpdateModuleTag
		GiveNoXP = Yes
	End
	
	Behavior = PickupStuffUpdate ModuleTag_PickupStuffUpdate
		SkirmishAIOnly = Yes
		StuffToPickUp = NONE +CRATE
		ScanRange = 200
		ScanIntervalSeconds = 0.5
	End

	;;; NEW DWARVEN CHARGE ABILITY ;;;
	Behavior = UnpauseSpecialPowerUpgrade ModuleTag_ChargeUnpause
		SpecialPowerTemplate      	= SpecialAbilityDwarvenCharge
		TriggeredBy			= Upgrade_ObjectLevel2
	End
	
  	Behavior = SpecialPowerModule ModuleTag_ChargeStarter                      
		SpecialPowerTemplate      	= SpecialAbilityDwarvenCharge
		UpdateModuleStartsAttack  	= Yes
		StartsPaused			= Yes
	End
	#include "..\..\..\includes\DwarvenChargeUpdate.inc"
		
	CommandSet = DwarvenMinerHordeCommandSet

	;,; 2.02 upgrade tiers: all tier-specific upgrade simply trigger the old one
	Behavior = AttributeModifierUpgrade ModuleTag_UpgradeTriggerBlades
		TriggeredBy = PERSONAL_FORGED_BLADES_TIERS_LIST
		AttributeModifier = Modifier_DwarvenForgedBlades
	End
	Behavior = AttributeModifierUpgrade ModuleTag_UpgradeTriggerArmor
		TriggeredBy = PERSONAL_HEAVY_ARMOR_TIERS_UPGRADE_LIST
		AttributeModifier = Modifier_DwarvenMithrilMail
	End
	Behavior = AttributeModifierUpgrade ModuleTag_UpgradeTriggerTierBlades
		TriggeredBy = Upgrade_DwarvenForgedBlades
		AttributeModifier = Modifier_TieredBlades
	End
	Behavior = AttributeModifierUpgrade ModuleTag_UpgradeTriggerTierArmor
		TriggeredBy = Upgrade_DwarvenMithrilMail
		AttributeModifier = Modifier_TieredArmor
	End

; ; (;;,;;)
	Behavior = CommandSetUpgrade ModuleTag_DwarvenGuardianHordeBladesCommandSet
		TriggeredBy		= Upgrade_DwarvenForgedBlades
		ConflictsWith	= Upgrade_DwarvenSiegeHammer
		CommandSet		= DwarvenGuardianHordeBladesCommandSet
	End
	
	/////////////////////
	// AISpecialPowers
	/////////////////////
	
	Behavior = AISpecialPowerUpdate DwarvenGuardianHordeCaptureBuildingAI
		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 DwarfGuardianCharge
		CommandButtonName = Command_DwarvenGuardianChargeAttack
		SpecialPowerAIType = AI_SPECIAL_POWER_CHARGE
	End

	
	Geometry = BOX
	GeometryMajorRadius = 30.0
	GeometryMinorRadius = 50.0
	GeometryHeight = 20.0
	GeometryIsSmall = No
	
	
	; *** AUTO RESOLVE DATA *** 
	AutoResolveUnitType = AutoResolveUnit_Soldier
	AutoResolveCombatChain = AutoResolve_SoldierCombatChain
	
	AutoResolveBody = AutoResolve_DwarvenGuardianHordeBody
	
	AutoResolveArmor
		RequiredUpgrades = Upgrade_DwarvenMithrilMail
		Armor = AutoResolve_DwarvenGuardianHeavyArmor
	End

	AutoResolveArmor
		ExcludedUpgrades = Upgrade_DwarvenMithrilMail
		Armor = AutoResolve_DwarvenGuardianArmor
	End

	AutoResolveWeapon
		RequiredUpgrades = Upgrade_DwarvenForgedBlades
		Weapon = AutoResolve_DwarvenGuardianUpgradedWeapon
	End

	AutoResolveWeapon
		ExcludedUpgrades = Upgrade_DwarvenForgedBlades
		Weapon = AutoResolve_DwarvenGuardianWeapon
	End
	
	WorldMapArmoryUpgradesAllowed = Upgrade_DwarvenBasicTraining Upgrade_DwarvenForgedBlades Upgrade_DwarvenMithrilMail
End

;


#2 Symonius

Symonius
  • Members
  • 51 posts
  • Location:The ancient shield
  • Projects:TROW Mod
  •  Just a winged modder

Posted 04 October 2020 - 09:00 PM

Hi Goldo,
the first thing that came out in my mind is the kindof of your DwarvenMiner.

Try to take a look in it if it's actually present the INFANTRY tag ;)

"All we have to decide is what to mod with the time that is given us"


#3 Goldo

Goldo
  • Members
  • 57 posts

Posted 05 October 2020 - 06:06 PM

Thanks for the reply! There is an Infantry tag in both the horde's code and the unit's ini.



#4 Symonius

Symonius
  • Members
  • 51 posts
  • Location:The ancient shield
  • Projects:TROW Mod
  •  Just a winged modder

Posted 12 October 2020 - 04:23 PM


Sorry for late reply.

Can you also upload the miner code please? ;)

"All we have to decide is what to mod with the time that is given us"


#5 Goldo

Goldo
  • Members
  • 57 posts

Posted 15 October 2020 - 11:15 AM

@Symonius: Sure thing!

;------------------------------------------------------------------------------
;
;	DwarvenMiner.ini
;
;------------------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Object DwarvenMiner
	; *** ART Parameters ***

	SelectPortrait         =  UPDwarvenMiner
	ButtonImage		= BDFortress_Porter

	Draw = W3DHordeModelDraw ModuleTag_01
		OkToChangeModelColor = Yes	
		StaticModelLODMode = Yes
		
		; specify options for static LODs
		LodOptions							= LOW
			AllowMultipleModels				= ALLOW_MULTIPLE_MODELS_LOW
			MaxRandomTextures				= MAX_RANDOM_TEXTURES_LOW
			MaxRandomAnimations				= MAX_RANDOM_ANIMATIONS_LOW
			MaxAnimFrameDelta				= MAX_ANIM_FRAME_DELTA_LOW
		End
		
		LodOptions							= MEDIUM
			AllowMultipleModels				= ALLOW_MULTIPLE_MODELS_MED
			MaxRandomTextures				= MAX_RANDOM_TEXTURES_MED
			MaxRandomAnimations				= MAX_RANDOM_ANIMATIONS_MED
			MaxAnimFrameDelta				= MAX_ANIM_FRAME_DELTA_MED
		End
		
		LodOptions							= HIGH
			AllowMultipleModels				= ALLOW_MULTIPLE_MODELS_HIGH
			MaxRandomTextures				= MAX_RANDOM_TEXTURES_HIGH
			MaxRandomAnimations				= MAX_RANDOM_ANIMATIONS_HIGH
			MaxAnimFrameDelta				= MAX_ANIM_FRAME_DELTA_HIGH
		End

		WadingParticleSys = WaterRipplesTrail  ; used when the unit is wading in shallow water.
;;================ MODELS =================================================================
		DefaultModelConditionState
			Model               = EUDwarfMin_SKN
			Skeleton            = EUDwarfMin_SKL
		End

		ModelConditionState WEAPONSET_PLAYER_UPGRADE
			Model               = EUDwarfMin_SKN
			Skeleton            = EUDwarfMin_SKL
		End
		
		ModelConditionState = USER_4		; This state is used in cinematics to get the old style armor
			Model               = EUDwarfMin_SKN
			Skeleton            = EUDwarfMin_SKL
		End

;;=============== ANIMATIONS ===============================================================

;;======= FALLING & FLYING

;		AnimationState						= PASSENGER
;			Animation						= Grabbed
;				AnimationName				= EUDwarfMin_LEPB ; Don't have real flailing anim, needs to be replaced
;				AnimationMode				= LOOP
;			End
;		End
		
		AnimationState        				= THROWN_PROJECTILE
			Animation           			= FlyA
				AnimationName      	 		= EUDwarfMin_FLYA
				AnimationMode       		= LOOP
			End
			Flags               			= RANDOMSTART
		End
		
		AnimationState						= FREEFALL
			Animation						= Falling
				AnimationName				= EUDwarfMin_FLYA
				AnimationMode				= LOOP
				AnimationBlendTime			= 10
			End
		End

		
		
		AnimationState        				= STUNNED_FLAILING 
			Animation           			= FlyA
				AnimationName       		= EUDwarfMin_FLYA
				AnimationMode       		= LOOP
			End
			Flags               			= RANDOMSTART
		End

		AnimationState 						= DYING SPLATTED
			Animation 						= Splatted_On_Ground
				AnimationName 				= EUDwarfMin_LNDA
				AnimationMode 				= ONCE
			End
			EnteringStateFX					= FX_OrcHitGround
		End
		
		AnimationState						= DYING
			Animation						= DIEB
				AnimationName				= EUDwarfMin_DIEB
				AnimationMode				= ONCE
			End
			Animation						= DIEC
				AnimationName				= EUDwarfMin_DIEB
				AnimationMode				= ONCE
			End
		End

;;======= LANDING & STANDING

		AnimationState						= STUNNED_STANDING_UP
			Animation						= GTPA
				AnimationName				= EUDwarfMin_GTPA
				AnimationMode				= ONCE
				AnimationSpeedFactorRange = 1.5 1.5
			End
		End


	
		AnimationState			=	 STUNNED
			Animation			=	 Slatted_On_Ground
			AnimationName 				= EUDwarfMin_LNDA
				AnimationMode 				= ONCE
			End
			EnteringStateFX					= FX_OrcHitGround

       End 
		
		
		AnimationState        = MOVING FIRING_OR_PREATTACK_A
			ShareAnimation		= Yes
			Animation           = RunAndFire
				AnimationName       = EUDwarfMin_ATRA
				AnimationMode       = LOOP
			End
			Flags               = RANDOMSTART  
		End
		
;;====== TERROR
		
		AnimationState						= MOVING EMOTION_TERROR EMOTION_LOOK_TO_SKY
			;@@@KM Add distance
			Animation					= TerrorFromTheSky
				AnimationName			= EUDwarfMin_RUNA
				AnimationMode			= LOOP
			End
			Animation					= TerrorFromTheSky
				AnimationName			= EUDwarfMin_RUNA
				AnimationMode			= LOOP
			End
			Flags = RANDOMSTART
		End
		AnimationState						= MOVING EMOTION_TERROR
			;@@@KM Add distance
			Animation						= TerrorFromTheSky
				AnimationName				= EUDwarfMin_RUNA
				AnimationMode				= ONCE
			End
			Animation						= TerrorFromTheSky
				AnimationName				= EUDwarfMin_RUNA
				AnimationMode				= ONCE
			End
			Flags							= RESTART_ANIM_WHEN_COMPLETE
		End
		
;;======= BACK UP
		
		AnimationState						= MOVING BACKING_UP
			;@@@KM Add distance
			Animation						= BAKA
				AnimationName				= EUDwarfMin_RUNA
				AnimationMode				= LOOP
			End
			Flags = RANDOMSTART
		End
		
		AnimationState						= MOVING ATTACKING
			ShareAnimation					= Yes;
			Animation						= RUNA
				AnimationName				= EUDwarfMin_RUNA
				AnimationMode				= LOOP
				Distance					= 25
			End
			Flags							= RANDOMSTART
			;ParticleSysBone				= None InfantryDustTrails
		End
		
		AnimationState						= MOVING CHARGING
			ShareAnimation					= Yes;
			Animation						= RUNB
				AnimationName				= EUDwarfMin_RUNA
				AnimationMode				= LOOP
				Distance					= 30
				;AnimationSpeedFactorRange	= 0.5 0.5
			End
			Flags							= RANDOMSTART
			;ParticleSysBone				= None InfantryDustTrails
		End

		AnimationState						= MOVING
			;@@@KM - Add Distance
			ShareAnimation					= Yes;
			Animation						= RUNB
				AnimationName				= EUDwarfMin_RUNA
				AnimationMode				= LOOP
				Distance					= 30
			End
			Flags							= RANDOMSTART
			;ParticleSysBone				= None InfantryDustTrails
		End
;;======= UNCONTROLLABLY AFRAID
	; This is before Attacking so it overrides it.  Normal fear is below so you don't go to little-fear in between swings.
		AnimationState						= EMOTION_UNCONTROLLABLY_AFRAID
			Animation						= FERA
				AnimationName				= EUDwarfMin_CHRA ; Don't have real fear, needs to be replaced
				AnimationMode				= LOOP
			End
		End
;;---------------------- ATTACKING ----------------------------------------------------------------
		AnimationState						= FIRING_OR_PREATTACK_A
			Animation						= ATK1
				AnimationName				= EUDwarfMin_ATKA
				AnimationMode				= ONCE
				UseWeaponTiming				= Yes
			End
			;ParticleSysBone				= None MeleeDust
		End
		
		AnimationState						= ATTACKING
			Animation						= ALERT_1
				AnimationName				= EUDwarfMin_IDLA
				AnimationMode				= LOOP
			End
		End
;;----------------- HIT REACTIONS -------------------------------------------------------------------------

;		AnimationState						= HIT_REACTION
;			Animation						= HITA
;				AnimationName				= EUDwarfMin_HITA
;				AnimationMode				= ONCE
;			End
;		End

;;----------------- EMOTIONS ----------------------------------------------------------------
;;======= APPREHENSIVE

;		AnimationState						= EMOTION_ALERT EMOTION_AFRAID
;			Animation						= APPA
;				AnimationName				= GUManMocap_APPA
;				AnimationMode				= ONCE
;			End
;			Animation						= APPB
;				AnimationName				= GUManMocap_APPB
;				AnimationMode				= ONCE
;			End
;			Flags							= RANDOMSTART RESTART_ANIM_WHEN_COMPLETE
;		End
		
;;======= AFRAID

;		AnimationState						= EMOTION_AFRAID
;			Animation						= FERA
;				AnimationName				= EUDwarfMin_CHRA ; Don't have real fear, needs to be replaced
;				AnimationMode				= LOOP
;			End 
;		End

;;======== POINTING

;		AnimationState						= EMOTION_POINTING
;			Animation						= Pointing1
;				AnimationName				= EUDwarfMin_CHRA ; Don't have real pointing anim, needs to be replaced
;				AnimationMode				= LOOP
;			End
;		End

;;======= TAUNTING

;		AnimationState						= EMOTION_TAUNTING
;			Animation						= Taunting1
;				AnimationName				= EUDwarfMin_CHRA ; Don't have real taunting anim, needs to be replaced
;				AnimationMode				= ONCE
;			End
;			Flags							= RANDOMSTART RESTART_ANIM_WHEN_COMPLETE
;		End

;;======= CELEBRATING

;		AnimationState						= EMOTION_CELEBRATING
;			Animation						= CHRA
;				AnimationName				= EUDwarfMin_CHRA
;				AnimationMode				= ONCE
;			End
;			Animation						= CHRB
;				AnimationName				= EUDwarfMin_CHRB
;				AnimationMode				= ONCE
;			End
;			Animation						= IDLD
;				AnimationName				= EUDwarfMin_IDLD
;				AnimationMode				= ONCE
;			End
;			Flags							=	RESTART_ANIM_WHEN_COMPLETE
;		End
		
;;----------------- ALERT STATE ---------------------------------------------------------------------------

		AnimationState						= EMOTION_ALERT
			Animation						= ALERT_1
				AnimationName				= EUDwarfMin_IDLA
				AnimationMode				= LOOP;ONCE
				AnimationPriority			= 10
			End
			Flags							= RESTART_ANIM_WHEN_COMPLETE ; acts like an idle animation & keeps running the animations.
		End
		
;;----------------- SELECTED STATES -----------------------------------------------------------------------
		AnimationState        = SELECTED
			StateName           = STATE_Selected
			Animation           = ATNB
				AnimationName     = EUDwarfMin_ATNB
				AnimationMode     = LOOP
			End
			
			BeginScript
				Prev = CurDrawablePrevAnimationState()
				if Prev == "STATE_Idle" 
				then 
					CurDrawableSetTransitionAnimState("TRANS_IdleToSelected") 
				end
				if CurDrawableModelcondition("ATTACKING")
				then
					return "IDLA"
				else
					return "ATNA"
				end
			EndScript
			
			BeginScript
				Prev = CurDrawablePrevAnimationState()
				if Prev == "STATE_Idle" then CurDrawableSetTransitionAnimState("TRANS_IdleToSelected") end
			EndScript
		End
		
;;----------------- IDLE STATES ---------------------------------------------------------------------------
		AnimationState				= WEAPONSET_PLAYER_UPGRADE
			StateName				= STATE_Idle
			Animation				= IDLB
				AnimationName       = EUDwarfMin_IDLB
				AnimationMode       = ONCE
				AnimationSpeedFactorRange = 0.9 1.1
			End
			Animation				= IDLC
				AnimationName       = EUDwarfMin_IDLC
				AnimationMode       = ONCE
				AnimationSpeedFactorRange = 0.9 1.1
			End
			Animation				= IDLD
				AnimationName       = EUDwarfMin_IDLD
				AnimationMode       = ONCE
				AnimationSpeedFactorRange = 0.9 1.1
			End
;			Animation				= CHRA
;				AnimationName       = EUDwarfMin_CHRA
;				AnimationMode       = ONCE
;				AnimationSpeedFactorRange = 0.9 1.1
;			End
;			Animation				= CHRB
;				AnimationName       = EUDwarfMin_CHRB
;				AnimationMode       = ONCE
;				AnimationSpeedFactorRange = 0.9 1.1
;			End
			Flags					= RESTART_ANIM_WHEN_COMPLETE			
			BeginScript
				Prev = CurDrawablePrevAnimationState()
				if Prev == "STATE_Selected" then CurDrawableSetTransitionAnimState("TRANS_SelectedToIdle") end
			EndScript
		End		
		AnimationState				= USER_3
			StateName				= STATE_User_3
			Animation				= GUARD_STANCE
				AnimationName		= GUManMocap_IDLA
				AnimationMode		= LOOP
			End
		End
		IdleAnimationState
		    ;AllowRepeatInRandomPick = no
		    ;Flags = RANDOMSTART
			StateName				= STATE_Idle
            Animation				= IDLA
                AnimationName       = EUDwarfMin_IDLA ;default idle
				AnimationMode       = ONCE
				AnimationPriority   = 100 
				AnimationSpeedFactorRange = 0.9 1.1
				AnimationBlendTime	= 15
			End
			Animation				= IDLB
				AnimationName       = EUDwarfMin_IDLB ;figet idle, similar to IDLA, should be used sparingly
				AnimationMode       = ONCE
				AnimationPriority   = 10
				AnimationSpeedFactorRange = 0.9 1.1
				AnimationBlendTime	= 15
			End
			Animation				= IDLC
				AnimationName       = EUDwarfMin_IDLC ;bored idle --similar to IDLD but longer
				AnimationMode       = ONCE
				AnimationPriority   = 5
				AnimationSpeedFactorRange = 0.9 1.1
				AnimationBlendTime	= 15
			End
			Animation				= IDLD
				AnimationName       = EUDwarfMin_IDLD ;bored idle --similar to IDLC but shorter
				AnimationMode       = ONCE
				AnimationPriority   = 7
				AnimationSpeedFactorRange = 0.9 1.1
				AnimationBlendTime	= 15
			End
			BeginScript
				Prev = CurDrawablePrevAnimationState()
				if Prev == "STATE_Selected" then CurDrawableSetTransitionAnimState("TRANS_SelectedToIdle") end
			EndScript
		End
;;--------------- TRANSITIONS ---------------------------------------------------------------------------
		TransitionState       = TRANS_IdleToSelected
			Animation           = ATNA
				AnimationName     = EUDwarfMin_ATNA
				AnimationMode     = ONCE
				AnimationSpeedFactorRange = 0.9 1.0
				
			End
		End
		TransitionState		= TRANS_SelectedToIdle
			Animation			= ATNC
				AnimationName	= EUDwarfMin_ATNC
				AnimationMode	= ONCE
				AnimationSpeedFactorRange = 0.9 1.0
			End
		End
	End
	
    #include "..\..\..\includes\StunDrawModuleSmall.inc"

	;// ***DESIGN parameters ***
	Side			= Dwarves
	EditorSorting		= UNIT
	ThreatLevel		= 1.0
	ThingClass		= HORDE_UNIT
	CommandPoints		= 6 ;;,;; 7 		; originally 4
	BountyValue		= DWARVEN_GUARDIAN_BOUNTY_VALUE
	
	;EmotionRange		= 240 ;// Make sure this value is greater than the fear distribution range. 

	TransportSlotCount 	= TRANSPORTSLOTCOUNT_UNIT
	
;;; WEAPON SETS ;;;
	WeaponSet
		Conditions		= None 
		Weapon			= PRIMARY    DwarvenGuardianSiegeHammer
		AutoChooseSources	= PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
	End

	WeaponSet ;;,;;
		Conditions			= PLAYER_UPGRADE
		Weapon				= PRIMARY    DwarvenGuardianAxe
		AutoChooseSources	= PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
	End

;;,;;	WeaponSet
;;,;;		Conditions 	= WEAPONSET_TOGGLE_1
;;,;;		Weapon 		= PRIMARY	DwarvenGuardianAxe
;;,;;		Weapon 		= SECONDARY	DwarvenBatteringRam
;;,;;		OnlyAgainst 	= SECONDARY MINE
;;,;;	End

	;;; ARMOR SETS ;;;
	ArmorSet
		Conditions      = None
		Armor           = DwarvenAxeThrowerHeavyArmor
		DamageFX        = NormalDamageFX
	End
	ArmorSet
		Conditions      = PLAYER_UPGRADE
		Armor           = DwarvenGuardianHeavyArmor
		;DamageFX       = NormalDamageFX
	End
	
	VisionRange = DWARVEN_GUARDIAN_VISION_RANGE
	VisionSide = 35%
	VisionRear = 25%
	VisionBonusPercentPerFoot = 2.0%
	MaxVisionBonusPercent = 300%
	VisionBonusTestRadius = 200
	ShroudClearingRange = SHROUD_CLEAR_STANDARD				

	DisplayName					= OBJECT:DwarvenMiner
	CrushableLevel				= 0		;//What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
	CrusherLevel				= 1 
	CrushWeapon					= GuardianCrush  
	
	CrushOnlyWhileCharging		= yes	;// the guardian is only supposed to crush during his special charge ability
	
	MinCrushVelocityPercent 	= 50%	;// Has to be moving at least xx% of full speed
	CrushDecelerationPercent	= 90%	;// Lose xx% max velocity when crushing -- thus they only crush 1 row of infantry
	CrushKnockback				= 40	;// how hard we knock back crushed units.
	CrushZFactor				= 1.0	;// How much we knock upwards.
	
	CrushRevengeWeapon			= BasicInfantryCrushRevenge
	
	CommandSet					= DwarvenMinerCommandSet


	;//--- AUDIO Parameters ---

	;VoiceAmbushed							= DwarfGuardianVoiceAmbushed	
	VoiceAttack								= DwarfGuardianVoiceAttack
	VoiceAttackCharge						= DwarfGuardianVoiceAttackCharge
	VoiceAttackMachine						= DwarfGuardianVoiceAttack
	VoiceAttackStructure					= DwarfGuardianVoiceAttackBuilding
	VoiceCreated							= DwarfGuardianVoiceSalute
	VoiceFullyCreated 						= DwarfGuardianVoiceSalute
	VoiceGuard								= DwarfGuardianVoiceMove
	VoiceMove								= DwarfGuardianVoiceMove
	VoiceMoveToCamp							= DwarfGuardianVoiceMoveCamp
	VoiceMoveWhileAttacking					= DwarfGuardianVoiceDisengage
	VoicePriority							= 47
	VoiceRetreatToCastle					= DwarfGuardianVoiceRetreat		
	VoiceSelect								= DwarfGuardianVoiceSelectMS
	VoiceSelectBattle 						= DwarfGuardianVoiceSelectBattle			

	VoiceEnterStateAttack					= DwarfGuardianVoiceEnterStateAttack
	VoiceEnterStateAttackCharge				= DwarfGuardianVoiceEnterStateAttackCharge
	VoiceEnterStateAttackMachine			= DwarfGuardianVoiceEnterStateAttackBuilding
	VoiceEnterStateAttackStructure			= DwarfGuardianVoiceEnterStateAttackBuilding
	VoiceEnterStateMove						= DwarfGuardianVoiceEnterStateMove
	VoiceEnterStateMoveToCamp				= DwarfGuardianVoiceEnterStateMoveCamp
	VoiceEnterStateMoveWhileAttacking		= DwarfGuardianVoiceEnterStateDisengage
	VoiceEnterStateRetreatToCastle			= DwarfGuardianVoiceEnterStateRetreat

	SoundImpact								= ImpactHorse

	UnitSpecificSounds
		VoiceGarrison						= DwarfGuardianVoiceMoveGarrison
		VoiceEnterUnitElvenTransportShip	= DwarfGuardianVoiceMoveShip
		VoiceInitiateCaptureBuilding		= DwarfGuardianVoiceCaptureBuilding
		;VoiceEnterStateInitiateCaptureBuilding	=
	End

    #include "..\..\..\includes\StandardUnitEvaEvents.inc"

	CrowdResponseKey = Dwarf

	Behavior = LargeGroupAudioUpdate ModuleTag_LGAU
		Key = Humanoid_Male Dwarf Dwarf_Male Dwarf_Guardian
	End
	
	ClientBehavior = ModelConditionAudioLoopClientBehavior ModuleTag_foo
		ModelCondition = Required:EMOTION_CELEBRATING	Excluded:DYING ENGAGED	Sound:EmotionDwarfCompilationVoxCheerSinglesLoop	;MOVING ATTACKING
		ModelCondition = Required:EMOTION_POINTING		Excluded:DYING ENGAGED	Sound:EmotionDwarfCompilationVoxTauntSinglesLoop	;MOVING ATTACKING
		ModelCondition = Required:EMOTION_TAUNTING		Excluded:DYING ENGAGED	Sound:EmotionDwarfCompilationVoxTauntSinglesLoop	;MOVING ATTACKING
		ModelCondition = Required:RAISING_FLAG			Excluded:DYING ENGAGED	Sound:EmotionDwarfCompilationVoxTauntSinglesLoop
	End

	; Change selection sounds based on upgrades
	ClientBehavior = UpgradeSoundSelectorClientBehavior ModuleTag_UpgradeSoundSelector
		SoundUpgrade		= Upgrade_DwarvenSiegeHammer						; EVERYTHING on this line must be present
		;ExcludedUpgrades	= Upgrade_OpenGarrison Upgrade_TrebuchetTurret		; NOTHING on this line can be present
			VoiceAttack		= DwarfGuardianVoiceAttackHammer
			VoiceAttack		= DwarfGuardianVoiceEnterStateAttackHammer
		End
	End

	ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
		MaxUpdateRangeCap = 800
;		AnimationSound = Sound: TauntHumanHitShield	Animation:GUMAArms_SKL.GUManMocap_IDLC	Frames: 17 27
		AnimationSound = Sound:BodyFallOrc			Animation:EUDWARFGUA_SKL.EUDWARFGUA_LNDA	Frames:4
;		AnimationSound = Sound:AxeDropSoundHere!	Animation:EUDWARFGUA_SKL.EUDWARFGUA_DIEA	Frames:8		;axe falls
		AnimationSound = Sound:BodyFallGeneric2		Animation:EUDWARFGUA_SKL.EUDWARFGUA_DIEA	Frames:45
;		AnimationSound = Sound:AxeDropSoundHere!	Animation:EUDWARFGUA_SKL.EUDWARFGUA_DIEB	Frames:8		;axe falls
		AnimationSound = Sound:BodyFallGeneric2		Animation:EUDWARFGUA_SKL.EUDWARFGUA_DIEB	Frames:28
		AnimationSound = Sound:BodyFallGeneric2		Animation:EUDWARFGUA_SKL.EUDWARFGUA_DIEC	Frames:45
	End

	; *** ENGINEERING Parameters ***

	RadarPriority = UNIT
	KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE THROWN_OBJECT ATTACK_NEEDS_LINE_OF_SIGHT NOTIFY_OF_PREATTACK GRAB_AND_DROP
	
	Body = ActiveBody ModuleTag_02
		CheerRadius 		= EMOTION_CHEER_RADIUS
		MaxHealth			= DWARVEN_GUARDIAN_HEALTH
		MaxHealthDamaged	= DWARVEN_GUARDIAN_HEALTH_DAMAGED
		BurningDeathBehavior = Yes
		BurningDeathFX       = FX_InfantryBurningFlame
	End
	
	
	;//-----UPGRADES------
	;--Weapon--
	Behavior = WeaponSetUpgrade WeaponSetUpgradeModuleTagGuardian
		TriggeredBy = Upgrade_DwarvenSiegeHammer ;;,;; Upgrade_DwarvenForgedBlades
		ConflictsWith = Upgrade_DwarvenForgedBlades ;,; Uncommented ;;,;;
	End

	Behavior = SubObjectsUpgrade ForgedBlade_UpgradeGuardian
		TriggeredBy		= Upgrade_DwarvenForgedBlades
		ConflictsWith = Upgrade_DwarvenSiegeHammer ;;,;;
		ShowSubObjects	= Forged_Blade
	End	
	
	;--Siege Hammer
	Behavior = SubObjectsUpgrade SiegeHammer_UpgradeGuardian
		TriggeredBy		= Upgrade_DwarvenSiegeHammer
		ConflictsWith 	= Upgrade_DwarvenForgedBlades ;,; Uncommented ;;,;;
		HideSubObjects	= axe shield
		HideSubObjects  = Forged_Blade ;;,;;
		ShowSubObjects	= hammer1
	End	
	
	;--Armor--
	Behavior = ArmorUpgrade ArmorUpgradeModuleTagGuardian
		TriggeredBy = Upgrade_DwarvenMithrilMail
		ArmorSetFlag			= PLAYER_UPGRADE
	    ;KillArmorUpgrade = Yes ;This cancels any previous armor upgrade.
	End
	
	Behavior = SubObjectsUpgrade Armor_UpgradeGuardian
		TriggeredBy		= Upgrade_DwarvenMithrilMail
		UpgradeTexture	= EUDwarfGua.tga 0 EUDwarfGua_HA.tga		;;;;;;;;;;;;;;;;;;;; TEMPORARY TEXTURE, NEEDS FIXING.
		RecolorHouse	= Yes
		ExcludeSubobjects = Forged_Blade
	End
	
		
	Behavior = AIUpdateInterface ModuleTag_03
		AutoAcquireEnemiesWhenIdle	=	Yes ATTACK_BUILDINGS
		MoodAttackCheckRate			=	500
		AILuaEventsList				=	DwarvenGuardianFunctions
		MinCowerTime				=	3000
		MaxCowerTime				=	5000
		AttackPriority				= 	AttackPriority_Cavalry
		BurningDeathTime			=	BURNINGDEATH_DURATION_INFANTRY
	End

	LocomotorSet
		Locomotor = HumanSpecialChargeLocomotor
		Condition = SET_NORMAL 
		Speed     = NORMAL_FOOT_SLOW_MEMBER_SPEED
	End

	LocomotorSet
		Locomotor = BurningDeathLocomotorInfantry
		Condition = SET_BURNINGDEATH
		Speed	  = BURNINGDEATH_WANDERSPEED_INFANTRY
	End

	Behavior = PhysicsBehavior ModuleTag_04
		GravityMult				= 1.0
		ShockStunnedTimeLow		= 1400	;msec
		ShockStunnedTimeHigh	= 2400	;msec
		ShockStandingTime		= 666	;msec
	End 

	Behavior = AttributeModifierUpgrade ModuleTag_AMU
		TriggeredBy			= Upgrade_GondorFighterFearless
		AttributeModifier	= FearlessForever
	End
	 
	;;,;; Removed
	;Behavior = AttributeModifierUpgrade ModuleTag_SHU
	;	TriggeredBy			= Upgrade_DwarvenSiegeHammer
	;	AttributeModifier	= DwarvenSiegeHammer
	;End
	 
	 
	Behavior = SquishCollide ModuleTag_06
		;//nothing
	End
	
	Behavior = HordeMemberCollide ModuleTag_HMC
		;//nothing
	End
	
;	Behavior = HitReactionBehavior HitReactionBehaviorModuleTag
;		HitReactionLifeTimer1 = 2500 ; level 1 (light  damage)  hit reaction animations in ms
;		HitReactionLifeTimer2 = 2500 ; level 2 (medium damage)  hit reaction animations in ms
;		HitReactionLifeTimer3 = 2500 ; 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

	Behavior = SlowDeathBehavior ModuleTag_05
		DeathTypes			= ALL -KNOCKBACK -FADED
		SinkDelay			= 3000
		SinkRate			= 0.90     ; in Dist/Sec
		DestructionDelay	= 15000
		Sound				= INITIAL DwarfGenericVoiceDie
	End
	
	Behavior = SlowDeathBehavior ModuleTag_07
		;// Same as normal death, but no sound (sound already played by SoundImpact = ... )
		DeathTypes			= NONE +KNOCKBACK
		SinkDelay			= 3000
		SinkRate			= 0.60     ; in Dist/Sec
		DestructionDelay	= 10000
	End
	
	Behavior = SlowDeathBehavior ModuleTag_FadeDeath
		DeathTypes			= NONE +FADED
		FadeDelay			= 0
		FadeTime			= 5000
		DestructionDelay	= 5000
        DeathFlags			= DEATH_2
;		FX					= INITIAL FX_UnSummonElvenAllies
		Sound = INITIAL SpellGenericUnsummonMS
	End	

	Behavior = BezierProjectileBehavior ModuleTag_08 ;// Module starts asleep, and wakes up when thrown.
		;// To tweak a Bezier path
		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

	;//--- NEW DWARVEN CHARGE ABILITY ---
  	Behavior = SpecialPowerModule ModuleTag_ChargeStarter                      
		SpecialPowerTemplate		= SpecialAbilityDwarvenCharge
		UpdateModuleStartsAttack	= Yes
		InitiateSound				= DwarfGuardianBullRushMS
	End
	#include "..\..\..\includes\DwarvenChargeUpdate.inc"
	
;;,;;	Behavior = CommandSetUpgrade ModuleTag_commandGuardian
;;,;;		TriggeredBy = Upgrade_DwarvenForgedBlades Upgrade_DwarvenSiegeHammer
;;,;;		RequiresAllTriggers	= Yes
;;,;;		CommandSet = DwarvenGuardianHordeToggleCommandSet
;;,;;	End	  

	Geometry			= CYLINDER
	GeometryMajorRadius = 8.0
	GeometryMinorRadius = 8.0
	GeometryHeight		= 19.2
	GeometryIsSmall		= No

    Shadow			= SHADOW_DECAL
    ShadowSizeX			= 19;
    ShadowSizeY			= 19;
    ShadowTexture		= ShadowI;
End


#6 Goldo

Goldo
  • Members
  • 57 posts

Posted 17 October 2020 - 11:07 AM

To save everyone some time, I tried spawning the unit from the Dwarven Barracks and it worked just fine. The issue is with the mine being used as the unit's production building. If anyone knows how to fi this, that would be cool. Until then, I'll just use the Hall of Warriors to train my miners. 



#7 Goldo

Goldo
  • Members
  • 57 posts

Posted 20 October 2020 - 11:58 AM   Best Answer

For anyone having the same problem, I found my solution. There was nothing wrong with the miner's code, it was the mineshaft code that needed an extra line of code to be able to properly produce units. Here is the tutorial on how to do it:

 

https://www.the3rdag...tem-548?addview



#8 Symonius

Symonius
  • Members
  • 51 posts
  • Location:The ancient shield
  • Projects:TROW Mod
  •  Just a winged modder

Posted 29 October 2020 - 10:16 AM

Well done Goldo ;)

"All we have to decide is what to mod with the time that is given us"





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users