Jump to content


Photo

Fortress Upgrade


  • Please log in to reply
3 replies to this topic

#1 Hard_Sander

Hard_Sander
  • Members
  • 244 posts

Posted 27 December 2006 - 03:04 PM

I've made a new fortress and I can't let the game charge money for building something on the expansion plots. So I wanted to create an fortress upgrade that will change the commandset of the expansionplots, so only then you can build something on them. But it isn't working.

The CommandButton:
CommandButton Command_PurchaseUpgradeRohanFortressExpansionPad
  Command		   = OBJECT_UPGRADE
  Upgrade		   = Upgrade_RohanFortressUpgradeExpansionPad 
  Options			= CANCELABLE
  TextLabel		 = CONTROLBAR:PurchaseUpgradeRohanFortressExpansionPad
  ButtonImage	   = HSSharkuTameBeast; BGFortress_BRSentryTwr
  ButtonBorderType  = UPGRADE
  DescriptLabel	 = CONTROLBAR:ToolTipPurchaseUpgradeRohanFortressExpansionPad
  Radial			= Yes
  InPalantir	   	= No
End

The CommandSet
(a little messy)

The relevant part of the expansionplot:
CommandSet = SellableCommandSet
...						
Behavior = CommandSetUpgrade ModueTag_RohanFortressExpansionPadUpgradedCommandSet
		TriggeredBy		= Upgrade_RohanFortressUpgradeExpansionPad1		
		CommandSet		= RohanFortressExpansionPadUpgradedCommandSet
	End  

The part out of the Fortress:
Behavior = CastleUpgrade ModuleTag_SentryTowerExpansionPadUpgrade
		TriggeredBy	= Upgrade_RohanFortressUpgradeExpansionPad
		Upgrade		= Upgrade_RohanFortressUpgradeExpansionPad1
	End

And upgrade.ini:
Upgrade Upgrade_RohanFortressUpgradeExpansionPad
	Type			= OBJECT
	BuildCost		= 1000
	BuildTime		= 20
	DisplayName		= Upgrade:RohanFortressUpgradeExpansionPad
;ResearchSound	= CampSoldierUpgradeFortress
	SkirmishAIHeuristic = AI_UPGRADEHEURISTIC_FORTRESS
End

Upgrade Upgrade_RohanFortressUpgradeExpansionPad1
	Type		= OBJECT
End

I can't find what's wrong with this code. Perhaps the double linking to upgrade.ini is irrelevant, although it shouldn't be a problem.
What happens: I can buy the upgrade without problem, but then the commandset of the expansionplots doens't change.

#2 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,438 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 27 December 2006 - 03:44 PM

Although I can't really help you, looking at these codes really makes me wanna mod BMFE2 :p

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#3 zimoo

zimoo

    Ecthelion of the Fountain

  • Project Team
  • 2,009 posts
  • Location:Devon, England
  • Projects:Lurking until the off topic begins...
  •  Guardian of the Books

Posted 27 December 2006 - 03:56 PM

I have no idea about you second problem, but for your first problem each new fortress expansion needs the following code:

Behavior = CastleMemberBehavior ModuleTag_CMB
	End

Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image

Playing games? Ah, you'll never be a good modder if you get involved in actually playing them!


#4 Hard_Sander

Hard_Sander
  • Members
  • 244 posts

Posted 27 December 2006 - 04:23 PM

Alright, I think I found what is wrong;
I'm upgrading the commandset of the wrong object, instead of the plot, I'm upgrading the actual tower.
I'll test it now.


It works like a charm! It even charges money! Thanks!

Edited by Hard_Sander, 27 December 2006 - 04:23 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users