Jump to content


Photo

A few quick modding questions


  • Please log in to reply
14 replies to this topic

#1 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 15 March 2010 - 02:16 AM

Hi,

I've been out for a while, but as mentioned in another post I've started modding again.

Here are a few basic questions I have so far.
I will try to post updates as some more issues come up. I have a tentative list, but here are the things I'm working on now.

How to:
- Take away feature that reduces farm income based on how many farms you have.
- Change farm radius to 0.
- Have spells usable even when base destroyed (like bfme 1).
- Have upgrades usable even when armory destroyed (like bfme 1).
- Change population limit to a constant population (say 500 constant).

- This one a bit tough : How to make rubble when building destroyed (so it is rebuildable with purchased upgrades... like a base destroyed and rebuildable from rubble with all upgrades kept that were purchased for that base).


Answer what you can anyone. Even if you know only one, or want to elaborate on what someone said.
All help is appreciated!
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 15 March 2010 - 06:36 AM

- Take away feature that reduces farm income based on how many farms you have.
- Change farm radius to 0.
Both of these are caused by the radius... so just find this piece of code:
Behavior = TerrainResourceBehavior ModuleTag_NewMoney
		Radius		= GENERIC_RESOURCE_STRUCTURE_MONEY_RANGE	; How far we try to claim ground
		MaxIncome	= GENERIC_RESOURCE_STRUCTURE_MONEY_AMOUNT	; If we were to get all we wanted, how much we would earn.  Linear slope to 0 at 0% claim
		IncomeInterval	= GENERIC_RESOURCE_STRUCTURE_MONEY_TIME	; How often (in msec) we give that much money
		
		Upgrade					= Upgrade_MarketplaceUpgradeGrandHarvest  
		UpgradeBonusPercent		= GONDOR_GRANDHARVEST_PRODUCTION_INCREASE %
		UpgradeMustBePresent	= ANY +GondorMarketPlace
	End
and change it to:
Behavior = TerrainResourceBehavior ModuleTag_NewMoney
		Radius		= 0	; How far we try to claim ground
		MaxIncome	= GENERIC_RESOURCE_STRUCTURE_MONEY_AMOUNT	; If we were to get all we wanted, how much we would earn.  Linear slope to 0 at 0% claim
		IncomeInterval	= GENERIC_RESOURCE_STRUCTURE_MONEY_TIME	; How often (in msec) we give that much money
		
		Upgrade					= Upgrade_MarketplaceUpgradeGrandHarvest  
		UpgradeBonusPercent		= GONDOR_GRANDHARVEST_PRODUCTION_INCREASE %
		UpgradeMustBePresent	= ANY +GondorMarketPlace
	End

Or do it the longer way... change the type of module to something like this one:
Behavior = AutoDepositUpdate AutoDepositModuleTag
		DepositTiming			= GONDOR_FARM_MONEY_TIME  ; in milliseconds
		DepositAmount			= GONDOR_FARM_MONEY_AMOUNT  ; cash amount to deposit every DepositTiming
		InitialCaptureBonus		= 0 ; no initial bonus
		
		Upgrade					= Upgrade_MarketplaceUpgradeGrandHarvest  
		UpgradeBonusPercent		= GONDOR_GRANDHARVEST_PRODUCTION_INCREASE %
		UpgradeMustBePresent	= ANY +GondorMarketPlace
	End

- Have spells usable even when base destroyed (like bfme 1).
Go to system.ini.... (\data\ini\object\system)
and change:
#define SPELL_BOOK_REQUIREMENTS_FILTER NONE +COMMANDCENTER -FS_BASE_DEFENSE ; ;
#define SPELL_BOOK_REQUIREMENTS_FILTER_STRATEGIC NONE
to something like:
#define SPELL_BOOK_REQUIREMENTS_FILTER ANY
#define SPELL_BOOK_REQUIREMENTS_FILTER_STRATEGIC NONE

- Have upgrades usable even when armory destroyed (like bfme 1).
Go to upgrade.ini :p
RequiredObjectFilter = NONE +DwarvenSiegeWorks
remove all of those kinds of pieces of code...

- Change population limit to a constant population (say 500 constant).
Change the values in gamedata.ini (cant save it as gamedata.ini in the original place though, you will need to move it into the object folder!)
;;; COMMAND POINTS FOR MULTIPLAY;;;
  GoodCommandPointsMP2 = 100 1000	; 2 players
  EvilCommandPointsMP2 = 100 1000

  GoodCommandPointsMP3 = 100 875	; 3 players
  EvilCommandPointsMP3 = 100 875

  GoodCommandPointsMP4 = 100 750	; 4 players
  EvilCommandPointsMP4 = 100 750

  GoodCommandPointsMP5 = 100 675	; 5 players
  EvilCommandPointsMP5 = 100 675

  GoodCommandPointsMP6 = 100 625	; 6 players
  EvilCommandPointsMP6 = 100 625

  GoodCommandPointsMP7 = 100 575	; 7 players
  EvilCommandPointsMP7 = 100 575

  GoodCommandPointsMP8 = 100 500	; 8 players
  EvilCommandPointsMP8 = 100 500

Rubble is easy... :p
give it:
Behavior = KeepObjectDie ModuleTag_IWantRubble

	End

	Behavior = RebuildHoleExposeDie ModuleTag_ExposeDie
		ExemptStatus		= SOLD
		HoleName			= WildMineShaftHole
		HoleMaxHealth		= 500.0
		FadeInTimeSeconds	= 2.0
	End

Then create a hole.... :p
Object WildStructureHole

; *** ART Parameters ***
	SelectPortrait		   =; SUHole_L
	ButtonImage			  = SUHole_L
	
	Draw = W3DScriptedModelDraw  ModuleTag_Draw
		
		OkToChangeModelColor   = Yes
		
		DefaultModelConditionState
			Model			  = GBGENRUBBLE
		End
		
	End



; ***DESIGN parameters ***
	DisplayName			= OBJECT:WildStructureHole
	Side				= Wild
	EditorSorting		= SYSTEM
	PlacementViewAngle	= 0
	BuildCost			= 100
	BuildTime			= 10.0		  ; in seconds
	VisionRange			= 50.0		  ; Shroud clearing distance
	ShroudClearingRange	= 50
	CommandSet			= SellableCommandSet

	ArmorSet
		Conditions	  = None
		Armor		   = StructureArmor
	End

; *** AUDIO Parameters ***
	#include "..\..\..\Includes\StandardBuildingEvaEvents.inc"

 	CampnessValue = CAMPNESS_RESOURCE_REBUILD_HOLE


; *** ENGINEERING Parameters ***
	RadarPriority	 = STRUCTURE
	KindOf			= PRELOAD STRUCTURE SELECTABLE IMMOBILE REBUILD_HOLE CAN_SEE_THROUGH_STRUCTURE FS_TECHNOLOGY NOT_AUTOACQUIRABLE UNATTACKABLE 

	Body			  = StructureBody ModuleTag_Body
	; To set the health for a particular hole, edit the entry in the object
	; that will leave the hole behind (edit the RebuildHoleExposeDie entry)
		MaxHealth	   = 9999999.9 ;bigger than anything realistic we use
		InitialHealth   = 9999999.9 ;bigger than anything realistic we use
	End
	
	Behavior					= RebuildHoleBehavior ModuleTag_RebuildHole
		WorkerObjectName		  = MordorWorkerNoSelect
		WorkerRespawnDelay		= 120000;in milliseconds
		HoleHealthRegen%PerSecond = 0.5%   ;regen this % of HoleMaxHealth per second
	End 

	Behavior = SlowDeathBehavior ModuleTag_Die
		SinkDelay			= 0
		SinkRate			= 4.8	 // in Dist/Sec
		DestructionDelay	= 4000
		Sound				= INITIAL BuildingRubbleSink
	End
	
	Geometry			= CYLINDER
	GeometryMajorRadius = 25.0
	GeometryHeight	  = 5.0
	GeometryIsSmall	 = No
	Shadow			  = SHADOW_VOLUME
	BuildCompletion	 = PLACED_BY_PLAYER

End

At least thats what i think you wanted... :)
Ridder Geel

#3 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 15 March 2010 - 07:08 AM

Thanks dude.

I already started work on this.
Looking at the rest now.

Thanks a bunch.
Posted Image

#4 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 15 March 2010 - 07:37 AM

I have a question about the hole.

For the object i put the hole in (Men_Fortress or w/e), how do i tell which hole object i want to reference.

In the example you had
HoleName			= WildMineShaftHole

and then you have object

Object WildStructureHole

Shouldn't the Object and the HoleName be the same? Or else how will the code know which hole to reference?
Posted Image

#5 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 15 March 2010 - 06:36 PM

Yea it should :p :p But my example contains the object of the main one, the one mention in hole name is a childobject :) :p
Ridder Geel

#6 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 28 March 2010 - 04:41 AM

Hi,

I am still having problem with the rubble thing.
Let me explain exactly what I am trying to do.

I am working on the buildplot bases in RJ_ROTWK mod.
The castle bases are similar to the bfme 1 bases EXCEPT the base in the middle is the men bfme 2 fortress instead of the gondor citadel.

I am trying to make it so when the center fortress is destroyed, it works similar to the citadel that is destroyed; there is a plot on the ground that one can click to rebuild the base.

I add the code:

Behavior = KeepObjectDie ModuleTag_IWantRubble

	End

but when I go in game and sell the base, it is simply gone. There is no buildplot "rubble" or whatever it is to rebuy the base. I looked at gondor's citadel code and compared it with men fortress code.

Other than the above code, I can't seem to find any difference.
Can anyone help?

Thanks.


Object MenFortressCitadel
Object GondorCastleBaseKeep
Posted Image

#7 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 28 March 2010 - 09:57 AM

...in BFME I could u sell your main base thing? If not... remove that option, rubble appears when its attacked and destroyed, so you cant sell it :xcahik_: I think...
Ridder Geel

#8 Prolong

Prolong
  • Members
  • 133 posts

Posted 28 March 2010 - 02:05 PM

Yeah, Rubble in BFME II appears when the building is destroyed, not when sold. Perhaps there's some way to change that.

What I want to know - if a Lair is in a rubble state, then starts rebuilding, and is destroyed while rebuilding, how can we make it then spawn chests or spawn more rubble? At the moment if you destroy a lair while it is rebuilding you lose the treasure.

- Take away feature that reduces farm income based on how many farms you have.

Ridder didn't mention how to solve this. That is controlled per faction in playertemplate.ini by these lines:

ResourceModifierValues		= 100 100 100 100 90 85 80 75 71 68 66
The first number is the % of maximum resources you gain when you have 0 farms, the second is for 1 farm, etc. So if I have four Farms on the map, all built at 100% value (which yours all will be if they have 0 radius), then I am getting 90% resources from those Farms.

My recommendation is to remove everything from the objectfilter at the top of the file to see if that breaks the link between the ResourceModifierValues line and the resource buildings:

#define RESOURCE_MODIFIER_OBJECT_FILTER ANY +GondorFarm +GondorFarmMultiplayer +DwarvenMineShaft +ElvenMallornTree +IsengardFurnace +IsengardLumberMill +MordorLumberMill +MordorSlaughterHouse +WildMineShaft +AngmarMill +ArnorFarm +ArnorFarmMultiplayer;;,;; Added Arnor Farms
to say

#define RESOURCE_MODIFIER_OBJECT_FILTER NONE
Alternatively if that doesn't work you can try messing with the values themselves, but I think there is a hardcoded decline after the array runs out so you might want to just try adding 50 '100's or so to avoid that problem.

Edited by Prolong, 28 March 2010 - 02:07 PM.


#9 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 29 March 2010 - 05:17 AM

K, thanks for the post guys.

So just to clarify, I just need to put this piece of code

Behavior = KeepObjectDie ModuleTag_IWantRubble

	End

in the Fortress object code and it should work? The fortress should have clickable rubble to rebuild?
Posted Image

#10 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 29 March 2010 - 05:25 AM

Yes... :xcahik_:
And your W3D should have a rubble state of course!
Ridder Geel

#11 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 29 March 2010 - 05:35 AM

That would be this code right?

ModelConditionState  = RUBBLE
			Model		 = GBFortress_D3
		End
	
		AnimationState	= RUBBLE
			Animation	= Fortress_Rubble
				AnimationName		= GBFortress_D3SK.GBFortress_D3AN
				AnimationMode		= ONCE				
			End	
			EnteringStateFX	= FX_FortressCollapse		
		End

I just tried it, and I had nothing.
Once the base is destroyed, there is nothing left underneath.
It is simply gone.

Any suggestions?
Posted Image

#12 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 29 March 2010 - 01:21 PM

Check out the "wild" structures...
Or... Better yet... Helms deep keep, you can rebuild it :xcahik_:
what it has is:
ModelConditionState  = RUBBLE
			Model		 = RBHDArcade_D4  
			ParticleSysBone OBJECT05 FireBuildingLarge
			ParticleSysBone OBJECT05 SmokeBuildingLarge
		End
		AnimationState = RUBBLE
	   		Animation				=	RubbleAnimation
				AnimationName		=	 RBHDArcade_D4.RBHDArcade_D4
				AnimationMode		=	ONCE
   			End
			EnteringStateFX = FX_MinWallATransitionReallyDamaged
		End
and...
KeepSelectableWhenDead	= Yes
//..........
; 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

What does ur model look like? rubble?
or nothing? :p

Edited by Ridder Geel, 29 March 2010 - 01:26 PM.

Ridder Geel

#13 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 03 April 2010 - 12:43 AM

Hi,

I've looked at a few things.
Im still not sure what to do.

Here is what I have so far.

I added the following code:

Behavior = KeepObjectDie ModuleTag_IWantRubble

	End


KeepSelectableWhenDead	= Yes

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
[b]		DestroyObjectWhenDone	= No;Yes[/b]
		CollapseHeight			= 155
	End

I looked at the rubble, but didn't change anything.
I am not sure what to change at this point.

If someone knows how to do this or can take a bit of time to find it out if you know what your doing, please do so.


When I play the game and the base is destroyed, I can select the base, whose rubble seems to be nothing.
When I select, it give me the fortress menu. When I select the hero button, I can't build any heroes; only return. But I can select and purchase the upgrades.
I think this is because of DestroyObjectWhenDone= No.


Thanks.
Posted Image

#14 lotrfan

lotrfan

    title available

  • Project Team
  • 318 posts

Posted 11 April 2010 - 03:30 AM

Hi,

I made some progress.
I looked at the original bfme base center and compared it with the fortress one.

The base center (the keep) has a rebuild command in the commandset.

I added the rebuild command
Command_StartCitadelSelfRepair
to the fortress's commandset.

However when I play the game and the base is destroyed and I try to rebuild, I click rebuild and nothing happens; I just lose the gold that it cost to rebuild.

Does anyone know why this happens?

I am thinking one possibility might be a geometry problem, but I simply dont have enough knowledge about geometries.


Any help is appreciated.
Thanks
Posted Image

#15 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 11 April 2010 - 09:59 PM

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
check for similar codes... if you dont have... Make :D
Ridder Geel




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users