Jump to content


Photo

Making a new Building


  • Please log in to reply
16 replies to this topic

#1 Missile157

Missile157
  • Members
  • 25 posts

Posted 04 February 2013 - 05:21 PM

Hello people,

This is my first post on this forum and I'm relatively new to modding ROTWK (I have been experiment by adding units to buildings etc) but I would like some help. I have currently installed RJ's mod and I was trying to add a new building on top of this: a Fiefdom Barracks, to allow Gondor to produce all the lovely Fiefdom units he has created, without using his inn system. 

 

So I created a new building ini fiefdom barracks, a copy of another one of his files "Arnor Barracks". I then placed this file in the Men structures (strangely the file is not called Gondor). I then copied the Arnor Barracks W3D file, renamed it "fiefdombarracks" and saved it in the art files. I then edited the commandset so my building could produce all the desired units.

 

But here's the problem I also added it to the porter file for Gondor, but when I try to open the game, it that this is where the error is occurring.

I'm guessing I need a separate file so the porter knows what to do, or maybe I'm wrong entirely.

 

If anyone could help me I would appreciate it greatly and if you need me to post any code I'll do that, of course.

 

Thanks in advance and I hope I'm not breaking any of the rules by trying to edit someone else's mod. 



#2 Bofur

Bofur

    The Bolicious One

  • Hosted
  • 1,766 posts
  • Location:England
  • Projects:Age of the Firstborn
  •  The Bolicious T3A Team Chamber Member

Posted 04 February 2013 - 07:08 PM

You should not have added it to the porter'ini, but create a new commandbutton for the new buildingsee here: http://www.the3rdage...item-67?addview


left64_by_obsidianlake-d5ruayp.pngAotF.pngright64_by_obsidianlake-d5ruf44.png


#3 Missile157

Missile157
  • Members
  • 25 posts

Posted 04 February 2013 - 08:03 PM

First of all thank you for the quick reply.

I have read the article and it uses this as an example code:

 

CommandButton Command_ConstructGondorFighterHorde
Command = UNIT_BUILD
Object = GondorFighterHorde
Options = CANCELABLE
TextLabel = CONTROLBAR:ConstructGondorFighterHorde
ButtonImage = BGBarracks_Soldiers
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipBuildGondorFighterHorde
Radial = Yes
InPalantir = Yes
ShowProductionCount = Yes 
End

 

I will make an attempt to edit this, to make a command to construct the "fiefdombarracks"

 

CommandButton Command_ConstructFiefdomBarracks
Command = STRUCTURE_BUILD
Object = FiefdomBarracks
Options = CANCELABLE
TextLabel = CONTROLBAR:ConstructFiefdomBarracks
ButtonImage = SHBuildingUpgradeGondorButton
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipBuildGondorFighterHorde
Radial = Yes
InPalantir = Yes
ShowProductionCount = Yes
End

 

However I am unsure about a few things:

What is the COMMAND for buillding a structure (there are no examples on the current commandbutton ini file)? I think its probably not STRUCTURE_BUILD but I had no examples to go by.

What should I do about TextLabel and DescriptLabel? Do I need to create some kind of text file to add a description or can I just leave them blank, or how can I make it just say nothing?

Are there any other glaring issues?

Thanks again.



#4 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 04 February 2013 - 08:15 PM

You should base it of a BUILDING Command don't you think :

 


CommandButton Command_PorterConstructMordorTrollCage
  Command          = DOZER_CONSTRUCT
  Object           = MordorTrollCage
  TextLabel        = CONTROLBAR:ConstructMordorTrollCage
  ButtonImage      = BMTrollCages
  ButtonBorderType = BUILD 
  DescriptLabel    = CONTROLBAR:ToolTipMordorTrollCage
  Radial           = Yes  
End
------------------------------------ see if this works ----------------------------
CommandButton Command_ConstructFiefdomBarracks
  Command          = DOZER_CONSTRUCT
  Object           = FiefdomBarracks
  TextLabel        = CONTROLBAR:ConstructFiefdomBarracks
  ButtonImage      = SHBuildingUpgradeGondorButton
  ButtonBorderType = BUILD 
  DescriptLabel    = CONTROLBAR:ToolTipFiefdomBarracks
  Radial           = Yes  
End

Edited by Rider of Rohan, 04 February 2013 - 08:20 PM.

99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#5 Missile157

Missile157
  • Members
  • 25 posts

Posted 04 February 2013 - 09:45 PM

Ok that's a much better idea, stupid me. I tried to find a building command but couldn't, should have looked harder.

Well anyway, I've put in that code and now there's no error message and the game runs, however it doesn't appear on my porter.

I'm guessing this is because its the 16th command on the porter, and it needs to be one of the first 6 to be on the Palantir.

I will try putting the command further up and see if it works.

 

EDIT: OK, I have implemented the changes after putting into slot 3 on the porter:

 

CommandSet MenPorterCommandSet 
   1  = Command_Stop
   2  = Command_PorterExtinguishFire 
   3  = Command_ConstructFiefdomBarracks
   4  = Command_PorterConstructMenFarm 
   5  = Command_PorterConstructMenBarracks 
   6  = Command_PorterConstructMenArcheryRange 
   7  = Command_PorterConstructMenStable 
   8  = Command_PorterConstructMenWorkshop 
   9  = Command_PorterConstructMenSentryTower 
   10 = Command_PorterConstructMenWell 
   11 = Command_PorterConstructMenStatue 
   12 = Command_PorterConstructMenBlacksmith 
   13 = Command_PorterConstructMenMarketPlace 
   14 = Command_PorterConstructMenWallHubOuter 
   15 = Command_PorterConstructMenFortress 
    
End

 

However instead of appearing on the Palantir as expected, it now appears with all the other buildings on the Toolbar, so I guess I have done something wrong. It also says that it is missing,it is greyed out, has no price and cannot be selected or built. I searched for the Toolbar ini and found: controlbarscheme but none of these had any code that related to any existing buildings.

 

So my question is: why is the building not appearing as a command button, but instead as a building on the controlbar? And why is it all greyed out? I'm guessing that more code needs to be added in a different place. It also says that the DesriptLabl is missing too.

 

 

EDIT2: Ok I had missed off the InPalantir line of the code which I have now added, but the button is still "MISSING" and greyed out. What do I need to do so that the building can be built?

 

EDIT3: Now I have managed to get rid of the MISSING messages, by creating the appropriate text code in the lotr.str file, however the persisting problem still remains: the barracks is greyed out and unbuildable. There is also no price for the Fiefdom Barracks, even though I have set it to 500 in its structure file. Any help would be appreciated but I'll keep experimenting and searching for answers.


Edited by Missile157, 05 February 2013 - 12:19 AM.


#6 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 05 February 2013 - 01:06 AM

Can you please put your code for the structure here so we can have a crack at it ;)


99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#7 Missile157

Missile157
  • Members
  • 25 posts

Posted 05 February 2013 - 04:04 PM

I don't know which exact bits of code you want so I'll post all of the ones I can think of, hope it's not too long. :)

 

Here's the commandbutton code:

;Fiefdom Barracks Construct
CommandButton Command_Constructfiefdombarracks
	Command          = DOZER_CONSTRUCT
	Object           = FiefdomBarracks
	TextLabel        = CONTROLBAR:ConstructFiefdomBarracks
	ButtonImage      = SHBuildingUpgradeGondorButton
	ButtonBorderType = BUILD 
	DescriptLabel    = CONTROLBAR:ToolTipFiefdomBarracks
	Radial           = Yes 
	InPalantir       = Yes 

End

 

 

And here's the code for the building itself, this was copied directly from another RJ-ROTWK file, "arnorbarracks" so this is probably where the problem is, I probably haven't changed enough. I have copied and renamed the W3D file of the "arnorbarracks" to "fiefdombarracks" and placed it in the art folder to avoid the error command about each structure must have a unique W3D file.

;------------------------------------------------------------------------------ 
;Fiefdom Barracks
Object Fiefdom Barracks

	SelectPortrait = RJArnorBarracksPortrait
 
  ; *** ART Parameters ***
;  SelectPortrait         = SNReactor_L
;  ButtonImage            = SNReactor
  ;day

  Draw = W3DScriptedModelDraw ModuleTag_Draw

	ExtraPublicBone = ARROW01
	ExtraPublicBone = ARROW02
	ExtraPublicBone = ARROW03
	ExtraPublicBone = ARROW04
	ExtraPublicBone = ARROW05
	ExtraPublicBone = ARROW06
	ExtraPublicBone = ARROW07
	ExtraPublicBone = ARROW08
  
    OkToChangeModelColor  = No
    UseStandardModelNames = Yes
    StaticModelLODMode = yes ; Will append M or L to the skin name depending on GameLOD

    DefaultModelConditionState
		Model = fiefdombarracks
		WeaponLaunchBone = PRIMARY ARROW
    End
    
	;//	Animation state for build placement cursor
	AnimationState = BUILD_PLACEMENT_CURSOR
		BeginScript
			CurDrawableHideSubObject("V2")
   			CurDrawableHideSubObject("V2_HIDE")
   			CurDrawableHideSubObject("V3")
		EndScript
	End
	
	;//	Animation state for phantom structure
	AnimationState = PHANTOM_STRUCTURE
		BeginScript
			CurDrawableHideSubObject("V2")
   			CurDrawableHideSubObject("V2_HIDE")
   			CurDrawableHideSubObject("V3")
		EndScript
	End
		
	        
   IdleAnimationState
		Animation = IDLE
			AnimationName		=	arbarracks.arbarracks
			AnimationMode			=	ONCE	
			AnimationBlendTime = 0
		End		
		Animation = IDLE
			AnimationName		=	arbarracks.arbarracks
			AnimationMode			=	ONCE	
			AnimationBlendTime = 0
		End
;;		ParticleSysBone   = GLOWBONE06 TorchGlow FollowBone:Yes
;;		ParticleSysBone   = GLOWBONE11 TorchGlow FollowBone:Yes		
			
	End	


    ;------------ New Build Up States coming soon. 
	ModelConditionState = AWAITING_CONSTRUCTION SNOW
		Model	= GBBarracks_A		
		Texture = GBBarracks_New.tga GBBarracks_New_Snow.tga
		Texture	= GBVet.tga GBVet_snow.tga
    End    
    ModelConditionState   = AWAITING_CONSTRUCTION 
      Model               = arbarracks_a
;		ParticleSysBone	  = NONE BuildingDoughnutCloud
    End;

    AnimationState        = AWAITING_CONSTRUCTION
      Animation           =  arbarracks_a
        AnimationName     =  arbarracks_a.arbarracks_a
        AnimationMode     = MANUAL
        AnimationBlendTime = 0
      End
	  Flags				  = START_FRAME_FIRST
    End

	ModelConditionState = ACTIVELY_BEING_CONSTRUCTED PARTIALLY_CONSTRUCTED SNOW
		Model	= arbarracks_a
;		Texture = GBBarracks_New.tga GBBarracks_New_Snow.tga
;		Texture	= GBVet.tga GBVet_snow.tga
    End

    ModelConditionState   = ACTIVELY_BEING_CONSTRUCTED PARTIALLY_CONSTRUCTED
      Model               = arbarracks_a
		ParticleSysBone   = CONSTDUSTBONE01 BuildingContructDust FollowBone:Yes
    End;

    AnimationState        = ACTIVELY_BEING_CONSTRUCTED PARTIALLY_CONSTRUCTED
		Animation           = GBBarracks_A
			AnimationName     = arbarracks_a.arbarracks_a
			AnimationMode     = MANUAL
			AnimationBlendTime = 0
		End
		Flags				  = START_FRAME_FIRST
		StateName			  = BeingConstructed
		BeginScript
			CurDrawablePlaySound("GondorBarracksBeginConstruction")
			CurDrawableHideSubObject("V2")
   			CurDrawableHideSubObject("V2_HIDE")
   			CurDrawableHideSubObject("V3")
		EndScript
    End
    
	    
        ;--damaged building
    
    ModelConditionState  = DAMAGED
      Model         = arbarracks
			Texture	= arbarracks.tga arbarracks_d.tga
		ParticleSysBone FireSmall01 FireBuildingLarge
		ParticleSysBone FireSmall02 FireBuildingMedium
		ParticleSysBone FireSmall03 FireBuildingMedium
		ParticleSysBone FireSmall04 FireBuildingMedium
		ParticleSysBone FireSmall05 SmokeBuildingLarge
    End
    AnimationState = DAMAGED
		EnteringStateFX	= FX_BuildingDamaged
    End

    ModelConditionState  = REALLYDAMAGED
      Model         = arbarracks
			Texture	= arbarracks.tga arbarracks_d.tga
		ParticleSysBone FireSmall01 FireBuildingLarge
		ParticleSysBone FireSmall02 FireBuildingLarge
		ParticleSysBone FireSmall03 FireBuildingMedium
		ParticleSysBone FireSmall04 FireBuildingMedium
		ParticleSysBone FireSmall05 SmokeBuildingLarge
	
    End
    AnimationState = REALLYDAMAGED
		EnteringStateFX	= FX_BuildingReallyDamaged
		Animation				=	RubbleAnimation
				AnimationName		=	GBBarracks_D2SK.GBBarracks_D2AN
				AnimationMode		=	ONCE
  		End
    End

    ModelConditionState  = RUBBLE
      Model         = arbarracks
			Texture	= arbarracks.tga arbarracks_d.tga
      ParticleSysBone SmokeLarge01 SmokeBuildingLarge
    End
    
    AnimationState = RUBBLE
      Animation				=	RubbleAnimation
			AnimationName		=	GBBarracks_D3SK.GBBarracks_D3AN
			AnimationMode		=	ONCE
  	  End
  	  EnteringStateFX	= FX_StructureMediumCollapse
    End

    ModelConditionState  = POST_RUBBLE
		Model         = None
		ParticleSysBone NONE SmokeBuildingMediumRubble
    End

    ModelConditionState  = POST_COLLAPSE
		 Model         = None
		ParticleSysBone NONE SmokeBuildingMediumRubble
    End
    
	ModelConditionState = SNOW
		Model	= arbarracks
;		Texture = GBBarracks_New.tga GBBarracks_New_Snow.tga
;		Texture	= GBVet.tga GBVet_snow.tga
    End
    
End

  
;	Draw = W3DFloorDraw ModuleTag_DrawFloor
;		StaticModelLODMode	= Yes		; THIS NEEDS TO BE COMMENTED OUT WHEN ENGINEERING ENABLES LOD'S IN THE FLOOR DRAW
;		ModelName			= arbarra_bib
;;		WeatherTexture		= SNOWY GBBarracksBib_Snow.tga
;  		HideIfModelConditions	=	AWAITING_CONSTRUCTION
;  		HideIfModelConditions	=	PARTIALLY_CONSTRUCTED
;	End
  
;  Draw = W3DScriptedModelDraw ModuleTag_Draw_HCBanner
;	OkToChangeModelColor  = Yes
;	DefaultModelConditionState
;		Model = GBHCBarracks
;	End
;	MultiPlayerOnly = Yes 
;  End
  
  PlacementViewAngle  = -135

  Scale = 1.4

  ; ***DESIGN parameters ***

  DisplayName         = OBJECT:FiefdomBarracks
  Description 	      = OBJECT:FiefdomBarracksDescription
  Side                = Men
  EditorSorting       = STRUCTURE
  ThreatLevel = 1.0
 
  BuildCost           = 500
  BuildTime           = 30	; in seconds
  BountyValue         = 250
  VisionRange         = 160.0          			; Shroud clearing distance
  ShroudClearingRange = 200.0


  
  ArmorSet
    Conditions        = None
    Armor             = FactoryArmor
    ;DamageFX         = StructureDamageFXNoShake
  End
  CommandSet          = FiefdomBarracksCommandSet

	WeaponSet
		Conditions		= None
	End

	WeaponSet
		Weapon			= PRIMARY GondorStructureBow
		Conditions		= PLAYER_UPGRADE
		AutoChooseSources	= PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
	End
 

  ; *** AUDIO Parameters ***

	#include "..\..\..\Includes\StandardBuildingEvaEvents.inc"

	VoiceSelect		= GondorBarracksSelect

	SoundAmbientDamaged		= BuildingDamageFireMediumLoop
	SoundAmbientReallyDamaged	= BuildingDamageFireLargeLoop
	SoundOnDamaged			= BuildingLightDamageStone
	SoundOnReallyDamaged		= BuildingHeavyDamageStone
 
	VoiceSelectUnderConstruction	= BuildingGoodVoiceSelectUnderConstruction
	VoiceFullyCreated		= EVA:MenBarracksComplete

	UnitSpecificSounds
		UnderConstruction	= BuildingConstructionLoop  	; Built first time
		; UnderRepairFromDamage	= NoSound			; Repaired No animation on the building, so don't bother playing sound
		UnderRepairFromRubble	= BuildingConstructionLoop	; Repaired from completely destroyed (not used???)
	End


  ; *** ENGINEERING Parameters ***

  RadarPriority       = STRUCTURE
  KindOf              = PRELOAD STRUCTURE SELECTABLE IMMOBILE SCORE FS_FACTORY AUTO_RALLYPOINT MP_COUNT_FOR_VICTORY NEED_BASE_FOUNDATION ATTACK_NEEDS_LINE_OF_SIGHT CAN_ATTACK MADE_OF_STONE LIVING_WORLD_BUILDING_MIRROR
 
  Behavior            = GettingBuiltBehavior ModuleTag_04
    WorkerName	= GondorWorkerNoSelect
    SpawnTimer	= RJ_DEFAULT_STRUCTURE_HEALDELAY
  End

	Behavior = AIUpdateInterface ModuleTag_SoWeCanUseWeapon
		AutoAcquireEnemiesWhenIdle	= Yes
		MoodAttackCheckRate		= 250
	End

;  Behavior = OpenContain OpenContainModuleTag_01
;    ContainMax         = 1
; 	AllowAlliesInside  = Yes
; 	AllowEnemiesInside = No
; 	AllowNeutralInside = No
;  End

	Body = ActiveBody ModuleTag_05
		MaxHealth			= RJ_ARNOR_BARRACKS_HEALTH
		MaxHealthDamaged		= RJ_ARNOR_BARRACKS_HEALTH_DAMAGED
		MaxHealthReallyDamaged		= RJ_ARNOR_BARRACKS_HEALTH_REALLY_DAMAGED
		DamageCreationList		= OCL_BuildingDamageList01 CATAPULT_ROCK

		DamageCreationList		= OCL_GBBarracksN2D2_Chunk1 CATAPULT_ROCK FRONT_DESTROYED
		DamageCreationList		= OCL_GBBarracksN2D2_Chunk2 CATAPULT_ROCK RIGHT_DESTROYED
		DamageCreationList		= OCL_GBBarracksN2D2_Chunk3 CATAPULT_ROCK BACK_DESTROYED
		DamageCreationList		= OCL_GBBarracksN2D2_Chunk4 CATAPULT_ROCK LEFT_DESTROYED
	End

  Flammability	; should be after the 'Body' statement
	Fuel		=	RJ_MEN_BARRACKS_FIRE_FUEL
	MaxBurnRate	=	RJ_MEN_BARRACKS_FIRE_MAX_BURN_RATE
	Decay		=	RJ_MEN_BARRACKS_FIRE_DECAY
	Resistance	=	RJ_MEN_BARRACKS_FIRE_RESISTANCE
  End

	Behavior = RefundDie ModuleTag_refund
		UpgradeRequired = Upgrade_MarketplaceUpgradeDefiance
		BuildingRequired = ANY +ArnorMarketPlace
		RefundPercent = 50%
	End

  Behavior = ProductionUpdate ModuleTag_06
		GiveNoXP		= No
  End

  Behavior = QueueProductionExitUpdate ModuleTag_07
    UnitCreatePoint		= X:12.0 Y:0.0 Z:0.0
    NaturalRallyPoint		= X:90.0 Y:0.0 Z:0.0
    ExitDelay			= RJ_STANDARD_HORDE_EXIT_DELAY
    PlacementViewAngle		= 45
  End
  
  Behavior                  = StructureCollapseUpdate ModuleTag_08
    MinCollapseDelay        = 000
    MaxCollapseDelay        = 000
    CollapseDamping         = .5
    MaxShudder              = 0.6
    MinBurstDelay           = 250
    MaxBurstDelay           = 800
    BigBurstFrequency       = 4
    FXList                  = INITIAL   FX_StructureMediumCollapse
    FXList                  = ALMOST_FINAL  FX_StructureAlmostCollapse
	DestroyObjectWhenDone	= Yes
	CollapseHeight			= 155
  End
  
	Behavior = TerrainResourceBehavior ModuleTag_NewMoneyDeadSpot
		Radius = 55		; How far we try to claim ground
		MaxIncome = 0	; If we were to get all we wanted, how much we would earn.  Linear slope to 0 at 0% claim
		IncomeInterval = 999999	; How often (in msec) we give that much money
		HighPriority = Yes ; A high priority claim gets to pretend it was there first.
		Visible = No 		;// Don't show decal when a resource building is selected.
	End


;  Behavior = FlammableUpdate ModuleTag_14
;    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
;    AflameDamageAmount = 5       ; taking this much damage...
;    AflameDamageDelay = 500       ; this often.
;  End
 
;  Behavior = TransitionDamageFX ModuleTag_15
;    ;-------------DESIGNED FOR SMALL SIZED FACTION BUILDING TRANSITIONS-------------------
;    DamagedParticleSystem1       = Bone:None RandomBone:No PSys:StructureTransitionSmallSmoke
;    ;---------------------------------------------------------------------------------------
;    ReallyDamagedParticleSystem1 = Bone:None RandomBone:No PSys:StructureTransitionSmallSmoke
;    ReallyDamagedParticleSystem2 = Bone:None RandomBone:No PSys:StructureTransitionSmallExplosion
;    ReallyDamagedParticleSystem3 = Bone:None RandomBone:No PSys:StructureTransitionSmallShockwave
;  End
 
;	AttackContactPoint = X:-24 Y:-24 Z:92
;	GeometryContactPoint = X:-56	Y:60	Z:0		Repair
 ; 	GeometryContactPoint = X:56	Y:-63	Z:0		Repair
;	GeometryContactPoint = X:-39 Y: 39 Z:0 Repair
;	GeometryContactPoint = X:10 Y: 10 Z:0 Bomb

	Behavior = SubObjectsUpgrade ModuleTag_HideAll
		TriggeredBy		= Upgrade_StructureLevel1
		HideSubObjects	= V2 V2_HIDE V3
	End

	Behavior = SubObjectsUpgrade ModuleTag_ShowWallsAndFlag
		TriggeredBy		= Upgrade_ArnorBarracksLevel2
		ShowSubObjects	= V2 V2_HIDE
		HideSubObjects	= V1_HIDE1 V1_HIDE2 V3
	End

	Behavior = SubObjectsUpgrade ModuleTag_ShowTowersAndHideFlag
		TriggeredBy		= Upgrade_ArnorBarracksLevel3
		ShowSubObjects	= V2 V3
		HideSubObjects	= V1_HIDE1 V1_HIDE2 V2_HIDE
	End
	
	Behavior = GeometryUpgrade Geom_ModuleTag_HideAll
		TriggeredBy		= Upgrade_StructureLevel1
		ShowGeometry		= Geom_Orig
		HideGeometry		= Geom_V2 Geom_V1_Hide Geom_V1 Main_Hide Geom_Limit
	End
	Behavior = GeometryUpgrade Geom_ModuleTag_ShowWalls 
		TriggeredBy		= Upgrade_ArnorBarracksLevel2
		ShowGeometry		= Geom_V1_Hide Geom_V1
		HideGeometry		= Geom_V2  Geom_Orig Main_Hide Geom_Limit
	End
  	Behavior = GeometryUpgrade Geom_ModuleTag_ShowFlagsAndTower 
		TriggeredBy		= Upgrade_ArnorBarracksLevel3
		ShowGeometry		= Geom_V1 Geom_V2 
		HideGeometry		= Geom_V1_Hide Geom_Orig Main_Hide Geom_Limit
	End
	
  	Behavior = WeaponSetUpgrade ModuleTag_ThirdLevelBuildingArrows
		TriggeredBy		= Upgrade_ArnorBarracksLevel3
		ConflictsWith	= Upgrade_EasyAIMultiPlayer
	End

	Behavior = CommandSetUpgrade ModueTag_BarracksLevel2CommandSet
		TriggeredBy			= Upgrade_ArnorBarracksLevel2
		ConflictsWith		= Upgrade_ArnorBarracksLevel3
		CommandSet			= ArnorBarracksCommandSetLevel2
	End   

	Behavior = CommandSetUpgrade ModueTag_BarracksLevel3CommandSet
		TriggeredBy			= Upgrade_ArnorBarracksLevel3		
		CommandSet			= ArnorBarracksCommandSetLevel3
	End   

	Behavior = LevelUpUpgrade ModuleTag_BarracksLevel2
		TriggeredBy    = Upgrade_ArnorBarracksLevel2      
		LevelsToGain   = 1
		LevelCap       = 2
	End

	Behavior = LevelUpUpgrade ModuleTag_BarracksLevel3
		TriggeredBy    = Upgrade_ArnorBarracksLevel3      
		LevelsToGain   = 1
		LevelCap       = 3
	End

	Behavior                  = BuildingBehavior BuildingModuleTag
		NightWindowName         = N_Window
		;FireWindowName          = WINDOW_F01
	End
	
	;; This is required for setting rally points which needs a small geometry to determine if quick path exists in tight spaces
	;; If this was any bigger, it would fail to create the rallu points when in a camp or castle.
	Geometry			= BOX
	GeometryName			= Geom_Orig
	GeometryMajorRadius		= 30.0
	GeometryMinorRadius		= 30.0
	GeometryHeight			= 50.0
	GeometryOffset			= X:4 Y:0 Z:0

	AdditionalGeometry		= CYLINDER
	GeometryName			= Geom_V1_Hide
	GeometryMajorRadius		= 23.0
	GeometryHeight			= 66.0
	GeometryOffset			= X:0 Y:0 Z:0

	AdditionalGeometry		= CYLINDER
	GeometryName			= Geom_V2
	GeometryMajorRadius		= 23.0
	GeometryHeight			= 95.0
	GeometryOffset			= X:0 Y:0 Z:0

	AdditionalGeometry		= BOX
	GeometryName			= Geom_Limit
	GeometryMajorRadius		= 35.0
	GeometryMinorRadius		= 40.0
	GeometryHeight			= 50.0
	GeometryOffset			= X:4.0 Y:0.0 Z:0

	GeometryIsSmall			= No
	Shadow				= SHADOW_VOLUME
	BuildCompletion			= PLACED_BY_PLAYER

  	GeometryContactPoint		= X:23.809	Y:17.368	Z:0		Repair
	GeometryContactPoint		= X:23.809	Y:-17.368	Z:0		Repair
	AttackContactPoint		= X:22.611	Y:0		Z:0
	AttackContactPoint		= X:-28.741	Y:-1.333	Z:0
	GeometryContactPoint		= X:0		Y:0		Z:54.802	Swoop
End

;------------------------------------------------------------------------------
ChildObject BFME1ArnorBarracks ArnorBarracks

	PlacementViewAngle			= 225

	Behavior = CastleMemberBehavior ModuleTag_CMB
	End

	Draw = W3DFloorDraw ModuleTag_DrawFloor
		StaticModelLODMode		= Yes
		ModelName			= None
	End

	Behavior = TerrainResourceBehavior ModuleTag_NewMoneyDeadSpot
		Radius				= 0		; How far we try to claim ground
		MaxIncome			= 0		; If we were to get all we wanted, how much we would earn.  Linear slope to 0 at 0% claim
		IncomeInterval			= 999999	; How often (in msec) we give that much money
		HighPriority			= Yes		; A high priority claim gets to pretend it was there first.
		Visible				= No 		;// Don't show decal when a resource building is selected.
	End

End

I hope this helps and thanks for helping me. :)


Edited by Missile157, 05 February 2013 - 04:06 PM.


#8 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 05 February 2013 - 06:39 PM

;------------------------------------------------------------------------------ 
;Gondor Barracks
Object FiefdomBarracks

	SelectPortrait = BPGBarracks
 
  ; *** ART Parameters ***
;  SelectPortrait         = SNReactor_L
;  ButtonImage            = SNReactor
  ;day

  Draw = W3DScriptedModelDraw ModuleTag_Draw

	ExtraPublicBone = ARROW_01
	ExtraPublicBone = ARROW_02
	ExtraPublicBone = ARROW_05
	ExtraPublicBone = ARROW_06
	ExtraPublicBone = ARROW_07
	ExtraPublicBone = ARROW_08
	ExtraPublicBone = ARROW_09
	ExtraPublicBone = ARROW_10
	ExtraPublicBone = ARROW_11
	ExtraPublicBone = ARROW_12
	ExtraPublicBone = ARROW_15
	ExtraPublicBone = ARROW_16
	ExtraPublicBone = ARROW_17
	ExtraPublicBone = ARROW_18
	ExtraPublicBone = ARROW_19
	ExtraPublicBone = ARROW_20
	ExtraPublicBone = ARROW_21
	ExtraPublicBone = ARROW_22
	ExtraPublicBone = ARROW_23
  
    OkToChangeModelColor  = Yes
    UseStandardModelNames = Yes
    StaticModelLODMode = yes ; Will append M or L to the skin name depending on GameLOD
    DefaultModelConditionState
		Model = GBBarracks_SKN		
		WeaponLaunchBone = PRIMARY ARROW_
    End
    
	;//	Animation state for build placement cursor
	AnimationState = BUILD_PLACEMENT_CURSOR
		BeginScript
			CurDrawableHideSubObject("N_Window")
			CurDrawableHideSubObject("V1")
			CurDrawableHideSubObject("V1FLAG")
   			CurDrawableHideSubObject("V2")
   			CurDrawableHideSubObject("V2A")
		EndScript
	End
	
	;//	Animation state for phantom structure
	AnimationState = PHANTOM_STRUCTURE
		BeginScript
			CurDrawableHideSubObject("N_Window")
			CurDrawableHideSubObject("V1")
			CurDrawableHideSubObject("V1FLAG")
   			CurDrawableHideSubObject("V2")
   			CurDrawableHideSubObject("V2A")
		EndScript
	End
		
	        
   IdleAnimationState
		Animation = IDLE
			AnimationName		=	GBBarracks_2SKL.GBBarracks_2IDB
			AnimationMode			=	ONCE	
			AnimationBlendTime = 0
		End		
		Animation = IDLE
			AnimationName		=	GBBarracks_2SKL.GBBarracks_2IDA
			AnimationMode			=	ONCE	
			AnimationBlendTime = 0
		End
;;		ParticleSysBone   = GLOWBONE06 TorchGlow FollowBone:Yes
;;		ParticleSysBone   = GLOWBONE11 TorchGlow FollowBone:Yes		
			
	End	


    ;------------ New Build Up States coming soon. 
	ModelConditionState = AWAITING_CONSTRUCTION SNOW
		Model	= GBBarracks_A		
		Texture = GBBarracks_New.tga GBBarracks_New_Snow.tga
		Texture	= GBVet.tga GBVet_snow.tga
    End    
    ModelConditionState   = AWAITING_CONSTRUCTION 
      Model               = GBBarracks_A
;		ParticleSysBone	  = NONE BuildingDoughnutCloud
    End;
    AnimationState        = AWAITING_CONSTRUCTION
      Animation           =  GBBarracks_A
        AnimationName     =  GBBarracks_ASKL.GBBarracks_ABLD
        AnimationMode     = MANUAL
        AnimationBlendTime = 0
      End
	  Flags				  = START_FRAME_FIRST
    End

	ModelConditionState = ACTIVELY_BEING_CONSTRUCTED PARTIALLY_CONSTRUCTED SNOW
		Model	= GBBarracks_A		
		Texture = GBBarracks_New.tga GBBarracks_New_Snow.tga
		Texture	= GBVet.tga GBVet_snow.tga
    End   
    ModelConditionState   = ACTIVELY_BEING_CONSTRUCTED PARTIALLY_CONSTRUCTED
      Model               = GBBarracks_A
		ParticleSysBone   = CONSTDUSTBONE01 BuildingContructDust FollowBone:Yes
    End;
    AnimationState        = ACTIVELY_BEING_CONSTRUCTED PARTIALLY_CONSTRUCTED
		Animation           = GBBarracks_A
			AnimationName     = GBBarracks_ASKL.GBBarracks_ABLD
			AnimationMode     = MANUAL
			AnimationBlendTime = 0
		End
		Flags				  = START_FRAME_FIRST
		StateName			  = BeingConstructed
		BeginScript
			CurDrawablePlaySound("GondorBarracksBeginConstruction")
			CurDrawableHideSubObjectPermanently("V1")
			CurDrawableHideSubObjectPermanently("V1FLAG")
			CurDrawableHideSubObjectPermanently("V2")
		EndScript
    End
    
	    
        ;--damaged building
    
    ModelConditionState  = DAMAGED
      Model         = GBBarracks_D1  
		ParticleSysBone FireSmall01 FireBuildingLarge
		ParticleSysBone FireSmall02 FireBuildingMedium
		ParticleSysBone FireSmall03 FireBuildingMedium
		ParticleSysBone FireSmall04 FireBuildingMedium
		ParticleSysBone FireSmall05 SmokeBuildingLarge
    End
    AnimationState = DAMAGED
		EnteringStateFX	= FX_BuildingDamaged
    End

    ModelConditionState  = REALLYDAMAGED
      Model         = GBBarracks_D2  
		ParticleSysBone FireSmall01 FireBuildingLarge
		ParticleSysBone FireSmall02 FireBuildingLarge
		ParticleSysBone FireSmall03 FireBuildingMedium
		ParticleSysBone FireSmall04 FireBuildingMedium
		ParticleSysBone FireSmall05 SmokeBuildingLarge
	
    End
    AnimationState = REALLYDAMAGED
		EnteringStateFX	= FX_BuildingReallyDamaged
		Animation				=	RubbleAnimation
				AnimationName		=	GBBarracks_D2SK.GBBarracks_D2AN
				AnimationMode		=	ONCE
  		End
    End

    ModelConditionState  = RUBBLE
      Model         = GBBarracks_D3  
      ParticleSysBone SmokeLarge01 SmokeBuildingLarge
    End
    
    AnimationState = RUBBLE
      Animation				=	RubbleAnimation
			AnimationName		=	GBBarracks_D3SK.GBBarracks_D3AN
			AnimationMode		=	ONCE
  	  End
  	  EnteringStateFX	= FX_StructureMediumCollapse
    End

    ModelConditionState  = POST_RUBBLE
		Model         = None
		ParticleSysBone NONE SmokeBuildingMediumRubble
    End

    ModelConditionState  = POST_COLLAPSE
		 Model         = None
		ParticleSysBone NONE SmokeBuildingMediumRubble
    End
    
	ModelConditionState = SNOW
		Model	= GBBarracks_SKN		
		Texture = GBBarracks_New.tga GBBarracks_New_Snow.tga
		Texture	= GBVet.tga GBVet_snow.tga
    End
    
End

  
	Draw = W3DFloorDraw ModuleTag_DrawFloor    
		StaticModelLODMode	= Yes		; THIS NEEDS TO BE COMMENTED OUT WHEN ENGINEERING ENABLES LOD'S IN THE FLOOR DRAW
		ModelName			= GBBarracks_Bib
		WeatherTexture		= SNOWY GBBarracksBib_Snow.tga
  		HideIfModelConditions	=	AWAITING_CONSTRUCTION
  		HideIfModelConditions	=	PARTIALLY_CONSTRUCTED
	End
  
  Draw = W3DScriptedModelDraw ModuleTag_Draw_HCBanner
	OkToChangeModelColor  = Yes
	DefaultModelConditionState
		Model = GBHCBarracks
	End
	MultiPlayerOnly = Yes 
  End
  
  PlacementViewAngle  = 225

  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:FiefdomBarracks
  Description 	      = OBJECT:FiefdomBarracksDescription
  Side                = Men
  EditorSorting       = STRUCTURE
  ThreatLevel = 1.0
 
  BuildCost           = GONDOR_BARRACKS_BUILDCOST
  BuildTime           = GONDOR_BARRACKS_BUILDTIME          ; in seconds
  BountyValue         = GONDOR_BARRACKS_BOUNTY_VALUE
  VisionRange         = 160.0          ; Shroud clearing distance
  ShroudClearingRange = GONDOR_BARRACKS_SHROUD_CLEAR


  
  ArmorSet
    Conditions        = None
    Armor             = UnitProductionStructureArmor ; ;StructureArmor
    ;DamageFX          = StructureDamageFXNoShake
  End
  CommandSet          = GondorBarracksCommandSet

	WeaponSet
		Conditions			= None
	End

	WeaponSet
		Weapon				= PRIMARY GondorStructureBow
		Conditions			= PLAYER_UPGRADE
		AutoChooseSources	= PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
	End
 

  ; *** AUDIO Parameters ***

	#include "..\..\..\Includes\StandardBuildingEvaEvents.inc"

	VoiceSelect		= GondorBarracksSelect

	SoundAmbientDamaged				= BuildingDamageFireMediumLoop
	SoundAmbientReallyDamaged		= BuildingDamageFireLargeLoop
	SoundOnDamaged					= BuildingLightDamageStone
	SoundOnReallyDamaged			= BuildingHeavyDamageStone
 
	VoiceSelectUnderConstruction	= BuildingGoodVoiceSelectUnderConstruction
	VoiceFullyCreated				= EVA:MenBarracksComplete

	UnitSpecificSounds
		UnderConstruction		= BuildingConstructionLoop  ; Built first time
		; UnderRepairFromDamage	= NoSound					; Repaired No animation on the building, so don't bother playing sound
		UnderRepairFromRubble	= BuildingConstructionLoop	; Repaired from completely destroyed (not used???)
	End


  ; *** ENGINEERING Parameters ***

  RadarPriority       = STRUCTURE
  KindOf              = PRELOAD STRUCTURE SELECTABLE IMMOBILE SCORE FS_FACTORY AUTO_RALLYPOINT MP_COUNT_FOR_VICTORY NEED_BASE_FOUNDATION ATTACK_NEEDS_LINE_OF_SIGHT CAN_ATTACK MADE_OF_STONE LIVING_WORLD_BUILDING_MIRROR
 
  Behavior            = GettingBuiltBehavior ModuleTag_04
    WorkerName	= GondorWorkerNoSelect
    SpawnTimer	= DEFAULT_STRUCTURE_HEALDELAY
  End

	Behavior = AIUpdateInterface ModuleTag_SoWeCanUseWeapon
		AutoAcquireEnemiesWhenIdle	= Yes
		MoodAttackCheckRate			= 250
	End

;  Behavior = OpenContain OpenContainModuleTag_01
;    ContainMax         = 1
; 	AllowAlliesInside  = Yes
; 	AllowEnemiesInside = No
; 	AllowNeutralInside = No
;  End

  Body                    = ActiveBody ModuleTag_05
    MaxHealth             = GONDOR_BARRACKS_HEALTH
    MaxHealthDamaged      = GONDOR_BARRACKS_HEALTH_DAMAGED
	MaxHealthReallyDamaged  = GONDOR_BARRACKS_HEALTH_REALLY_DAMAGED
    DamageCreationList = OCL_BuildingDamageList01 CATAPULT_ROCK
    
    DamageCreationList = OCL_GBBarracksN2D2_Chunk1 CATAPULT_ROCK FRONT_DESTROYED
    DamageCreationList = OCL_GBBarracksN2D2_Chunk2 CATAPULT_ROCK RIGHT_DESTROYED
    DamageCreationList = OCL_GBBarracksN2D2_Chunk3 CATAPULT_ROCK BACK_DESTROYED
    DamageCreationList = OCL_GBBarracksN2D2_Chunk4 CATAPULT_ROCK LEFT_DESTROYED
    
  End

  Flammability	; should be after the 'Body' statement
	Fuel		=	MEN_BARRACKS_FIRE_FUEL	
	MaxBurnRate	=	MEN_BARRACKS_FIRE_MAX_BURN_RATE
	Decay		=	MEN_BARRACKS_FIRE_DECAY
	Resistance	=	MEN_BARRACKS_FIRE_RESISTANCE
  End

	Behavior = RefundDie ModuleTag_refund
		UpgradeRequired = Upgrade_MarketplaceUpgradeDefiance
		BuildingRequired = ANY +GondorMarketPlace
		RefundPercent = 50%
	End

  Behavior = ProductionUpdate ModuleTag_06
		GiveNoXP		= Yes    
  End

  Behavior = QueueProductionExitUpdate ModuleTag_07
    UnitCreatePoint		= X:-28.0 Y:-32.0 Z:0.0
    NaturalRallyPoint	= X:65.0 Y:70.0 Z:0.0
    ExitDelay			= STANDARD_HORDE_EXIT_DELAY
    PlacementViewAngle	= 45
  End
  
  Behavior                  = StructureCollapseUpdate ModuleTag_08
    MinCollapseDelay        = 000
    MaxCollapseDelay        = 000
    CollapseDamping         = .5
    MaxShudder              = 0.6
    MinBurstDelay           = 250
    MaxBurstDelay           = 800
    BigBurstFrequency       = 4
    FXList                  = INITIAL   FX_StructureMediumCollapse
    FXList                  = ALMOST_FINAL  FX_StructureAlmostCollapse
	DestroyObjectWhenDone	= Yes
	CollapseHeight			= 155
  End
  
	Behavior = TerrainResourceBehavior ModuleTag_NewMoneyDeadSpot
		Radius = 55		; How far we try to claim ground
		MaxIncome = 0	; If we were to get all we wanted, how much we would earn.  Linear slope to 0 at 0% claim
		IncomeInterval = 999999	; How often (in msec) we give that much money
		HighPriority = Yes ; A high priority claim gets to pretend it was there first.
		Visible = No 		;// Don't show decal when a resource building is selected.
	End

;  Behavior = FlammableUpdate ModuleTag_14
;    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
;    AflameDamageAmount = 5       ; taking this much damage...
;    AflameDamageDelay = 500       ; this often.
;  End
 
;  Behavior = TransitionDamageFX ModuleTag_15
;    ;-------------DESIGNED FOR SMALL SIZED FACTION BUILDING TRANSITIONS-------------------
;    DamagedParticleSystem1       = Bone:None RandomBone:No PSys:StructureTransitionSmallSmoke
;    ;---------------------------------------------------------------------------------------
;    ReallyDamagedParticleSystem1 = Bone:None RandomBone:No PSys:StructureTransitionSmallSmoke
;    ReallyDamagedParticleSystem2 = Bone:None RandomBone:No PSys:StructureTransitionSmallExplosion
;    ReallyDamagedParticleSystem3 = Bone:None RandomBone:No PSys:StructureTransitionSmallShockwave
;  End
 
;	AttackContactPoint = X:-24 Y:-24 Z:92
;	GeometryContactPoint = X:-56	Y:60	Z:0		Repair
 ; 	GeometryContactPoint = X:56	Y:-63	Z:0		Repair
;	GeometryContactPoint = X:-39 Y: 39 Z:0 Repair
;	GeometryContactPoint = X:10 Y: 10 Z:0 Bomb

	Behavior = SubObjectsUpgrade ModuleTag_HideAll
		TriggeredBy		= Upgrade_StructureLevel1
		HideSubObjects	= V1 V1FLAG V2 V2A V1_PIECE* V2_PIECE*
	End

	Behavior = SubObjectsUpgrade ModuleTag_ShowWallsAndFlag
		TriggeredBy		= Upgrade_GondorBarracksLevel2
		ShowSubObjects	= V1 V1FLAG V1_PIECE*
		HideSubObjects	= V2 V2A  V2_PIECE*
	End

	Behavior = SubObjectsUpgrade ModuleTag_ShowTowersAndHideFlag
		TriggeredBy		= Upgrade_GondorBarracksLevel3
		ShowSubObjects	= V1 V2 V2A V1_PIECE* V2_PIECE*
		HideSubObjects	= V1FLAG
	End
	
	Behavior = GeometryUpgrade Geom_ModuleTag_HideAll
		TriggeredBy		= Upgrade_StructureLevel1
		ShowGeometry	= Geom_Orig
		HideGeometry	= Geom_V2 
	End
	Behavior = GeometryUpgrade Geom_ModuleTag_ShowWalls 
		TriggeredBy		= Upgrade_GondorBarracksLevel2
		ShowGeometry	= Geom_Orig
		HideGeometry	= Geom_V2 
	End
  	Behavior = GeometryUpgrade Geom_ModuleTag_ShowFlagsAndTower 
		TriggeredBy		= Upgrade_GondorBarracksLevel3
		ShowGeometry	= Geom_V2
		HideGeometry	= Geom_Orig
	End
	
  	Behavior = WeaponSetUpgrade ModuleTag_ThirdLevelBuildingArrows
		TriggeredBy		= Upgrade_GondorBarracksLevel3
		ConflictsWith	= Upgrade_EasyAIMultiPlayer
	End

	Behavior = CommandSetUpgrade ModueTag_BarracksLevel2CommandSet
		TriggeredBy			= Upgrade_GondorBarracksLevel2
		ConflictsWith		= Upgrade_GondorBarracksLevel3
		CommandSet			= FiefdomBarracksCommandSetLevel2
	End   

	Behavior = CommandSetUpgrade ModueTag_BarracksLevel3CommandSet
		TriggeredBy			= Upgrade_GondorBarracksLevel3		
		CommandSet			= FiefdomBarracksCommandSetLevel3
	End  

        Behavior = LevelUpUpgrade ModuleTag_BarracksLevel2
		TriggeredBy    = Upgrade_GondorBarracksLevel2      
		LevelsToGain   = 1
		LevelCap       = 3
	End

	Behavior = LevelUpUpgrade ModuleTag_BarracksLevel3
		TriggeredBy    = Upgrade_GondorBarracksLevel3      
		LevelsToGain   = 1
		LevelCap       = 3
	End

	Behavior                  = BuildingBehavior BuildingModuleTag
		NightWindowName         = N_Window
		;FireWindowName          = WINDOW_F01
	End
	
  ;; This is required for setting rally points which needs a small geometry to determine if quick path exists in tight spaces
  ;; If this was any bigger, it would fail to create the rallu points when in a camp or castle.
  Geometry              = CYLINDER
  GeometryMajorRadius   = 8.0
  GeometryMinorRadius   = 8.0
  GeometryHeight        = 10

  ;; These are the actual building geometry pieces
  AdditionalGeometry    = BOX
  GeometryName			= Geom_Orig
  GeometryMajorRadius   = 20.0
  GeometryMinorRadius   = 20.0
  GeometryHeight        = 75.0
  GeometryOffset		= X:-22 Y:-30 Z:0

  AdditionalGeometry    = BOX
  GeometryName			= Geom_Orig
  GeometryMajorRadius   = 45.0
  GeometryMinorRadius   = 50.0
  GeometryHeight        = 40.0
  GeometryOffset		= X:0 Y:0 Z:0

  AdditionalGeometry    = BOX
  GeometryName			= Geom_V2
  GeometryMajorRadius   = 20.0
  GeometryMinorRadius   = 20.0
  GeometryHeight        = 105.0
  GeometryOffset		= X:-22 Y:-30 Z:0

  AdditionalGeometry    = BOX
  GeometryName			= Geom_V2
  GeometryMajorRadius   = 45.0
  GeometryMinorRadius   = 50.0
  GeometryHeight        = 60.0
  GeometryOffset		= X:0 Y:0 Z:0


  GeometryIsSmall       = No
  
  Shadow                = SHADOW_VOLUME
  BuildCompletion		= PLACED_BY_PLAYER
  
  	GeometryContactPoint = X:70	Y:-74		Z:0			Repair
	GeometryContactPoint = X:-57		Y:82		Z:0			Repair
	AttackContactPoint = X:11.725		Y:-53.381	Z:0
	AttackContactPoint = X:11.68		Y:56.752	Z:0
	GeometryContactPoint = X:29.241		Y:-36.937	Z:104.972	Swoop

End
 

 

 

That is the best i could do for now you have to make separate command sets for the upgrading to work :
 


	Behavior = CommandSetUpgrade ModueTag_BarracksLevel2CommandSet
		TriggeredBy			= Upgrade_GondorBarracksLevel2
		ConflictsWith		= Upgrade_GondorBarracksLevel3
		CommandSet			= FiefdomBarracksCommandSetLevel2
	End   

	Behavior = CommandSetUpgrade ModueTag_BarracksLevel3CommandSet
		TriggeredBy			= Upgrade_GondorBarracksLevel3		
		CommandSet			= FiefdomBarracksCommandSetLevel3
	End

 

 

 

A lot of the stuff you copied would be invalid since it doesn't exist so i just copied the Gondor Barracks as a placeholder You could experiment around it i guess. Just let me know what works and doesn't work.


99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#9 Missile157

Missile157
  • Members
  • 25 posts

Posted 05 February 2013 - 07:30 PM

OK the great thing is that the object can be built in game now! Wahoo! :)

 

I had to add 2 more little bits of code to the lotr.str the building name: OBJECTFiefdomBarracks and its respective description. I'm happy that I think I understand how to add text descriptions to the game now. :)

 

I would also like to know, which bits of the Gondor Barracks template did you edit, for future reference, if I wanted to add another building.

 

Now all I need to do is add the upgrade button in the commandset file to FiefdomBarracks Commandset and it should be good to go.

 

Thank you so much, you've been so helpful and I'll post again if anything else goes wrong. 

 

I'll probably try adding some new heroes next. :)



#10 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 05 February 2013 - 07:43 PM

Well the only pointer I could give you is :


When you attempted to edit the actual building  you put :
DefaultModelConditionState
        Model = fiefdombarracks
        
WeaponLaunchBone = PRIMARY ARROW
End

This will be invalid because that doesn't exist and must be replace by a W3d file that does exist (W3d files are the Models in the game)

So I replaced it with :

DefaultModelConditionState
        Model = GBBarracks_SKN        
        
WeaponLaunchBone = PRIMARY ARROW_
End

 

The Same is said for the Animations and Art (e.g. Portraits )


99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#11 Missile157

Missile157
  • Members
  • 25 posts

Posted 05 February 2013 - 08:01 PM

So all the other coding other than graphics remains the same?

 

Another really weird thing happened, when I upgraded the building to level 3 a unit called Gondor Spearmen appeared and I could build them. But when they spawned they were Knights of Dol Amroth. They were meant to be knights of Dol Amroth, but why were they called Gondor Spearmen? They were meant to be called Southern Knights. It isn't serious at all but it would be nice if they had the right name.

Here's the commandset code for the level 3 Fiefdom Barracks:

CommandSet FiefdomBarracksCommandSetLevel3
  	1	= Command_ConstructSouthernRingloValeFootmanHorde
	2	= Command_ConstructSouthernPelargirSpearmenHorde
	3	= Command_ConstructSouthernLossnarchAxemanHorde
	4	= Command_PurchaseTechnologyGondorBasicTraining		; Added
	5	= Command_ConstructSouthernMorthlondBowmanHorde	
	6	= Command_Sell
	7	= Command_ConstructSouthernKnightsHorde

 

I checked the horde file for SouthernKnights and their name isn't Gondor Spearmen. 



#12 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 05 February 2013 - 08:07 PM

How does the commandbutton settings look ?


99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#13 Missile157

Missile157
  • Members
  • 25 posts

Posted 05 February 2013 - 08:16 PM

Indeed there was a problem there, for some unknown reason the Labels in lotr.str were set to Gondor Spearmen ones, not Knights of Dol Amroth, so strange. Thanks for the help again.



#14 Missile157

Missile157
  • Members
  • 25 posts

Posted 05 February 2013 - 08:43 PM

I have tried to change the building upgrade, to a specific Fiefdom Barracks one (so that I can edit the text files, so it doesn't say wrong info).

The upgrades appear in game however they don't actually serve their purpose: level up the Fiefdom Barracks

 

New FiefdomBarracks Commandset:

CommandSet FiefdomBarracksCommandSet
  	1	= Command_ConstructSouthernRingloValeFootmanHorde
	2	= Command_ConstructSouthernPelargirSpearmenHorde	
	3	= Command_PurchaseTechnologyGondorBasicTraining
	4	= Command_PurchaseUpgradeFiefdomBarracksLevel2
	6	= Command_Sell
	
End

CommandSet FiefdomBarracksCommandSetLevel2
  	1	= Command_ConstructSouthernRingloValeFootmanHorde
	2	= Command_ConstructSouthernPelargirSpearmenHorde
	3	= Command_ConstructSouthernLossnarchAxemanHorde
	4	= Command_PurchaseTechnologyGondorBasicTraining		; Added
	5	= Command_ConstructSouthernMorthlondBowmanHorde	
	6	= Command_Sell
	7	= Command_PurchaseUpgradeFiefdomBarracksLevel3

End

 

 

Changes to the Fiefdom Barracks file:

	Behavior = SubObjectsUpgrade ModuleTag_ShowWallsAndFlag
		TriggeredBy		= Upgrade_FiefdomBarracksLevel2
		ShowSubObjects	= V1 V1FLAG V1_PIECE*
		HideSubObjects	= V2 V2A  V2_PIECE*
	End

	Behavior = SubObjectsUpgrade ModuleTag_ShowTowersAndHideFlag
		TriggeredBy		= Upgrade_FiefdomBarracksLevel3
		ShowSubObjects	= V1 V2 V2A V1_PIECE* V2_PIECE*
		HideSubObjects	= V1FLAG
	End
	
	Behavior = GeometryUpgrade Geom_ModuleTag_HideAll
		TriggeredBy		= Upgrade_StructureLevel1
		ShowGeometry	= Geom_Orig
		HideGeometry	= Geom_V2 
	End
	Behavior = GeometryUpgrade Geom_ModuleTag_ShowWalls 
		TriggeredBy		= Upgrade_FiefdomBarracksLevel2
		ShowGeometry	= Geom_Orig
		HideGeometry	= Geom_V2 
	End
  	Behavior = GeometryUpgrade Geom_ModuleTag_ShowFlagsAndTower 
		TriggeredBy		= Upgrade_FiefdomBarracksLevel3
		ShowGeometry	= Geom_V2
		HideGeometry	= Geom_Orig
	End
	
  	Behavior = WeaponSetUpgrade ModuleTag_ThirdLevelBuildingArrows
		TriggeredBy		= Upgrade_FiefdomBarracksLevel3
		ConflictsWith	= Upgrade_EasyAIMultiPlayer
	End

	Behavior = CommandSetUpgrade ModueTag_BarracksLevel2CommandSet
		TriggeredBy			= Upgrade_FiefdomBarracksLevel2
		ConflictsWith		= Upgrade_FiefdomBarracksLevel3
		CommandSet			= FiefdomBarracksCommandSetLevel2
	End   

	Behavior = CommandSetUpgrade ModueTag_BarracksLevel3CommandSet
		TriggeredBy			= Upgrade_FiefdomBarracksLevel3		
		CommandSet			= FiefdomBarracksCommandSetLevel3
	End  

        Behavior = LevelUpUpgrade ModuleTag_BarracksLevel2
		TriggeredBy    = Upgrade_FiefdomBarracksLevel2      
		LevelsToGain   = 1
		LevelCap       = 3
	End

	Behavior = LevelUpUpgrade ModuleTag_BarracksLevel3
		TriggeredBy    = Upgrade_FiefdomBarracksLevel3      
		LevelsToGain   = 1
		LevelCap       = 3
	End

 

Changes to upgrade.ini:


Upgrade Upgrade_FiefdomBarracksLevel2
	Type			= OBJECT
	BuildCost		= 500
	BuildTime		= 90
	DisplayName		= Upgrade:FiefdomBarracksLevel2
End

Upgrade Upgrade_FiefdomBarracksLevel3
	Type			= OBJECT
	BuildCost		= 500
	BuildTime		= 100
	DisplayName		= Upgrade:FiefdomBarracksLevel3

 

This is what I added to commandbutton.ini:

CommandButton Command_PurchaseUpgradeFiefdomBarracksLevel2 
   Command           = OBJECT_UPGRADE
   Upgrade           = Upgrade_FiefdomBarracksLevel2
   Options           = CANCELABLE
   TextLabel         = CONTROLBAR:ConstructFiefdomBarracks2Upgrade
   ButtonImage       = SHBuildingUpgradeGondorButton
   ButtonBorderType  = UPGRADE
   DescriptLabel     = CONTROLBAR:ToolTipBuildFiefdomBarracksLevel2Upgrade
   Radial            = Yes
   InPalantir        = Yes
End

CommandButton Command_PurchaseUpgradeFiefdomBarracksLevel3 
   Command           = OBJECT_UPGRADE
   Upgrade           = Upgrade_FiefdomBarracksLevel3
   Options           = CANCELABLE
   TextLabel         = CONTROLBAR:ConstructFiefdomBarracksLevel3Upgrade
   ButtonImage       = SHBuildingUpgradeGondorButton
   ButtonBorderType  = UPGRADE
   DescriptLabel     = CONTROLBAR:ToolTipBuildFiefdomBarracksLevel3Upgrade
   Radial            = Yes
   InPalantir        = Yes

 

I copied these from the Gondor Barracks upgrade files as a base, and edited them. I'm guessing that the don't actually refer to the FiefdomBarracks and that is why the upgrade is not applied.



#15 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 05 February 2013 - 08:47 PM

Sorry buddy I don't know much about upgrades, you'll have to wait for someone else to help you out with this one.


99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#16 Missile157

Missile157
  • Members
  • 25 posts

Posted 05 February 2013 - 08:50 PM

No problem, you been so helpful already and its not urgent. I can just change it back to using the Gondor Barracks upgrade for a while if needs be.



#17 Missile157

Missile157
  • Members
  • 25 posts

Posted 05 February 2013 - 10:12 PM

Oh dear only a typo, I feel stupid now. :(

Module not Modue in structure file.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users