Jump to content


Photo

How to tie a buildingupgrade to a heroe's level


  • Please log in to reply
5 replies to this topic

#1 Imladhrim

Imladhrim
  • Members
  • 51 posts
  • Projects:Otherland

Posted 06 February 2007 - 02:01 PM

Small Change thanks to ched's tip

you don't even need to use Lua for this. You can use the GrantUpgradeCreate Behavior. I find it easier to keep all the necessary code in one place :)



This guide is supposed to show you how a hero can influence a building type.
Why would I want that you might ask..
Here are just a few things you could do with it...
  • Elves might be able to train special units from their barracks once Haldir reaches level 7
  • You could buy an upgrade at your fortress, that makes your CaH (Create a Hero) stronger, once he reaches lvl 10
  • Every Orc horde that reaches level 5 enables you to activate fuel the fires on one of your ressource buildings
  • Your Isengard Fortress can cast the Wizardtowerlightning, once Saruman is level 10 instead of having to buy the upgrade
I could go on and on.. just thinking about it gave me new ideas to try in my mod :p .. But alas, I have a guide to write.

I'll start with an easier task, covering the basics first and will then show you something a bit more complex with switching commandsets an' all.
Requirements:
You should know something about ini editing (commandsets, commandbuttons, where to find the OCL Objects) since I won't go into to much detail here.
Files to edit:
  • ini.big (the inis)
  • English.big (lotr.str, the descriptiontexts) .. might be named different, if you use another language version
Well here goes nothin' ..

1. The Basics - how to tie unitlevel and a buildingtype

Lets stick with the Haldir task. We want to be able to train Lindon Horsearchers in the elven barracks once Haldir reaches level 7.
Keep in mind: we will only see the new "Train Lindon Horsearchers" button in the Radial Menu above the barracks.. since there is only room for 6 commands in the Palantir menu and the Elven Barracks already use those for 5 units and the sell command.

To do this we need to edit the following files:
  • commandbutton.ini <= to make a new Horsearcherbutton
  • lotr.str <= to give some descriptions to the new Horsearcherbutton
  • commandset.ini <= to tie the new Horsearcherbutton to the Baracks Commands
  • upgrade.ini <= to define a new upgrade that enables the Horsearcherbutton
  • experiencelevels.ini <= to grant that new upgrade once Haldir reaches level 7
  • ObjectCreationList.ini <= to register our magical upgradeenabler
  • system.ini <= to define our magical upgradeenabler
Now to work

1.1. Commandbutton.ini
We need to create a new Button to train Lindon Horse Archers, because the requirements and descriptions of the original one would not fit.
Take heed: they are named ElvenRivendellArchers in code.. don't be confused ;)
Just copy the Command_ConstructElvenRivendellArchers Buttoncode .. and change it like this:

CommandButton Command_ConstructElvenHorseArchers
	Command				= UNIT_BUILD
	Object				= ElvenRivendellArcherHorde
	Options				= NEED_UPGRADE CANCELABLE
	NeededUpgrade			= Upgrade_ElvenHorseArchersEnabler
	TextLabel			= CONTROLBAR:BuildElvenRivendellArchers
	ButtonImage			= BEGreenPasture_RivendellArcherIcon
	ButtonBorderType		= BUILD													
	DescriptLabel			= CONTROLBAR:ToolTipBuildElvenHorseArchers
	Radial				= Yes
	InPalantir	   		= No
	ShowProductionCount		= Yes
End

If you don't the new Button to be seen until all requirements are met you can add "HIDE_WHILE_DISABLED" to the options

As you can see I've changed the DescriptLabel and the needed Upgrade as well as hiding the button in the palantir (it wouldn't be shown there anyway).. and of course the buttonname.
The new labels will be added in lotr.str .. let's do that now

1.2. lotr.str
Just add the following:
CONTROLBAR:ToolTipBuildElvenHorseArchers
"Strong at Range \n Haldir needs to gain level 7"
END

1.3. commandset.ini
Now we need to add the New Button to the elven barracks commandset.
To do so oben commandset.ini look for "ElvenBarracksCommandSet".
There are three different commandsets, one for each barracklevel.
Don't be confuse by the numbering. It's because the Radial menu puts the commands in order of appearance and ignores the numbers, while the palantir menu looks for the numbers.
(It can only display commands from the first number in the commandset till first number+5)
Here are the changes:

CommandSet ERElvenBarracksCommandSet  	1 	= Command_ConstructElvenLorienWarriorHorde  	2 	= Command_ConstructElvenLorienArcherHorde  	3 	= Command_ConstructElvenMithlondSentryHorde  	4 	= Command_ConstructElvenMirkwoodArcherHorde 	5 	= Command_ConstructNoldorWarriorHorde  	7 	= Command_ConstructElvenHorseArchers  	  	8 	= Command_PurchaseUpgradeElvenBarracksLevel2  	6 	= Command_SellEndCommandSet ElvenBarracksCommandSetLevel2  	1 	= Command_ConstructElvenLorienWarriorHorde  	2 	= Command_ConstructElvenLorienArcherHorde  	3 	= Command_ConstructElvenMithlondSentryHorde  	4 	= Command_ConstructElvenMirkwoodArcherHorde  	5 	= Command_ConstructNoldorWarriorHorde  	7 	= Command_ConstructElvenHorseArchers   	  	8 	= Command_PurchaseUpgradeElvenBarracksLevel3  	6 	= Command_SellEndCommandSet ElvenBarracksCommandSetLevel3  	1 	= Command_ConstructElvenLorienWarriorHorde  	2 	= Command_ConstructElvenLorienArcherHorde  	3 	= Command_ConstructElvenMithlondSentryHorde  	4 	= Command_ConstructElvenMirkwoodArcherHorde  	5 	= Command_ConstructNoldorWarriorHorde  	7 	= Command_ConstructElvenHorseArchers   	  	6 	= Command_SellEnd

1.4. upgrade.ini
Now to define the new upgrade that unlocks our Horse Archer Button
It needs to be of type PLAYER so it gets broadcasted to every player construction.. instead of beeing bound to one object.
This is the code:

Upgrade Upgrade_ElvenHorseArchersEnabler
	Type = PLAYER
End

1.5. experiencelevels.ini
How this upgrade is gained will be shown in one of the next steps.. First let's decide at which level Haldir causes the Barracks to become a further Training Grounds for Lindon Horse Archers.
We use Level 7 in our little example.. so open experiencelevels.ini and look for "HaldirLevel7"
add "LevelUpOCL=OCL_HorseArcherEnabler" like so:

ExperienceLevel	HaldirLevel7	TargetNames						=	ElvenHaldir	RequiredExperience				=	HALDIR_LVL7_EXP_NEEDED 	ExperienceAward					=	HALDIR_LVL7_EXP_AWARD		LevelUpOCL						=	OCL_HorseArcherEnabler	AttributeModifiers				=	HeroLevelUpDamage6	Rank							=	7	LevelUpFx						=	FX:GandalfLevelUp1FX	;LevelUpOCL						=	OCL_GandalfLevelUp1OCL	Upgrades						=	Upgrade_LegolasArrowWind	SelectionDecal		Texture						=	decal_hero_good		Style						=	SHADOW_ALPHA_DECAL		OpacityMin					=	50%			OpacityMax					=	100%		MinRadius					=	40 ;16		MaxRadius					=	200 ;16		MaxSelectedUnits			=	40 ;1	End	END

This will cause an object to come into existence, once Haldir reaches lvl 7. This object will be invisible and only stay around for less then a second. It's only job is to grant the upgrade, once it is created.
You might wonder why we didn't grant that upgrade by simply adding it to the upgrades Haldir receives when he levels, like the Upgrade_HaldirLeadership he gets at level 6 with this code
	Upgrades						=	Upgrade_HaldirLeadership
Well... upgrades granted at levelup with this method are bound to the object, yet we need it to be broadcasted to all Things belonging the Player has now (and in future)
Hence this little OCL trick.


1.6. ObjectCreationList.ini
You need to tell the game which objects will be created in the creationlist
Just add the following to the Objectcreationlist.ini

ObjectCreationList OCL_HorseArcherEnabler
; The egg is going to die (hatch) immediately, and play the FXLists, then wait, then do the Finish below
	CreateObject
		ObjectNames = HorseArcherEgg
		Count = 1
		Disposition = LIKE_EXISTING
	End
End

1.7. system.ini
Now we need to add the invisible HorseArcherEgg Object in the system ini
Thanks to the GrantUpgradeCreate Behavior it will grant the Upgrade_ElvenHorseArchersEnabler once it is created.. and will selfdestruct after 50 miliseconds.
Object HorseArcherEgg	Draw = W3DScriptedModelDraw ModuleTag_DrawHorseArcherEgg		DefaultModelConditionState			Model = None		End	End        Body            = ActiveBody ModuleTag_02HorseArcher               MaxHealth         = 10000        End	Behavior 		= GrantUpgradeCreate ModuleTag_HorseArcherUpgrade		UpgradeToGrant 	= Upgrade_ElvenHorseArchersEnabler	End 	Behavior = LifetimeUpdate ModuleTag_HatchTriggerHorseArcher		MinLifetime = 50.0		MaxLifetime = 50.0	EndEnd


The End
for now..
feel free to replace the Horsearchers with Lindon Warriors or Imladris Archers .. just adapt the method to your plans

This was the basic version..
Right now I'm working on Part two, that will include switching commandsets as well as including an option to disable the upgrade if another one is already in place.

Part two is done! Scroll down, or click here!

Edited by Imladhrim, 12 February 2007 - 05:23 PM.


#2 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 06 February 2007 - 02:42 PM

good job. it's odd things like this that make modding so interesting :)
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#3 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 06 February 2007 - 04:07 PM

you don't even need to use Lua for this. You can use the GrantUpgradeCreate Behavior. I find it easier to keep all the necessary code in one place :)
Software is like sex; it's better when it's free ~Linus Torvald

#4 Juissi

Juissi

    AWESOM-O

  • Hosted
  • 1,555 posts
  • Location:Finland
  • Projects:Last Alliance modification, The Hobbit mod
  •  Forger Of (Last) Alliance

Posted 06 February 2007 - 06:06 PM

Nice tut, Im sure that I have use for it later

#5 Imladhrim

Imladhrim
  • Members
  • 51 posts
  • Projects:Otherland

Posted 06 February 2007 - 06:23 PM

Welcome to the "Extended Version" :p

This part of the guide is based on something I wanted to have in my mod, so if you find a reference to something in the code or in my desciptions, that isn't part of the game.. it's most certainly part of my Otherland-Mod.
As long as it isn't vital to this guide I'm not gonna describe it further.
Here is what I planned to do:

There is a lvl 10 CaHPower ("BlessedOfValinor", something like the "Gandalf the White" Power in BFME).
Since it is passive it doesn't realy need a Commandbutton in the CaH Palantir.
CaHs might buy this power during creation in the CaH Powerselectionscreen (thereby filling one of their Plantir Commandbuttonslots).
But the same power should also be available at the fortress (at an increased price).

- this "FortressUpgrade" shall only be shown once the CaH reaches lvl 10.
- and only, if he didn't choose the Power during Creation
- the FortressUpgrade shall be hidden, once it is purchased.

To do this we need to edit the following files:
  • createaheroupgrades.inc
  • commandbutton.ini
  • commandset.ini
  • experiencelevels_createahero.inc
  • createahero.ini
  • weapons.ini
  • ObjectCreationList.ini
  • createaheroobjects.inc
  • isengardfortress.ini <= this one is just an example.. you will have to edit every fortress that you want to be able to grant the Upgrade to your CaH
  • lotr.str
And here is what I did:


2.1. createaheroupgrades.inc
Instead of just one upgrade like in the Basic Version, I've created 3
  • One to unpause the power ("Upgrade_CreateAHeroBlessedOfValinor")
    This one can be bought at the Fortress for 10000 or at CaH Creation for 2000
  • One to unlock the second commandset of the Fortress ("Upgrade_CreateAHeroBlessedOfValinorEnabler")
  • One to hinder the unlocking of the second commandset ("Upgrade_CreateAHeroBlessedOfValinorForbidden")
Upgrade Upgrade_CreateAHeroBlessedOfValinorEnabler
	Type = PLAYER
End
Upgrade Upgrade_CreateAHeroBlessedOfValinorForbidden
	Type = PLAYER
End
Upgrade Upgrade_CreateAHeroBlessedOfValinor
	Type = PLAYER
	BuildCost		= 10000
	BuildTime		= 320000
	UpgradeFX		= FX_DwarvenFortressUpgrade
	ResearchSound	= UpgradeDwarfFortressStonework
End

2.2. commandbutton.ini
I made 2 new commandbuttons
The first is for the Fortress, this one enables the Player to purchase the upgrade that unpauses the passive power at his fortress.
The second is the button for the passive power, and the button that the player sees in the CaH Creation Screen.
CommandButton Command_PurchaseUpgradeBlessedOfValinor	Command				= PLAYER_UPGRADE	Upgrade           	= Upgrade_CreateAHeroBlessedOfValinor	ButtonImage			= SBGood_Sunflare	Options				= CANCELABLE ;HIDE_WHILE_DISABLED	ButtonBorderType	= UPGRADE 	TextLabel			= CONTROLBAR:SpecialAbilityCAH_BlessedOfValinor	DescriptLabel		= CONTROLBAR:ToolTipSpecialAbilityCAH_BlessedOfValinor	Radial            	= Yes	InPalantir	   		= NoEndCommandButton Command_CreateAHero_BlessedOfValinor  Command                 = SPECIAL_POWER   SpecialPower            = SpecialAbilityCreateAHeroBlessedOfValinor  TextLabel               = CONTROLBAR:SpecialAbilityCAH_BlessedOfValinor  ButtonImage             = SBGood_Sunflare ;HSElrondRestoration  ButtonBorderType        = ACTION   DescriptLabel           = CONTROLBAR:ToolTipSpecialAbilityCAH_BlessedOfValinor  InPalantir			  = Yes  AutoAbility				= No  Options					= NONPRESSABLE					  	CreateAHeroUIAllowableUpgrades			  =	Upgrade_CreateAHero_ClassIstariWizardFire Upgrade_CreateAHero_ClassIstariWizardLightning Upgrade_CreateAHero_ClassIstariWizardMagic Upgrade_CreateAHero_ClassIstariWizardPoison	CreateAHeroUIMinimumLevel				  = 10	CreateAHeroUIPrerequisiteButtonName = None	CreateAHeroUICostIfSelected				  = 2000End

2.3. commandset.ini
You need to create a second commandset for EVERY fortress you want to be ably to purchase the new upgrade in.

Here is the IsengarFortress commandset .. both the original.. and the "blessed"


The only change is, that I added 5 = Command_PurchaseUpgradeBlessedOfValinor to the Blessed Commandset. Make sure that the "InitialVisible = " Value matches the number of buttons in the Main Menu

And another thing, some Fortresses don't have a "free" button between the Main Menu and the next layer (upgrades, reviveables). In that case you will have to squeeze the "Command_PurchaseUpgradeBlessedOfValinor" into the Blessed Commandset anyway. and increment every button after it by 1 .. (also You will have to create new Command_SelectRevivables* and Command_SelectUpgrades* Buttons to reflect those changes...
Sounds complicated?
Lets take a look at the Arnor Fortresscode:


As you can see, the Main Menu ends with 6 .. and the next layer starts with 7 .. no room there .. So
in the Blessed Version
the Main Menu ends with 7 and the next layer starts with 8 (and every following button is increased by 1 as well)
Also we have to increase the "InitialVisible" from 6 to 7 .. since now there are 7 Buttons in the Main Menu
And to top it all off, we have introduced two new Buttons
Command_SelectRevivablesArnorFortressBlessed and Command_SelectUpgradesArnorFortressBlessed

Let me show you, how they differ from the original ones. One example should suffice.
Lets take a look at the Command_SelectRevivablesArnorFortress and Command_SelectRevivablesArnorFortressBlessed Buttons

CommandButton Command_SelectRevivablesArnorFortress
	Command				 = PUSH_VISIBLE_COMMAND_RANGE
	TextLabel			   = CONTROLBAR:SelectRevivablesArnorFortress
	ButtonImage			 = UCCommon_GoodHeroes
	ButtonBorderType		= SYSTEM 
	DescriptLabel		   = CONTROLBAR:ToolTipCommandSelectRevivablesArnorFortress
	Radial				  = Yes
	CommandRangeStart		= 13	//Starts its counting at 0, so command button 8 is 7
	CommandRangeCount		= 14
End

CommandButton Command_SelectRevivablesArnorFortressBlessed
	Command				 = PUSH_VISIBLE_COMMAND_RANGE
	TextLabel			   = CONTROLBAR:SelectRevivablesArnorFortress
	ButtonImage			 = UCCommon_GoodHeroes
	ButtonBorderType		= SYSTEM 
	DescriptLabel		   = CONTROLBAR:ToolTipCommandSelectRevivablesArnorFortress
	Radial				  = Yes
	CommandRangeStart		= 14	//Starts its counting at 0, so command button 8 is 7
	CommandRangeCount		= 14
End

As you can see, all I've changed was to increase the CommandRangeStart by the same amount, that we increased the Buttonnumbers in the Blessed Commandset.. "1"

Now we need to tell the fortresses.. that there are some new Commandsets in town

2.4. isengardfortress.ini
Every fortress that you mad a new commandset for needs to be edited like the isengard fortress
CommandSet          = IsengardFortressCommandSet	Behavior = CommandSetUpgrade ModuleTag_IsengardFortressBlessedCommandSet		TriggeredBy		= Upgrade_CreateAHeroBlessedOfValinorEnabler		ConflictsWith	= Upgrade_CreateAHeroBlessedOfValinorForbidden Upgrade_CreateAHeroBlessedOfValinor		CommandSet          = IsengardFortressCommandSetBlessed	End	Behavior = CommandSetUpgrade ModuleTag_IsengardFortressCommandSet		TriggeredBy		= Upgrade_CreateAHeroBlessedOfValinor Upgrade_CreateAHeroBlessedOfValinorForbidden		RequiresAllTriggers			= No		CommandSet          = IsengardFortressCommandSet	End

With these changes the comandset will refresh for the first time, as soon as the Upgrade_CreateAHeroBlessedOfValinorEnabler is granted (at level 10) As long as the Upgrade_CreateAHeroBlessedOfValinorForbidden or Upgrade_CreateAHeroBlessedOfValinor aren't in place yet.
As soon as the Upgrade_CreateAHeroBlessedOfValinor is purchased from the fortress, the commandset is returned to it's original state.. effectively hiding the upgrade Button again.


2.5. experiencelevels_createahero.inc
just like in the basic version. Here the it's the OCL_BlessedHack that grants the Fortressupgradeenabler
ExperienceLevel	CreateAHeroLevel10	TargetNames			 = CreateAHero	RequiredExperience	 = CREATE_A_HERO_LVL10_EXP_NEEDED	ExperienceAward		 = CREATE_A_HERO_LVL10_EXP_AWARD	LevelUpOCL			 = OCL_BlessedHack	Rank				 = 10	AttributeModifiers	 = HeroLevelUpDamage9;	Upgrades			 = CreateAHero_Dummy_not_used_reset_in_code_at_runtime	SelectionDecal		Texture			 = decal_hero_good		Style			 = SHADOW_ALPHA_DECAL		OpacityMin		 = 50% 		OpacityMax		 = 100%		MinRadius		 = 40 ;16		MaxRadius		 = 200 ;16		MaxSelectedUnits = 40 ;1	EndEnd

2.6. createahero.ini
Now this little piece of code makes sure, that the Fortressupgradeoption won't be shown, if the Hero has already purchased the upgrade during CaH Creation.
It will only work if the BlessedOfValinor Power bought during CaH Creation is obtained at the same level as the Upgradeenabler in the experiencelevels_createahero.inc
All in all it just fires a weapon, once the Upgrade_CreateAHeroBlessedOfValinor is obtained.

	Behavior = DamageFieldUpdate ModuleTag_BlessedHackWeapon
		RequiredUpgrade	= Upgrade_CreateAHeroBlessedOfValinor
		ForbiddenUpgrade = Upgrade_CreateAHeroBlessedOfValinorForbidden 
		FireWeaponNugget
			WeaponName		= BlessedWindWeapon
			FireDelay		= 0
			OneShot			= Yes
		End
	End


2.7. weapons.ini
No to define the BlessedWindWeapon
Weapon BlessedWindWeapon
	RadiusDamageAffects = ENEMIES NEUTRALS 
	  DelayBetweenShots			= 0
	ClipSize			   		= 0

  WeaponOCLNugget					
	WeaponOCLName = OCL_UnBlessedHack
	RequiredUpgradeNames	= Upgrade_CreateAHeroBlessedOfValinor
  End
End

2.8. ObjectCreationList.ini
Maybe you noticed, that I used 2 different OCLs
One of those creates the Upgrade_CreateAHeroBlessedOfValinorEnabler, while the other creates Upgrade_CreateAHeroBlessedOfValinorForbidden.
As you can see I added the

2.9. createaheroobjects.inc, lotr.str
The following is alomst the same as in the basic version. I'm just gonna give you the codes without much comment.
I'll leave the lotr.str stuff out, since everybody should know what to do there, after reading the basic version

createaheroobjects.inc
Object BlessedEgg	Draw = W3DScriptedModelDraw ModuleTag_DrawBlessedEgg		DefaultModelConditionState			Model = None		End	End  Body            = ActiveBody ModuleTag_02BlessedHack    MaxHealth         = 10000  End	Behavior 		= GrantUpgradeCreate ModuleTag_BlessedEggUpgradegranter		UpgradeToGrant 	= Upgrade_CreateAHeroBlessedOfValinorEnabler	End 	Behavior = LifetimeUpdate ModuleTag_HatchTriggerBlessedEgg		MinLifetime = 50.0		MaxLifetime = 50.0	End	Behavior = SlowDeathBehavior ModuleTag_HatchProcessBlessedEgg		DestructionDelay	= 3000		FX					= INITIAL FX_BlessedLight	EndEndObject UnBlessedEgg	Draw = W3DScriptedModelDraw ModuleTag_DrawUnBlessedEgg		DefaultModelConditionState			Model = None		End	End  Body            = ActiveBody ModuleTag_02UnBlessedHack    MaxHealth         = 10000  End	Behavior 		= GrantUpgradeCreate ModuleTag_UnBlessedEggUpgradegranter		UpgradeToGrant 	= Upgrade_CreateAHeroBlessedOfValinorForbidden	End 	Behavior = LifetimeUpdate ModuleTag_HatchTriggerUnBlessedEgg		MinLifetime = 50.0		MaxLifetime = 50.0	EndEnd


3.0. Powercode for BlessedOfValinor in createaheropowers.inc
Just to give you an idea what this was all about, the Blessed of Valinor Power
It's just configured for the Wizards right now, the other CaHs will be added soon

//--------------------------------------------------------------------------	// ===== Blessed of Valinor//--------------------------------------------------------------------------	Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroBlessedOfValinorEnabler	SpecialPowerTemplate = SpecialAbilityCreateAHeroBlessedOfValinor	TriggeredBy = Upgrade_CreateAHeroBlessedOfValinor	;RequiresAllTriggers			= NoEndBehavior = SpecialPowerModule ModuleTag_CreateAHeroBlessedOfValinorStarter	SpecialPowerTemplate		= SpecialAbilityCreateAHeroBlessedOfValinor	UpdateModuleStartsAttack	= Yes	StartsPaused				= YesEndBehavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroBlessedOfValinorFireUpdate	//	TODO figure out how to do this as a one time thing	StartsActive	= No ;If no, requires upgrade to turn on.	TriggeredBy		= Upgrade_CreateAHeroBlessedOfValinor	ConflictsWith 	= Upgrade_CreateAHero_ClassIstariWizardMagic Upgrade_CreateAHero_ClassIstariWizardPoison Upgrade_CreateAHero_ClassIstariWizardLightning	BonusName		= BlessedOfValinorFire	RefreshDelay	= 0	Range			= 0	AllowSelf		= YesEndBehavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroBlessedOfValinorLightningUpdate	//	TODO figure out how to do this as a one time thing	StartsActive	= No ;If no, requires upgrade to turn on.	TriggeredBy		= Upgrade_CreateAHeroBlessedOfValinor	ConflictsWith 	= Upgrade_CreateAHero_ClassIstariWizardMagic Upgrade_CreateAHero_ClassIstariWizardFire Upgrade_CreateAHero_ClassIstariWizardPoison	BonusName		= BlessedOfValinorLightning	RefreshDelay	= 0	Range			= 0	AllowSelf		= YesEndBehavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroBlessedOfValinorMagicUpdate	//	TODO figure out how to do this as a one time thing	StartsActive	= No ;If no, requires upgrade to turn on.	TriggeredBy		= Upgrade_CreateAHeroBlessedOfValinor	ConflictsWith 	= Upgrade_CreateAHero_ClassIstariWizardPoison Upgrade_CreateAHero_ClassIstariWizardFire Upgrade_CreateAHero_ClassIstariWizardLightning	BonusName		= BlessedOfValinorMagic	RefreshDelay	= 0	Range			= 0	AllowSelf		= YesEndBehavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroBlessedOfValinorPoisonUpdate	//	TODO figure out how to do this as a one time thing	StartsActive	= No ;If no, requires upgrade to turn on.	TriggeredBy		= Upgrade_CreateAHeroBlessedOfValinor	ConflictsWith 	= Upgrade_CreateAHero_ClassIstariWizardMagic Upgrade_CreateAHero_ClassIstariWizardFire Upgrade_CreateAHero_ClassIstariWizardLightning	BonusName		= BlessedOfValinorPoison	RefreshDelay	= 0	Range			= 0	AllowSelf		= YesEnd


you don't even need to use Lua for this. You can use the GrantUpgradeCreate Behavior. I find it easier to keep all the necessary code in one place :)


Ah thanks!
I didn't know about that one.
gonna try it tomorrow and include it if it works.

It works.. would be great, if I could use the removeupgrade behavior as well.
Sadly I couldn't get it to work, in a way so that a removed "Upgrade_CreateAHeroBlessedOfValinorEnabler" hides the FortressUpgradebutton again.

That way I could reduce the commandset.ini troubles, because I would only need one commandset.. and no fortresscodeediting would be necessary..
Ànybody else knows a way?

Edited by Imladhrim, 07 February 2007 - 01:37 PM.


#6 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 09 February 2007 - 01:17 PM

good job. it's odd things like this that make modding so interesting :p

Quoted for Truth

Solinx
Posted Image

"An expert is a man who has made all the mistakes which can be made in a very narrow field." - Niels Bohr





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users