Hello guys, want I am trying to achieve:
Turn Rohan Allies ability from the Gondor Science Tree into passive. So that it allow to purchase Rohirrims from Gondor Stables instead of summoning Rohirrims out of nowhere.
I have made several tries, but the best result I could achieve is as follows:
1. You build the stables
2. You purchase the spell (after the purchase, the spell is shown as an active button at the left of the screen)
3. You need to click on the stables and then click on the Rohirrim summoning button
This is not what I wanted to achieve. I want this to work like elven gifts ability, but allow building rohirrims from stables.
After someexperimetns, I have ended up with completely not working code that looks like this:
commandbutton.ini
CommandButton Command_PurchaseSpellRohanAllies Command = PURCHASE_SCIENCE ButtonBorderType = UPGRADE ButtonImage = SBGood_RohanAllies Science = SCIENCE_RohanAllies TextLabel = CONTROLBAR:SummonRohanAllies DescriptLabel = CONTROLBAR:TooltipSummonRohanAllies CommandTrigger = Command_SpellBookRohanAllies End
CommandButton Command_ConstructRohanRohirrimHorde Command = UNIT_BUILD Object = RohanRohirrimHorde Options = CANCELABLE NEED_UPGRADE NeededUpgrade = Upgrade_RohanAllies ;Upgrade_GondorStableLevel2 TextLabel = CONTROLBAR:ConstructRohanRohirrimHorde ButtonImage = BGStables_Rohirrim ButtonBorderType = BUILD DescriptLabel = CONTROLBAR:ToolTipBuildRohanRohirrimHorde Radial = Yes InPalantir = Yes ShowProductionCount = Yes LacksPrerequisiteLabel = TOOLTIP:LackLevel2Stables End
CommandButton Command_SpellBookRohanAllies Command = SPELL_BOOK SpecialPower = SpellBookRohanAllies ButtonImage = SBGood_RohanAllies Options = NONPRESSABLE;NEED_TARGET_POS ; Huh, you can't have this flag and a radius cursor: CONTEXTMODE_COMMAND TextLabel = CONTROLBAR:SummonRohanAllies DescriptLabel = CONTROLBAR:TooltipSummonRohanAllies End
system.ini
Behavior = PlayerUpgradeSpecialPower ModuleTag_SummonRohans SpecialPowerTemplate = SpellBookRohanAllies UpgradeName = Upgrade_RohanAllies UpdateModuleStartsAttack = No AffectAllies = No ; Should not try to affect ally units AvailableAtStart = No RequirementsFilterMPSkirmish = SPELL_BOOK_REQUIREMENTS_FILTER RequirementsFilterStrategic = SPELL_BOOK_REQUIREMENTS_FILTER_STRATEGIC End
SpecialPower SpellBookRohanAllies Enum = SPECIAL_SPELL_BOOK_ROHAN_ALLIES RequiredSciences = SCIENCE_RohanAllies ReloadTime = 0 ;SPELL_RECHARGE_TIME_TIER_3 ; in milliseconds Flags = RESPECT_RECHARGE_TIME_DISCOUNT End
I am afraid that I do not get how the whole structure should work. My guess was that Command_SpellBookRohanAllies some how should trigger the Upgrade_RohanAllies (which apparently happens when you press the "Command_SpellBookRohanAllies" button). But I don't get how exactly it happens.
The second thing I cannot understand is that CommandTrigger = Command_SpellBookRohanAllies statement from the "Command_PurchaseSpellRohanAllies" should cause the "Command_SpellBookRohanAllies" to get pressed (it seems to be logical)
Do I need to make some changes in the attributemodifier.ini ? A lot of spells have modifier lists there, but it seems that this one mostly contains buffs and debuffs stuff.
What I also wanted to know what actually "Enum = SPECIAL_SPELL_BOOK_ROHAN_ALLIES" line from specialpower.ini is for (what does it do)
And same for "SpecialPowerTemplate = SpellBookRohanAllies" from system.ini
Edited by manowar095, 24 June 2021 - 10:21 PM.