Results 1 to 2 of 2

Thread: Can a technology or a script disable the recruitment of an unit ?

  1. #1
    Goutlard's Avatar Janissary
    Join Date
    Dec 2010
    Location
    France / Turkey
    Posts
    818

    Default Can a technology or a script disable the recruitment of an unit ?

    Hello,
    I would like to find a way to disable the recruitment obsolete units once a certain technological threshold has been obtained.

    I do know a way - making the barracks above a certain technological requirement unable to recruit those units.
    However, that means barracks that weren't upgraded can still recruit those.

    Is it possible to have a technology disable the recruitment of an unit ?
    Or, maybe make a script (LUA) to disable an unit if a technology has been researched ?

    Thank you
    Wind from the East's Awards :

  2. #2
    Quintus Hortensius Hortalus's Avatar Lex duodecim tabularum
    Citizen

    Join Date
    Jun 2011
    Location
    Electorate of Hannover
    Posts
    2,530

    Default Re: Can a technology or a script disable the recruitment of an unit ?

    In theory yes with following code:
    Code:
    -Bavaria
    
        if conditions.ResearchType("military_ordnance_standardization_bavaria", context) then
            scripting.game_interface:add_restricted_unit_record("bavaria_saker")
             scripting.game_interface:add_restricted_unit_record("bavaria_demi_culverin")
             scripting.game_interface:add_restricted_unit_record("bavaria_culverin")
        end
    I don't know if it's really working.

    Under the patronage of wangrin my workshop

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •