Jump to content


DaedraWarrior

Member Since 13 Jun 2018
Offline Last Active May 12 2021 05:15 PM

Posts I've Made

In Topic: map for modding

31 July 2020 - 07:11 AM

Here's the test map me and my partner use to test our mod. It has huge amount of resources power points and CP, taverns, outposts, all sort of creeps and level ups for heroes. The only thing missing is the ring, but it could be easily added via World Builder

https://drive.google...iew?usp=sharing


In Topic: Unit special powers doesn't work

25 July 2020 - 04:47 PM

in the last line of your code you have

		RankInfo	= RankNumber:1 UnitType:GondorTowerShieldGuard Position:X:0 Y:0	Position:X:0 Y:15	Position:X:0 Y:-15		Position:X:0 Y:30	Position:X:0 Y:-30		

here you tell the game that the Shield Wall formation contains only 5 units

(you have 5 different positions)

let me know if that fixed your problem

It is working. Thank you for explanation!


In Topic: Unit special powers doesn't work

25 July 2020 - 11:12 AM

Thank you for responding! It is finally working. My problem was that I added them to GOOD_ELITE and it doesn't have Upgrade_ObjectLevel2 condition in experience levels.

I also have another problem with incorrect powers. I have changed Gondor Tower Guard to their analog from BFME and added their Shield Wall ability, however when I use it, only five random units from horde use this formations and others just stand and become unusable. Here's the code

Object GondorTowerShieldGuardHorde

	// This is required for garrisoned objects - please put in all objects.
	ButtonImage		= WOR_GondorTowerGuard
	SelectPortrait	= UPGondor_TowerGuard

	Draw = W3DScriptedModelDraw ModuleTag_W3DModelDraw
	    DependencySharedModelFlags = EMOTION_ALERT EMOTION_MORALE_HIGH EMOTION_MORALE_LOW EMOTION_AFRAID EMOTION_COWER SELECTED EMOTION_TERROR EMOTION_LOOK_TO_SKY
		DefaultModelConditionState
			Model = None //InvisHrdeTmp5x2
		End
		ModelConditionState = HORDE_EMPTY
			Model = None
		End		
		
		ModelConditionState = WORLD_BUILDER
			Model = HordeMarkGUTow
		End
	End
	
	Side = Men
	EditorSorting = UNIT
	EmotionRange = 240
	DisplayName = OBJECT:HordeGondorTowerGuard
	DisplayNameStrategic = CONTROLBAR:LW_Unit_GondorTowerGuardHorde
	DescriptionStrategic = CONTROLBAR:LW_ToolTip_GondorTowerGuardHorde
	
	WeaponSet
		Conditions = None 
		Weapon = PRIMARY    TowerGuardHordeRangefinder
	End

	// *** AUDIO Parameters ***//
	// Note: Don't put voice parameters here -- they will be ignored. Voice play requests
	// are always passed through to members


	BuildCost 			= GONDOR_TOWERGUARD_BUILDCOST
	BuildTime 			= GONDOR_TOWERGUARD_BUILDTIME
	VisionRange 			= GONDOR_TOWERGUARD_HORDE_VISION_RANGE
	ShroudClearingRange 		= GONDOR_TOWERGUARD_HORDE_SHROUD_RANGE
	VisionSide 			= 50%
	VisionRear 			= 25%
	MaxVisionBonusPercent 		= 300%
	VisionBonusTestRadius 		= 200
	VisionBonusPercentPerFoot 	= 1.0%
	CommandPoints 			= 75			; originally 60
	
	CommandSet = GondorTowerShieldGuardCommandSet
		
	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 = 0
 
    TransportSlotCount = TRANSPORTSLOTCOUNT_SMALL_HORDE
	KindOf = SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT INFANTRY HORDE ARMY_SUMMARY MELEE_HORDE PIKE LARGE_RECTANGLE_PATHFIND
	#include "..\..\..\includes\StandardHordeEvaEvents.inc"
	
	EvaEventAmbushed = GondorTowerGuardAmbushed ;,;
	
	Body = ImmortalBody ModuleTag_ImmortalBody
		MaxHealth = 1
	End

	ThreatLevel = GONDOR_TOWERSHIELDGUARD_HORDE_THREAT
	ThreatBreakdown GondorTowerShieldGuardHorde_DetailedThreat
		AIKindOf = PIKEMAN
	End
	
	#include "..\..\..\includes\CaptureBuilding.inc"
	
	Behavior = StancesBehavior ModuleTag_StancesBehavior
        StanceTemplate = PikeHorde
    End
		
	Behavior = HordeAIUpdate ModuleTag_HordeAIUpdate
		AutoAcquireEnemiesWhenIdle	=	Yes ATTACK_BUILDINGS
		MoodAttackCheckRate		=	500
		MaxCowerTime			=	5000
		MinCowerTime			=	3000
		AILuaEventsList			=	InfantryFunctions
		AttackPriority			= 	AttackPriority_Spearman
	End
	
	Behavior = HordeContain ModuleTag_HordeContain
		FrontAngle 		= 270 ;,; 180
		FlankedDelay 		=  GENERAL_UNIT_FLANKED_DELAY ;,; 4000
		ObjectStatusOfContained = 
		InitialPayload 		= GondorTowerShieldGuard GOOD_MEN_GIANT_HORDE_SIZE
		Slots 			= 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
			FacingBonus	= 30.0
			AngleLimitCos	= -0.17
			InnerRange	= 30
			OuterRange	= 80
			OuterRangeBuildings	= 140
		End

		// Banner Carrier info		
		BannerCarriersAllowed	= GondorInfantryBanner										// types of units that are allowed as banner carriers
		BannerCarrierPosition	= UnitType:GondorFighter	Pos:X:70.0 Y:0.0		// (DEFAULT) position of banner carrier
		
		RankInfo = RankNumber:1 UnitType:GondorTowerShieldGuard 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:GondorTowerShieldGuard 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:GondorTowerShieldGuard 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
		
		RanksToReleaseWhenAttacking = 1 2 3 ;;,;; 1 

		AlternateFormation = GondorTowerShieldGuardHordeWallFormation
		MeleeAttackLeashDistance = 50 ;;,;; 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			=	INFANTRY_FEAR_SCAN_RADIUS

		AddEmotion			=	Terror_Base
		AddEmotion			=	Doom_Base
		//	AddEmotion			=   BraceForBeingCrushed_Base		// Pikemen don't fear getting crushed
		AddEmotion			=	UncontrollableFear_Base
		AddEmotion			=	FearIdle_Base
		AddEmotion			=	FearBusy_Base
		AddEmotion			=	Point_Base
		
		AddEmotion			=	OVERRIDE Taunt_Base	
 		//	AttributeModifier	=	GondorFighterTaunt
 		End		
 		
		AddEmotion	=	CheerIdle_Base
		AddEmotion	=	CheerBusy_Base
		AddEmotion	=	HeroCheerIdle_Base
		AddEmotion	=	HeroCheerBusy_Base
		AddEmotion	=	Alert_Base
	End
	
	Behavior = PickupStuffUpdate ModuleTag_PickupStuffUpdate
		SkirmishAIOnly = Yes
		StuffToPickUp = NONE +CRATE
		ScanRange = 200
		ScanIntervalSeconds = 0.5
	End

	LocomotorSet
		Locomotor     = NormalMeleeHordeLocomotor
		Condition     = SET_NORMAL
		Speed         = NORMAL_FOOT_SLOW_HORDE_SPEED
	End
	
	;,; 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_GondorForgedBlades
	End
	Behavior = AttributeModifierUpgrade ModuleTag_UpgradeTriggerArmor
		TriggeredBy = PERSONAL_HEAVY_ARMOR_TIERS_UPGRADE_LIST
		AttributeModifier = Modifier_GondorHeavyArmor
	End
	Behavior = AttributeModifierUpgrade ModuleTag_UpgradeTriggerTierBlades
		TriggeredBy = Upgrade_GondorForgedBlades
		AttributeModifier = Modifier_TieredBlades
	End
	Behavior = AttributeModifierUpgrade ModuleTag_UpgradeTriggerTierArmor
		TriggeredBy = Upgrade_GondorHeavyArmor
		AttributeModifier = Modifier_TieredArmor
	End

	Behavior = ProductionUpdate ProductionUpdateModuleTag
		GiveNoXP = Yes
	End

	Behavior = LevelUpUpgrade ModuleTag_BasicTraining
		TriggeredBy = Upgrade_GondorBasicTraining
		LevelsToGain = 1
		LevelCap = 2
	End
	
	Behavior = StatusBitsUpgrade ModuleTag_ProductionLegality
		TriggeredBy = Upgrade_GondorForgedBlades
	End
	
	Behavior = StatusBitsUpgrade ModuleTag_ProductionLegality2
		TriggeredBy = Upgrade_GondorHeavyArmor
	End
	
	/////////////////////
	// AISpecialPowers
	/////////////////////
	
	Behavior = AISpecialPowerUpdate GondorTowerShieldGuardHordeCaptureBuildingAI
		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

	
	Geometry = BOX
	GeometryMajorRadius = 30.0
	GeometryMinorRadius = 45.0
	GeometryHeight = 20.0
	GeometryIsSmall = No
	
	
	// *** AUTO RESOLVE DATA *** 
	AutoResolveUnitType = AutoResolveUnit_Pikemen
	AutoResolveCombatChain = AutoResolve_PikemenCombatChain
	
	AutoResolveBody = AutoResolve_GondorTowerGuardHordeBody
	
	AutoResolveArmor
		RequiredUpgrades = Upgrade_GondorHeavyArmor
		Armor = AutoResolve_GondorTowerGuardHeavyArmor
	End

	AutoResolveArmor
		ExcludedUpgrades = Upgrade_GondorHeavyArmor
		Armor = AutoResolve_GondorTowerGuardArmor
	End

	AutoResolveWeapon
		RequiredUpgrades = Upgrade_GondorForgedBlades
		Weapon = AutoResolve_GondorTowerGuardUpgradedWeapon
	End

	AutoResolveWeapon
		ExcludedUpgrades = Upgrade_GondorForgedBlades
		Weapon = AutoResolve_GondorTowerGuardWeapon
	End
	
	WorldMapArmoryUpgradesAllowed = Upgrade_GondorBasicTraining Upgrade_GondorForgedBlades Upgrade_GondorHeavyArmor	
End
			
ChildObject GondorTowerShieldGuardHorde_Summoned GondorTowerShieldGuardHorde
	IsTrainable	=	No
	CommandPoints 	=	0
	CommandSet	=	GondorTowerShieldGuardCommandSet_Summoned
	EquivalentTo  	=	GondorTowerShieldGuardHorde

	KindOf = SUMMONED SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT INFANTRY HORDE ARMY_SUMMARY MELEE_HORDE PIKE LARGE_RECTANGLE_PATHFIND

	DisplayName 	= OBJECT:HordeGondorTowerGuard
	
	Behavior 	= HordeContain ModuleTag_HordeContain
		FrontAngle 	= 270 ;,; 180
		FlankedDelay 	=  GENERAL_UNIT_FLANKED_DELAY ;,; 4000
		ObjectStatusOfContained = 
		InitialPayload 	= GondorTowerShieldGuard_Summoned GOOD_MEN_GIANT_HORDE_SIZE
		Slots 		= 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
			FacingBonus		=	30.0
			AngleLimitCos		=	-0.17
			InnerRange		=	30
			OuterRange		=	80
			OuterRangeBuildings	=	140
		End

		RankInfo = RankNumber:1 UnitType:GondorTowerShieldGuard_Summoned 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:GondorTowerShieldGuard_Summoned 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:GondorTowerShieldGuard_Summoned 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
		
		RanksToReleaseWhenAttacking = 1 2 3 ;;,;; 1 

		AlternateFormation = GondorTowerShieldGuardHordeWallFormation
		MeleeAttackLeashDistance 	= 50 ;;,;; 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 = LifetimeUpdate ModuleTag_LifetimeUpdate
	// This one displays the timer, but the one in the uint does the work 
		MinLifetime		= CREATE_A_HERO_REINFORCEMENT_LIFETIME
		MaxLifetime		= CREATE_A_HERO_REINFORCEMENT_LIFETIME
		DeathType		= FADED
	End	
End

ChildObject GondorTowerShieldGuardHordePorcupine GondorTowerShieldGuardHorde

	// Note - for alternate formations, all info outside of the Contain Behavior module is ignored.
	// Any modifications need to be done via the Attribute Modifiers in the contain module. 
	Behavior = HordeContain ModuleTag_HordeContain
		FrontAngle = 360	//	Can't be flanked
		FlankedDelay =  GENERAL_UNIT_FLANKED_DELAY ;,; 2000
		ObjectStatusOfContained = 
		InitialPayload					= GondorTowerShieldGuard GOOD_MEN_HORDE_SIZE
		Slots							= 15
		PassengerFilter					= NONE +INFANTRY
		ShowPips						= No
		ThisFormationIsTheMainFormation = No	//Used to determine which armorset to use (and anything else we want!)
		RandomOffset					= X:2 Y:1
		RanksToReleaseWhenAttacking		= 0
		RanksToJustFreeWhenAttacking   = 0
		AttributeModifiers				= GondorTowerShieldGuardHordePorcupine
		IsPorcupineFormation			= Yes
		MinimumHordeSize				= 5

		AlternateFormation				= GondorTowerShieldGuardHorde
		VisionRearOverride				= 100%
		VisionSideOverride				= 100%
		NotComboFormation				= Yes // this formation is not suitable for combo, so it will switch out of this when combo-ing

		// Banner Carrier info		
		BannerCarriersAllowed			= GondorInfantryBanner												// types of units that are allowed as banner carriers
		BannerCarrierPosition			= UnitType:GondorTowerShieldGuard	Pos:X:0.0 Y:0.0		// (DEFAULT) position of banner carrier
		
		RankInfo	= RankNumber:1 UnitType:GondorTowerShieldGuard Position:X:20 Y:0	Position:X:-16.18 Y:11.76		Position:X:6.18 Y:-19.02	Position:X:6.18 Y:19.02	Position:X:-16.18 Y:-11.76	Position:X:36.54 Y:16.27	Position:X:-39.13 Y:8.32	Position:X:26.77 Y:-29.73	Position:X:-4.18 Y:39.78	Position:X:-20 Y:-34.64	Position:X:26.77 Y:29.73	Position:X:-39.13 Y:-8.32	Position:X:36.54 Y:-16.27	Position:X:-20 Y:34.64	Position:X:-4.18 Y:-39.78

	End
End

ChildObject GondorTowerShieldGuardHordeWallFormation GondorTowerShieldGuardHorde

	; Note - for alternate formations, all info outside of the Contain Behavior module is ignored.
	; Any modifications need to be done via the Attribute Modifiers in the contain module. 
	Behavior = HordeContain ModuleTag_HordeContain
		ObjectStatusOfContained = 
		InitialPayload					= GondorTowerShieldGuard GOOD_MEN_GIANT_HORDE_SIZE
		Slots							= 15
		PassengerFilter					= NONE +INFANTRY
		ShowPips						= No
		ThisFormationIsTheMainFormation = No	;Used to determine which armorset to use (and anything else we want!)
		RandomOffset					= X:2 Y:1
		RanksToReleaseWhenAttacking		= 1
		RanksToJustFreeWhenAttacking   = 1
		AttributeModifiers				= GondorTowerShieldGuardWall

		; Banner Carrier info		
		BannerCarriersAllowed	= GondorBanner												; types of units that are allowed as banner carriers
		BannerCarrierPosition	= UnitType:GondorTowerShieldGuard	Pos:X:-15.0 Y:0.0		; (DEFAULT) position of banner carrier
	
		AlternateFormation				= GondorTowerShieldGuardHorde
		NotComboFormation				= Yes ; this formation is not suitable for combo, so it will switch out of this when combo-ing

		; Banner Carrier info		
		BannerCarriersAllowed	= GondorBanner												; types of units that are allowed as banner carriers
		BannerCarrierPosition	= UnitType:GondorTowerShieldGuard	Pos:X:20.0 Y:0.0		; (DEFAULT) position of banner carrier
		
		RankInfo	= RankNumber:1 UnitType:GondorTowerShieldGuard Position:X:0 Y:0	Position:X:0 Y:15	Position:X:0 Y:-15		Position:X:0 Y:30	Position:X:0 Y:-30		
	End
End

In Topic: Need a tutorial on modeling buildings.

19 July 2020 - 01:33 PM

You must check the "Shadw" box in w3d tools to have shadows on the building model.

You'll also need to separate your level 2 and level 3 upgrades to different objects and check "hide" box in w3d tools for these.


In Topic: Some ROTWK 3d-modelling and texturing questions

05 July 2020 - 06:35 AM

Thank you for answer, Kwen.
Never knew about LUA scripting option for randomizing textures, but I'll try it. Can you explain what's the problem with randomizing models in ini files? BFME engine has some limitations for it?

Also, it appears that I actually knew how to add new and multiple textures to the models and how to randomize meshes through ini. Most of my problems happened because my asset.dat generated incorrectly so I thought that I missed something in adding new textures and models before I noticed that my asset.dat has incorrect size.