Modding Union

[en] - Modding Corner => Coding => Thema gestartet von: jiraiyathegallent am 31. Jan 2016, 16:21

Titel: Removing the requirements for a unit.
Beitrag von: jiraiyathegallent am 31. Jan 2016, 16:21
Hello everyone I added mirkwood fighters to a building but i need help Removing the requirements to recruit them any help will be great thanks.  :)
Titel: Re: Removing the requirements for a unit.
Beitrag von: Ealendril der Dunkle am 1. Feb 2016, 11:03
Edit the following commandbutton:

CommandButton Command_ConstructLothlorienMirkwoodFighterHorde
    Command                = UNIT_BUILD
    Object                 = LothlorienMirkwoodFighterHorde
    Options                = NEED_UPGRADE CANCELABLE
    TextLabel              = CONTROLBAR:LothlorienMirkwoodFighterHorde
    ButtonImage            = HSMirkwoodSword
    ButtonBorderType       = BUILD
    DescriptLabel          = CONTROLBAR:ToolTipBuildLothlorienMirkwoodFighterHorde
    Radial                 = Yes
    InPalantir             = Yes
    ShowProductionCount    = Yes
    NeededUpgrade          = Upgrade_RaiseSchmiedekunst
    DisableOnModelCondition = RUBBLE POST_RUBBLE
End

Your button should look like this:
CommandButton Command_ConstructLothlorienMirkwoodFighterHorde
    Command                = UNIT_BUILD
    Object                 = LothlorienMirkwoodFighterHorde
    Options                = CANCELABLE
    TextLabel              = CONTROLBAR:LothlorienMirkwoodFighterHorde
    ButtonImage            = HSMirkwoodSword
    ButtonBorderType       = BUILD
    DescriptLabel          = CONTROLBAR:ToolTipBuildLothlorienMirkwoodFighterHorde
    Radial                 = Yes
    InPalantir             = Yes
    ShowProductionCount    = Yes
End
Titel: Re: Removing the requirements for a unit.
Beitrag von: jiraiyathegallent am 1. Feb 2016, 11:21
sorry i shouldve been more specific its for a map.ini and the code doesnt work im guessing because its for the mirkkwoodfighter.ini
Titel: Re: Removing the requirements for a unit.
Beitrag von: Ealendril der Dunkle am 1. Feb 2016, 11:27
Yes, copy the changed code in your map.ini and everything should work. A commandbutton doesnt have anything to do with the ini of an unit.
Titel: Re: Removing the requirements for a unit.
Beitrag von: jiraiyathegallent am 1. Feb 2016, 14:25
it doesnt work just to be sure is this right?

CommandSet GondorRangerTentsCommandSetNew
  1 = Command_ConstructLothlorienMirkwoodFighterHorde
  2 = Command_ConstructLothlorienMirkwoodSpearmenHorde
  3 = Command_ConstructLothlorienMirkwoodArcherHorde
  4 = Command_ConstructMirkwoodElkriderHorde
  6 = Command_Sell

End

Object GondorRangerTents
CommandSet = GondorRangerTentsCommandSetNew

End

CommandButton Command_ConstructLothlorienMirkwoodFighterHorde
    Command                = UNIT_BUILD
    Object                 = LothlorienMirkwoodFighterHorde
    Options                = CANCELABLE
    TextLabel              = CONTROLBAR:LothlorienMirkwoodFighterHorde
    ButtonImage            = HSMirkwoodSword
    ButtonBorderType       = BUILD
    DescriptLabel          = CONTROLBAR:ToolTipBuildLothlorienMirkwoodFighterHorde
    Radial                 = Yes
    InPalantir             = Yes
    ShowProductionCount    = Yes
End
Titel: Re: Removing the requirements for a unit.
Beitrag von: FG15 am 1. Feb 2016, 15:10
You should add the following line to your comandbutton.
    NeededUpgrade          = NoneElse, the game won't override it and keep the old upgrade as a requirement.
Titel: Re: Removing the requirements for a unit.
Beitrag von: jiraiyathegallent am 2. Feb 2016, 04:05
that didnt work sadly