Page 6 of 6 FirstFirst 123456
Results 101 to 107 of 107

Thread: How to add mercenaries.

  1. #101
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,200

    Default Re: How to add mercenaries.

    Welcome.

    This might work...

    Add the unit to a merc pool with an "xxx" event. Give the character(s) in question the "yyy" trait.

    Code:
    monitor_event CharacterSelected Trait yyy > 0
      set_event_counter xxx 1
    end_monitor
    
    monitor_event CharacterSelected Trait yyy = 0
      set_event_counter xxx 0
    end_monitor
    
    monitor_event PreFactionTurnStart IsFactionAIControlled
      set_event_counter xxx 0
    end_monitor
    
    monitor_event FactionTurnEnd FactionType slave
      set_event_counter xxx 1
    end_monitor
    Anyone with that trait should see the unit. Anyone without it should not.

    It would only work for the player because CharacterSelected only fires on player characters.

    I haven't tested this. It is theory. e.g. Does selecting a character without the trait hide the unit for everybody for the rest of the turn? I hope not but it's possible.

  2. #102

    Default Re: How to add mercenaries.

    I am having trouble with an adaption. In Stainless Steel, Jerusalem gets Syrian Auxilliaries, now I wanted to add them as a recruitable AOR mercenary. I followed these instructions, and copied and relevant details from a similar AOR unit (Desert Archers), and it works with the exception of they are all silver surfers in battle, except for Jerusalem. I don't really know what to do. Do I just make a faction entry in battle_models at this point if it can't read the merc entry?

  3. #103
    Jurand of Cracow's Avatar History and gameplay!
    Artifex

    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    3,233

    Default Re: How to add mercenaries.

    EDIT: disregard this post, sorry, I've found my error.
    Last edited by Jurand of Cracow; February 22, 2020 at 05:32 AM.

  4. #104
    Jurand of Cracow's Avatar History and gameplay!
    Artifex

    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    3,233

    Default Re: How to add mercenaries.

    Guys,
    I've got an issue with the mercenaries, nevertheless.

    Have a look at this code:
    Code:
    pool Eastern_Poland    regions Krakow_Province Halych_Province Plock_Province Hrodna_Province Volodymyr_Province    
        unit Hunters                    exp 2 cost 620 replenish 0.06 - 0.09 max 2 initial 1
        unit Mercenary Crossbowmen        exp 0 cost 360 replenish 0.02 - 0.06 max 1 initial 1 events { mounted_crossbows } end_year 1299
        unit Mercenary Crossbowmen        exp 1 cost 360 replenish 0.03 - 0.09 max 2 initial 1 start_year 1300 end_year 1399
        unit Mercenary Crossbowmen        exp 3 cost 360 replenish 0.05 - 0.13 max 3 initial 2 start_year 1400    
        unit Lithuanian Skirmishers        exp 1 cost 200 replenish 0.03 - 0.09 max 2 initial 0
        unit Woodsmen                    exp 1 cost 388 replenish 0.03 - 0.09 max 2 initial 1 end_year 1300
        unit Macemen                    exp 0 cost 388 replenish 0.03 - 0.09 max 1 initial 0 end_year 1350
        unit Axemen                        exp 1 cost 370 replenish 0.03 - 0.09 max 1 initial 0 end_year 1400
        unit Dismounted Mercenary German Knights    exp 1 cost 680 replenish 0.02 - 0.06 max 1 initial 1 start_year 1350
        unit Free Company Men at Arms        exp 1 cost 615 replenish 0.03 - 0.09 max 1 initial 1 start_year 1400
        unit Mercenary Spearmen            exp 0 cost 501 replenish 0.04 - 0.13 max 2 initial 1 end_year 1229
        unit Prussian Spearmen            exp 1 cost 538 replenish 0.06 - 0.13 max 2 initial 1 start_year 1230 end_year 1350
    and this one from EDU:
    Code:
    type             Woodsmen
    dictionary       Woodsmen      ; Woodsmen, militia
    category         infantry                         
    class            light
    voice_type       Light
    banner faction   main_infantry
    banner holy      crusade
    soldier          Woodsmen, 48, 0, 0.95
    officer          northern_captain
    mount_effect     horse +1, camel +1
    attributes       sea_faring, hide_forest, hardy, can_withdraw, mercenary_unit
    move_speed_mod     1.02
    formation        1.4, 1.4, 2.4, 2.4, 5, square
    stat_health      1, 1
    stat_pri         4, 4, no, 0, 0, melee, melee_blade, slashing, axe, 75, 1
    stat_pri_attr    ap
    stat_sec         0, 0, no, 0, 0, no, melee_simple, blunt, none, 0, 1
    stat_sec_attr    no
    stat_pri_armour  1, 4, 0, flesh
    stat_sec_armour  0, 0, flesh
    stat_heat        3
    stat_ground      1, -1, 3, 1 
    stat_mental      7, low, untrained
    stat_charge_dist 6
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 448, 212, 65, 212, 212, 2, 50
    armour_ug_levels 0, 1
    armour_ug_models Woodsmen, Woodsmen
    ownership        all ; poland, russia, slave
    era 0            poland, russia
    era 1            poland, russia
    era 2            poland, russia
    recruit_priority_offset    -10
    In the intiial few turns only Hunters and Mercernary Spearmen appear as mercenaries.
    What's the explanation why there's no supply of Woodsmen?
    Last edited by Jurand of Cracow; March 07, 2020 at 05:52 AM.

  5. #105
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,830
    Blog Entries
    24

    Default Re: How to add mercenaries.

    The unit does not need the mercenary_unit attribute in the EDU as such - it is there to enable the use of one skin for all factions.

    Hunters have no 'period' restriction so they should show up in the rooster at all time.
    The mercenary spearmen 'period' restriction ends before the woodsmen so if the spearmen are available then the woodsmen should show up in the rooster as well. That said: I am not a great fan of non-faction ownership entries in the EDU. You do not need to use 'all' for mercenary units, simply use any faction. If the unit is not recruitable through settlements then it doesn't matter at all which faction you choose***, otherwise simply leave the faction entries of those that can recruit the through a settlement.

    *** it only makes them available in custom battle unless 'era' entries are used.

    In short: get rid of the 'all' entry in the ownership line.




  6. #106
    Jurand of Cracow's Avatar History and gameplay!
    Artifex

    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    3,233

    Default Re: How to add mercenaries.

    Thanks, Gigantus, it worked indeed. Your advice is very good.

  7. #107
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,830
    Blog Entries
    24

    Default Re: How to add mercenaries.





Page 6 of 6 FirstFirst 123456

Posting Permissions

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