Jump to content


Photo

How to get fortress to be rebuild from rubble


  • Please log in to reply
6 replies to this topic

#1 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 11 April 2010 - 11:57 PM

First off, a bunch of thanks to Rider Geel who has helped so much already in solving this problem.
But we are still having issues, and this might go on for some time so I decided to make this it's own topic.

I have almost successfully created a mod that is a full return to bfme 1 except with the units/benefits from bfme II.

The last major obstacle (at least for one of the first beta versions) is getting the main base to rebuild once destroyed.
I have kinda managed to get it to leave rubble and added rebuild to commandset.

When the fortress is destroyed, I have the option to rebuild the fortress, but when I rebuild, it just starts for a second and then is destroyed.
I was thinking it might be a geometry issue, but I'm not sure.

Rider Geel gave me some code to add.
All the additional code added to the fortress object is listed below.


Behavior			= GettingBuiltBehavior GetBuiltBehaviorTag;ModuleTag_GettingBuiltBehavior
		SelfBuildingLoop		= BuildingConstructionLoop   ; Only played if we DON'T spawn a worker
		SelfRepairFromDamageLoop	= NoSound		   ; This doesn't cause an animation, so don't bother playing a sound
		SelfRepairFromRubbleLoop	= BuildingConstructionLoop
		SpawnTimer			= -1.0			   ; Negative means no 'autoheal'
		RebuildTimeSeconds		= 120
;	WorkerName	= GondorFortressWorkerNoSelect; Change from 1.07; GondorWorkerNoSelect
;	SpawnTimer	= RJ_DEFAULT_STRUCTURE_HEALDELAY
	End


	KeepSelectableWhenDead	= Yes
	
	Behavior = KeepObjectDie ModuleTag_IWantRubble
	End

In addition, the code below was DestroyObjectWhenDone was changed to No

Behavior				  = StructureCollapseUpdate ModuleTag_08
		MinCollapseDelay		= 000
		MaxCollapseDelay		= 000
		CollapseDamping		 = .5
		MaxShudder			  = 0.6
		MinBurstDelay		   = 250
		MaxBurstDelay		   = 800
		BigBurstFrequency	   = 4
		FXList				  = INITIAL   FX_FortressCollapse
	;FXList				  = ALMOST_FINAL  FX_FortressCollapse
		DestroyObjectWhenDone	= No;Yes
		CollapseHeight			= 155
	End

If anyone knows how to do this please help.
I just want to have the fortress leave rubble and be able to rebuild like with the bfme 1 bases.

Any help is appreciated.

Thanks!
Posted Image

#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 12 April 2010 - 11:11 AM

...How about you upload your mod thing somewhere... and i will take a good look at it? :) (I might be able to fix it if i see all the files... it's happened before :xcahik_: )
Ridder Geel

#3 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 14 April 2010 - 05:36 PM

The mod is not ready to be uploaded.
I should mention that the mod is based off rj's mod.

The only significant things regarding this topic is in the code listed below.
Those are the only changes I made to men's fortress file in rj's mod (which is similar to the regular fortress.ini).
Posted Image

#4 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 14 April 2010 - 07:01 PM

Well if you upload it (somewhere private i suppose) and pm me the link, i might be able to make it work for you :p
Ridder Geel

#5 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 17 April 2010 - 04:32 AM

Hi,

I attached the fotress.ini file.
It is based off RJ's mod.

I copied some of the animations/model states from the bfme1 gondor citadel and changed all geometries to 1.0, in addition to the changes already mentioned.

I am trying to get BFME1GondorFortressCitadel to be able to rebuild when destroyed like in bfme 1.
The problem is when I try to rebuild, the fortress starts rebuilding then immediately stops. It shows the cancel button for a split second.
Does anyone know why this happens?

I was hoping this thing would be an easy fix.

Commandsets:

CommandSet BFME1GondorFortressCommandSet
	InitialVisible = 7 
	//Main Menu
	2   	= Command_SelectRevivablesMenFortress 
	3   	= Command_SelectUpgradesMenFortress 
	4	= Command_SpecialAbilityIvoryTowerVision 
	5	= Command_FireWeaponMenFortressBoilingOil 
;6 	= Command_Sell				; RotWK
	6	= Command_StartCitadelSelfRepair
	
	//Upgrades Menu
	8	= Command_PurchaseUpgradeMenFortressBanners 
	9	= Command_PurchaseUpgradeMenFortressHouseOfHealing 
	10	= Command_PurchaseUpgradeMenFortressIvoryTower 
	11	= Command_PurchaseUpgradeMenFortressBoilingOil 
	12	= Command_PurchaseUpgradeMenFortressNumenorStonework 
	13	= Command_PurchaseUpgradeMenFortressFlamingMunitions 
	14	= Command_RadialBack

	//Hero Menu
	16	= Command_RingHeroReviveSlot 
	17	= Command_CreateAHeroReviveSlot 
	18	= Command_GenericReviveSlot1 
	19	= Command_GenericReviveSlot2 
	20	= Command_GenericReviveSlot3 
	21	= Command_GenericReviveSlot4 
	22	= Command_GenericReviveSlot5 
	23	= Command_GenericReviveSlot6 
	24	= Command_GenericReviveSlot7 
	25	= Command_GenericReviveSlot8 
	26	= Command_GenericReviveSlot9 
	27	= Command_GenericReviveSlot10 
	28	= Command_GenericReviveSlot11 
	29	= Command_GenericReviveSlot12 
	30	= Command_GenericReviveSlot13 
	31	= Command_GenericReviveSlot14 
	32	= Command_GenericReviveSlot15 
	33	= Command_RadialBack 
End


BFME1 Gondor Citadel

Object GondorCastleBaseKeep

	SelectPortrait = BPGondorCastle

 ; *** ART Parameters ***

  Draw = W3DScriptedModelDraw ModuleTag_Draw
	OkToChangeModelColor  = Yes
	UseStandardModelNames = Yes
	
	ExtraPublicBone = Arrow_01
	ExtraPublicBone = Arrow_02
	ExtraPublicBone = Arrow_03
	ExtraPublicBone = Arrow_04
	ExtraPublicBone = Arrow_05
	ExtraPublicBone = Arrow_06
	ExtraPublicBone = Arrow_07
	ExtraPublicBone = Arrow_08
	ExtraPublicBone = Arrow_09
	ExtraPublicBone = Arrow_10
	ExtraPublicBone = Arrow_11
	ExtraPublicBone = Arrow_12

	DefaultModelConditionState  
	  Model = GBCastKeep
	  WeaponLaunchBone	= PRIMARY ARROW_
	End
	
   ;------------Build Up States
	ModelConditionState   = ACTIVELY_BEING_CONSTRUCTED PARTIALLY_CONSTRUCTED
	  Model			   = GBCastKeep_A
	  ParticleSysBone	 = NONE BuildingContructDust
	End  

	AnimationState		  = ACTIVELY_BEING_CONSTRUCTED
		Animation
			AnimationName	= GBCastKeep_A.GBCastKeep_A
			AnimationMode   = MANUAL
		End
	End
	
;---------Damaged---------------------
	ModelConditionState  = DAMAGED
	  Model		 = GBCastKeep_D1 
	End
	
	AnimationState = DAMAGED
		StateName = STATE_None
		EnteringStateFX	= FX_BuildingDamaged
	End

	ModelConditionState  = REALLYDAMAGED
	  Model		 = GBCastKeep_D2
	End
	AnimationState = REALLYDAMAGED
	   	Animation				=	ReallyDamagedanimation
			AnimationName		=	 GBCastKeep_D2.GBCastKeep_D2
			AnimationMode		=	ONCE
   		End
   		StateName = STATE_None
		EnteringStateFX	= FX_BuildingReallyDamaged
	End

	ModelConditionState   = DESTROYED_WHILST_BEING_CONSTRUCTED
		Model = GBCastKeep_A
		ParticleSysBone NONE Explosion3
		ParticleSysBone NONE ExplosiveMineSmoke02
	End  
	AnimationState	= DESTROYED_WHILST_BEING_CONSTRUCTED
		StateName = STATE_DetroyedConstructing
		Animation
			AnimationName		= GBCastKeep_A.GBCastKeep_A
			AnimationMode		= ONCE_BACKWARDS
			AnimationBlendTime	= 90; 3 seconds * 30 frames
		End
	; Specifically no start last frame flag here.
		Flags = START_FRAME_FIRST
	End

; RUBBLE--------------------------------------------------------------------------------------------------------
	TransitionState = TRANS_U_IntoRubble
		Animation = D3
			AnimationName		= GBCastKeep_D3.GBCastKeep_D3
			AnimationMode		= ONCE
			AnimationBlendTime	= 0
		End
		ParticleSysBone NONE Explosion3
		ParticleSysBone NONE ExplosiveMineSmoke02
	End

	ModelConditionState  = RUBBLE
		Model		 = GBCastKeep_D3
	End   
	AnimationState = RUBBLE
		StateName = STATE_Rubble
		Flags = START_FRAME_LAST
		Animation				=	Death
			AnimationName		=	GBCastKeep_D3.GBCastKeep_D3
			AnimationMode		=	ONCE
		End
		BeginScript
			Prev = CurDrawablePrevAnimationState()
			if Prev == "STATE_None"
			then
			; Only play the rubble anim if we havn't come from another rubble.
				CurDrawableSetTransitionAnimState("TRANS_U_IntoRubble")
			end
		EndScript
	End	  

;------------Build Up States
	ModelConditionState   = ACTIVELY_BEING_CONSTRUCTED
	  Model			   = GBCastKeep_A
	  ParticleSysBone	 = NONE BuildingContructDust
	End  

	AnimationState		  = ACTIVELY_BEING_CONSTRUCTED
		StateName = STATE_Rubble
		Animation
			AnimationName	= GBCastKeep_A.GBCastKeep_A
			AnimationMode   = MANUAL
		End
		BeginScript
		;CurDrawableHideSubObject("FIRE02")
			CurDrawablePlaySound("GondorBarracksBeginConstruction")
			CurDrawablePlaySound("BuildingTopple")
		EndScript
	End

;------------Build Up States
	ModelConditionState   = BASE_BUILD
	  Model			   = GBCastKeep_A
	  ParticleSysBone	 = NONE BuildingContructDust
	End  

	AnimationState		  = BASE_BUILD
		StateName = STATE_Rubble
		Animation
			AnimationName = GBCastKeep_A.GBCastKeep_A
			AnimationMode = ONCE
			AnimationBlendTime = 0			
			AnimationSpeedFactorRange = 2.0 2.0; 300 frame anim, but need to shrink down to 5 seconds
		End
		BeginScript
			CurDrawablePlaySound("GondorBarracksBeginConstruction")
			CurDrawablePlaySound("BuildingTopple")
		EndScript
	End

	ModelConditionState   = JUST_BUILT
	  Model			   = GBCastKeep_A
	End  
	AnimationState		  = JUST_BUILT
		StateName = STATE_Rubble
		Animation
			AnimationName = GBCastKeep_A.GBCastKeep_A
			AnimationMode = MANUAL			
			AnimationBlendTime = 0
		End
		Flags = START_FRAME_FIRST
	End

  End


; *** AUDIO Parameters ***

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

	VoiceSelect				= GondorCitadelSelect

	SoundAmbient			= CitadelSignalFireLoop
	SoundOnDamaged			= BuildingLightDamageStone
	SoundOnReallyDamaged		= BuildingHeavyDamageStone

	VoiceSelectUnderConstruction	= BuildingGoodVoiceSelectUnderConstruction

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

	EvaEventDieOwner = CitadelDie

	ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
		MaxUpdateRangeCap = 800
 		AnimationSound = Sound:BuildingSink				Animation:GBCastKeep_D3.GBCastKeep_D3	Frames:0
		AnimationSound = Sound:BuildingHeavyDamageStone		Animation:GBCastKeep_D3.GBCastKeep_D3	Frames:40
	End
	CampnessValue = CAMPNESS_FORTRESS


; ***DESIGN parameters ***

	DisplayName	  = OBJECT:GondorCastleBaseKeep
	Side = Men
	EditorSorting   = STRUCTURE
	ThreatLevel = 1.0
	BuildCost		   = 1000
	BuildTime		   = 30.0		  ; in seconds
	CommandSet			= GondorCastleBaseKeepCommandSet

  ArmorSet
	Conditions		= None
	Armor			 = StructureArmor
	DamageFX		  = MinasWallADamageFX
  End
  
	WeaponSet
		Conditions			= None
		Weapon				= PRIMARY KeepBow
		AutoChooseSources	= PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
	End 

 ; *** ENGINEERING Parameters ***  
  KindOf					= VITAL_FOR_BASE_SURVIVAL STRUCTURE SELECTABLE SCORE IMMOBILE CASTLE_KEEP MP_COUNT_FOR_VICTORY CAN_ATTACK FS_FACTORY MADE_OF_STONE ATTACK_NEEDS_LINE_OF_SIGHT AUTO_RALLYPOINT;  GARRISON GARRISONABLE_UNTIL_DESTROYED
  RadarPriority				= STRUCTURE
  VisionRange				= RJ_GONDOR_ARCHER_VISION_RANGE
  KeepSelectableWhenDead	= Yes
  
  Body			  = ActiveBody ModuleTag_02
	MaxHealth	   = RJ_GONDOR_CENTRAL_CAMP_KEEP_HEALTH
  End

  Behavior = GettingBuiltBehavior ModuleTag_04
	SelfBuildingLoop = BuildingBigConstructionLoop		; Only played if we DON'T spawn a worker
	SelfRepairFromDamageLoop  = NoSound				; This doesn't cause an animation, so don't bother playing a sound
	SelfRepairFromRubbleLoop  = BuildingBigConstructionLoop
  End

  Behavior = CastleMemberBehavior ModuleTag_CMB
	BeingBuiltSound = BuildingBigConstructionLoop
  End 

  ;-----------------------------------------------
;Used for hero revival and initial construction	 
	Behavior = ProductionUpdate ProductionUpdateModuleTag
	; nothing, but is required if we have any Object-level Upgrades!
	End
	Behavior = QueueProductionExitUpdate ModuleTag_QueuePEU
		UnitCreatePoint   = X:0.0 Y:-20.0 Z:0.0
		NaturalRallyPoint = X:28.8 Y:-80.0 Z:0.0;NaturalRallyPointX must always match GeometryMajorRadius!
		ExitDelay = 300;Handles delays between units if multiple produced at a time. 
	End  
;-----------------------------------------------

	Behavior = WeaponSetUpgrade ModuleTag_FireArrows
		TriggeredBy			= Upgrade_BattleTowersToUseFireArrows
	End
	Behavior = AIUpdateInterface ModuleTag_SoWeCanUseWeapon
 		AutoAcquireEnemiesWhenIdle	= Yes
 		MoodAttackCheckRate			= 250
 	End
   

 ; Note that structures with "RUBBLE" states should not use DestroyDie; such buildings are 
 ; never truly destroyed, even when reduced to zero health. Also note that garrisonable
 ; buildings automatically stick around because GarrisonContain has it's own DieModule
  Behavior = KeepObjectDie ModuleTag_IWantRubble
  End

	Behavior = AttributeModifierUpgrade ModuleTag_Reinforced
		TriggeredBy				= Upgrade_NumenorStonework
		AttributeModifier		= NumenorStoneworkKeep_Bonus
	End
  
	Behavior	   = EvacuateDamage ModuleTag_evacuateDamage
		WeaponThatCausesEvacuation  = MordorCatapultHumanHeads
	End

;-------------Can no longer garrison castle keeps
;
;	Behavior = HordeGarrisonContain ModuleTag_hordeGarrison
;		ObjectStatusOfContained	= UNSELECTABLE CAN_ATTACK
;		ContainMax			  = 4
;		DamagePercentToUnits	= 0%
;		PassengerFilter			= ANY +INFANTRY +HORDE -CAVALRY -SUMMONED -WildSpiderling -WildSpiderlingHorde
;		AllowEnemiesInside	  = Yes
;		AllowNeutralInside	  = Yes
;		NumberOfExitPaths	   = 1; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
;		PassengerBonePrefix	 = PassengerBone:ARROWBONE KindOf:INFANTRY
;		EntryOffset				= X:0.0 Y:-45.0 Z:0.0
;		ExitOffset				= X:0.0 Y:-45.0 Z:0.0
;		
;	;PassengersTestCollisionHeight = 80
;	;Slots						 = 1
;	;EnterSound					 = GarrisonEnter
;	;ExitSound					  = GarrisonExit
;	;ExitDelay			   = 250
;	;GoAggressiveOnExit	  = Yes; AI Will tell people to set their mood to Aggressive on exiting
;	;ForceOrientationContainer = No ; otherwise contained units can't orient themselves towards their targets...
;	End 

	Behavior = AutoDepositUpdate AutoDepositModuleTag
		DepositTiming			= RJ_GENERIC_KEEP_MONEY_TIME  ; in milliseconds
		DepositAmount			= RJ_GENERIC_KEEP_MONEY_AMOUNT  ; cash amount to deposit every DepositTiming
		InitialCaptureBonus		= 0 ; no initial bonus
	End
  
  Geometry			  = BOX
  GeometryMajorRadius   = 19.0
  GeometryMinorRadius   = 19.0
  GeometryHeight		= 44.0
  
  AdditionalGeometry	= CYLINDER
  GeometryMajorRadius   = 19.0
  GeometryMinorRadius   = 0
  GeometryHeight		= 79
  
  AdditionalGeometry	= CYLINDER
  GeometryMajorRadius   = 9.0
  GeometryMinorRadius   = 0
  GeometryHeight		= 149
  
  GeometryIsSmall	   = No
  Shadow				= SHADOW_VOLUME
  
  AttackContactPoint	= X:00.327		Y:-0.28			Z:167.013		Swoop
  AttackContactPoint	= X:0			Y:0				Z:0
End


This is based off of RJ's mod.
This is one of the last obstacles I have in making a complete return to bfme1.

Attached Files


Edited by lotrfan, 17 April 2010 - 04:34 AM.

Posted Image

#6 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 17 April 2010 - 05:03 AM

Your code is different to this:
Behavior = GettingBuiltBehavior GetBuiltBehaviorTag
		SelfBuildingLoop		= BuildingConstructionLoop	; Only played if we DON'T spawn a worker
		SelfRepairFromDamageLoop	= NoSound			; This doesn't cause an animation, so don't bother playing a sound
		SelfRepairFromRubbleLoop	= BuildingConstructionLoop
		SpawnTimer			= -1.0				; Negative means no 'autoheal'
		RebuildTimeSeconds		= 120
	End

Have you checked that out? :D
Ridder Geel

#7 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 17 April 2010 - 05:59 PM

I have this code in fortress.ini for Object MenFortressCitadel.

Behavior			= GettingBuiltBehavior GetBuiltBehaviorTag;ModuleTag_GettingBuiltBehavior
		SelfBuildingLoop		= BuildingConstructionLoop   ; Only played if we DON'T spawn a worker
		SelfRepairFromDamageLoop	= NoSound		   ; This doesn't cause an animation, so don't bother playing a sound
		SelfRepairFromRubbleLoop	= BuildingConstructionLoop
		SpawnTimer			= 120;-1.0			   ; Negative means no 'autoheal'
		RebuildTimeSeconds		= 120
;	WorkerName	= GondorFortressWorkerNoSelect; Change from 1.07; GondorWorkerNoSelect
;	SpawnTimer	= RJ_DEFAULT_STRUCTURE_HEALDELAY
	End

I initially had SpawnTimer as -1.0, but I changed it to test something because it wasn't working.
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users