Jump to content


Photo

Button disable

mod

  • Please log in to reply
7 replies to this topic

#1 Slava Shadrinov

Slava Shadrinov
  • Members
  • 178 posts
  • Projects:The Word Of Tolkien Mod

Posted 15 February 2017 - 10:33 PM

Hi all!
Need help
How to create button which turns off when porter starting to build barracks and another barracks cannot be build
For example: your porter starting to create barracks and other barracks cannot be build because you do not have resources to build barracks again
At this moment i cant press button to create barracks again

MaxSimultaneousOfType = 1 is not working on this situation because you can build another building when one of porters creating structure
 



#2 malvack

malvack
  • Members
  • 36 posts

Posted 24 February 2017 - 05:25 AM

I dunno if this would help you, and it's kinda overcomplicated, but maybe try using pings that grant and remove upgrades to the builder. For instance, let say that the button for building the barracks is Command_PorterConstructSpecialBarracks, in the part that says Options, add the NEED_UPGRADE flag and

 

NeededUpgrade = UpgradeForJust1Barracks 

 

Also have a ping that is a starting unit that passively grants that upgrade to all porters. Also use the CommandTrigger in Command_PorterConstructSpecialBarracks and trigger a commandbutton that creates a ping that has the RemoveUpgradeUpgrade Module.

 

Or something like that. As I said, is kinda overcomplicated and I'm not sure if it would work. Also, unless you edit each map, the AI won't build it.

Wouldn't you prefer an OCL power that creates that barracks? Like the Dwarven Citadel?



#3 Slava Shadrinov

Slava Shadrinov
  • Members
  • 178 posts
  • Projects:The Word Of Tolkien Mod

Posted 05 March 2017 - 08:26 PM

Hi

Can you answer more concrete about this: (Also have a ping that is a starting unit that passively grants that upgrade to all porters. Also use the CommandTrigger in Command_PorterConstructSpecialBarracks and trigger a commandbutton that creates a ping that has the RemoveUpgradeUpgrade Module.)


Edited by Slava Shadrinov, 05 March 2017 - 08:27 PM.


#4 malvack

malvack
  • Members
  • 36 posts

Posted 25 March 2017 - 02:52 AM

Hmmm, it's a mess I know. Try this: 

1.- Make the construction of the barracks trigger another commandbutton (like the elven gifts spell book power)

2.- Make the triggered button cast a ping that has a leadership bonus (like a statue), but instead of giving extra XP or damage, have something like this:

ModifierList GlorfindelBladeOfPurity
Category = SPELL
ModelCondition = WEAPONSET_TOGGLE_1
End <-- This should only affect porters
3.- In the command button that creates  have this restriction:
DisableOnModelCondition = WEAPONSET_TOGGLE_1
4.- Make sure the ping dies as soon as it's not required, like this:
Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
MinLifetime = TimeRequiredToBuildSpecialBarracks
MaxLifetime = TimeRequiredToBuildSpecialBarracks
End

5.- Have the MaxSimultaneousOfType = 1 in the building

 

If there's any doubt of how to make a ping, check this tutorial by Radspakr, it's a very useful one.

http://www.the3rdage.net/item-505



#5 Slava Shadrinov

Slava Shadrinov
  • Members
  • 178 posts
  • Projects:The Word Of Tolkien Mod

Posted 26 March 2017 - 06:30 PM

Hi again, thanks for answer)

ok im create in commandbutton.ini
 

CommandButton Command_PorterConstructMordorFortress
  Command          = DOZER_CONSTRUCT
  Object           = MordorFortress
  TextLabel        = CONTROLBAR:ConstructMordorFortress
  ButtonImage      = BMFortress
  ButtonBorderType = BUILD 
  DescriptLabel    = CONTROLBAR:ToolTipConstructMordorFortress
  Radial           = Yes  
End
 
CommandButton Command_PurchasePorterConstructMordorFortress
Command = SPECIAL_POWER
      SpecialPower = SpecialAbilityMorPing
ButtonBorderType = ACTION;UPGRADE 
    ButtonImage = SBGood_ElvenGifts 
    ;Science = SCIENCE_ElvenGifts
    TextLabel = CONTROLBAR:ElvenGifts
DescriptLabel = CONTROLBAR:TooltipElvenGifts
DisableOnModelCondition = WEAPONSET_TOGGLE_1
;; Trigger this command button when the purchase science is activated
CommandTrigger = Command_PorterConstructMordorFortress
End

Next im create in system.ini

//------------------------------------------------------------------------------
Object MorPing
 
;;;;EvaEnemyUnitSightedEvent = None ; Not a real unit
 
; ***DESIGN parameters ***
EditorSorting   = SYSTEM
KindOf = NO_COLLIDE IMMOBILE UNATTACKABLE IGNORE_FOR_VICTORY IGNORE_FOR_EVA_SPEECH_POSITION MOVE_ONLY ;INERT
ThreatLevel = 0
 
; *** ENGINEERING Parameters ***
Body = ActiveBody ModuleTag_01
MaxHealth = 999999
InitialHealth = 999999
End
 
Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
MinLifetime = 90000
MaxLifetime = 90000
End
 
Behavior = AttributeModifierAuraUpdate ModuleTag_TroopBonus
      StartsActive = Yes ;If no, requires upgrade to turn on.
      BonusName = MordorLeadership
      RefreshDelay = 1000
      Range = 200
      ObjectFilter = NONE +MordorPorter
      End 
End

Next AttributeModifier.ini

ModifierList MordorLeadership
Category = SPELL
ModelCondition = WEAPONSET_TOGGLE_1
End

In objectcreationlist.ini

ObjectCreationList OCL_SpecialAbilityMorPing
  CreateObject
    ObjectNames = MorPing
    Count = 1
  End
End
 
And Specialpower.ini

;------------------------------------------------------------------------------
SpecialPower SpecialAbilityMorPing
  Enum       = SPECIAL_ARROW_STORM
  ReloadTime = 1000
End
 

This is correct or not?

Edited by Slava Shadrinov, 26 March 2017 - 06:33 PM.


#6 malvack

malvack
  • Members
  • 36 posts

Posted 26 March 2017 - 07:41 PM

I mean, you're on the right track, I think, but there are 2 things you might wanna change. First off, I don't know what are your intentions with the Command_PurchasePorterConstructMordorFortress button. What I'm suggesting, is that you edit the button that builds the special barracks an add the line "commandtrigger", the triggered button should be an ocl creation, like the one used by the Ivory Tower special power. You should create the object (ping) via a triggered button.

 

Also, make the range of the leadership bonus bigger, like 99999 or something like that, so that every porter on the map is affected by the ping's aura.

 

Good luck.



#7 Slava Shadrinov

Slava Shadrinov
  • Members
  • 178 posts
  • Projects:The Word Of Tolkien Mod

Posted 06 April 2017 - 01:36 PM

Hi Malvack!
Sorry for the long answer and thanks for reply
I tried it and I got it. this spawn object (ping) with leadership and when this object stay alive porter commandset toggle)
I also add double commandset to porter (one with fortress and second commandset dont have fortress)
 

CommandSet MordorPorterCommandSet
1  = Command_TogglePorterCommandSet 
      2  = Command_Stop
3  = Command_PorterExtinguishFire
4  = Command_PorterConstructMordorSlaughterHouse
5  = Command_PorterConstructMordorLumberMill
6  = Command_PorterConstructMordorOrcPit
7  = Command_PorterConstructMordorHaradrimPalace
8  = Command_PorterConstructMordorTrollCage
9  = Command_PorterConstructMordorSiegeWorks
10  = Command_PorterConstructMumakilPen
11 = Command_ConstructMordorTavern
12= Command_PorterconstructMordorBattleTower
13= Command_PorterConstructMordorFortress
 
CommandSet MordorPorter2CommandSet
1  = Command_TogglePorterCommandSet 
      2  = Command_Stop
3  = Command_PorterExtinguishFire
4  = Command_PorterConstructMordorSlaughterHouse
5  = Command_PorterConstructMordorLumberMill
6  = Command_PorterConstructMordorOrcPit
7  = Command_PorterConstructMordorHaradrimPalace
8  = Command_PorterConstructMordorTrollCage
9  = Command_PorterConstructMordorSiegeWorks
10  = Command_PorterConstructMumakilPen
11 = Command_ConstructMordorTavern
12= Command_PorterconstructMordorBattleTower
 ; 12 = Command_PorterConstructMordorFortress
 
I think I understood correctly what you wanted to tell me)


#8 malvack

malvack
  • Members
  • 36 posts

Posted 13 April 2017 - 05:20 AM

Hmmm, that's not what I said, but it may work. Changing the commandset so only one porter have the building, could do the trick. 

Try it, and good luck ;)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users