Page 2 of 6 FirstFirst 123456 LastLast
Results 21 to 40 of 112

Thread: How to add mercenaries.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: How to add mercenaries.

    No i think u overlooked Archaon i have checked it right now and it works flawlessly.

    First i placed the event in descr_mercenaries.txt
    unit Mercenary Spearmen exp 9 cost 660 replenish 0.08 - 0.25 max 4 initial 1 events { x_y }
    From the entry it's clear that the unit will replenish in 4 to 12 turns.

    Now place the script
    Spoiler Alert, click show to read: 
    monitor_conditions I_SettlementOwner London = england
    and I_EventCounter x_y == 0
    add_events<-----------------I add the event here
    event counter x_y
    date 0
    end_add_events
    end_monitor

    monitor_conditions not I_SettlementOwner London = england
    and I_EventCounter x_y == 1
    set_event_counter x_y 0<-----------------i remove the event if settlement lost.
    end_monitor

    What i did to confirm was:
    I tested in the campaign itself
    At the very start of it i was able to recruit it so i did it. Now the unit won't appear as it requires around 4-12 turns to replenish.
    So after turn 8 the unit appeared again coz we still had London.
    Now what i did was in the same turn i gave London to the french and the unit was not available now.
    After in the next turn i conquered London again and Voila the unit was again recruitable.
    Try this again it works 100%.

  2. #2
    makanyane's Avatar Praeses
    Content Emeritus

    Join Date
    Feb 2006
    Posts
    9,093
    Blog Entries
    1

    Default Re: How to add mercenaries.

    Am trying to get faction specific mercs working; tried this sort of method
    Quote Originally Posted by Ishan View Post
    To make it more interesting we can now also make a merc unit available to only England when it allies with France.
    So need to add one more event:-
    First make the event (e_o) faction specific:
    Code:
    monitor_event PreFactionTurnStart FactionType england
            set_event_counter  e_o 1
            end_monitor
    monitor_event FactionTurnEnd FactionType england
            and I_EventCounter   e_o == 1
            set_event_counter  e_o 0
            end_monitor
    Now all you have to do is add this event along with x_y in descr_mercenaries.txt file like this
    Code:
    unit Galloglaich            exp 0 cost 830 replenish 0.08 - 0.25  max 4  initial 1 events { x_y e_o }
    And we are done. Now when the 2 factions are Allies(France and England in the above case) only England can recruit this merc unit i.e.(Galloglaich).
    actual code was
    Code:
    monitor_event PreFactionTurnStart FactionType egypt
            if I_EventCounter   egypt_merc_turn == 0
    		console_command create_unit Salient "citlev_naugir" 1 0 0 0
    	end_if
            if I_EventCounter   egypt_merc_turn == 1
    		console_command create_unit Salient "citlev_ashapr" 1 0 0 0
    	end_if
    	set_event_counter egypt_merc_turn 1
    end_monitor
    
    monitor_event FactionTurnEnd FactionType egypt
            if I_EventCounter   egypt_merc_turn == 1
    		console_command create_unit Salient "citlev_feddys" 1 0 0 0
    	end_if
            if I_EventCounter   egypt_merc_turn == 0
    		console_command create_unit Salient "citlev_ashapr" 1 0 0 0
    	end_if
    	set_event_counter egypt_merc_turn 0
    end_monitor
    &
    Code:
    	unit ferakine	exp 0 cost 830 replenish 0.9 - 1.95  max 4 initial 1 events { egypt_merc_turn }
    The initial 1 merc unit did turn up available to egypt only, but it never replenished - I stuck the console_command units in to check the counter was setting to right values and it was (i.e. 0 at start of turn and 1 at end, before it re-sets) - I tried the higher replenish values in case the pool was resetting each time the counter zero'd but that hasn't helped.

    tried also
    Quote Originally Posted by Gigantus View Post
    I have actually used this type of coding (with normal counters) for 1648 to make faction specific coding easier. Instead of wrangling with the faction name and it's coding, you simply use the event counter in the code:
    declare_counter reichs_fraktion ; belongs to a confedaration or not
    declare_counter katholisch ; catholic faction or not
    ;--- Schweden ---
    declare_counter england_turn
    monitor_event PreFactionTurnStart FactionType england
    set_counter england_turn 1
    set_counter reichs_fraktion 0
    set_counter katholisch 0
    end_monitor
    monitor_event FactionTurnEnd FactionType england
    set_counter england_turn 0
    end_monitor
    type method with my code;
    Code:
    declare_counter egypt_merc_turn
    monitor_event PreFactionTurnStart FactionType egypt
    	set_counter egypt_merc_turn 1
    end_monitor
    monitor_event FactionTurnEnd FactionType egypt
    	set_counter egypt_merc_turn 0
    end_monitor
    and don't get the merc at all

    any ideas?

  3. #3

    Default Re: How to add mercenaries.

    Glad to help bro. And have to say u were the one with the insight not me.

  4. #4

    Default Re: How to add mercenaries.

    Hi,i have a problem with mercenaries,all of them in Twothrones 1.1 mod;i have added some of them with this tutorila but my generals can't recruit because the Great helm button is inactive,anyone can help me??

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: How to add mercenaries.

    Quote Originally Posted by Hellvard View Post
    Can i give mercenary unit non-merc texture? I created a italian cavalry militia mercenary unit, and give it textures for both model and attachmentsets from venice unit, as well as sprite. But at the battlefield, soldiers are still silver.
    The texture doesn't matter, but it has to be in the merc faction section in the modeldb
    Quote Originally Posted by geeno View Post
    Hi,i have a problem with mercenaries,all of them in Twothrones 1.1 mod;i have added some of them with this tutorila but my generals can't recruit because the Great helm button is inactive,anyone can help me??
    Maybe the region your general is in is not entered in descr_mercenaries










  6. #6

    Default Re: How to add mercenaries.

    Thanks i will try!

  7. #7

    Default Re: How to add mercenaries.

    Hello it seems I'm the only fool here who hasn't understood the process of changing the texture file, for one thing even tho you outlined in red what should be changed you still added lines to the texture file that are not in red (confusing me at the beginning) and that is not the problem but my problem is the number 4 you changed it to 5 but I didn't quite understand did you mean we increase the number that would be in that place by 1? or change it to 5 always? for example the unit Feudal Knights has the number 13 instead of 4, should i change it to 14 or 5? another thing is how to know what lines to add? where do I get those textures from? and do I always add them where you added them? and for example units like Feudal knights are available to all european nations and are coloured accordingly, so how to change their texture to fit a mercenary tone? can I use the French color for example as a texture?
    It would probably be much easier to answer all these questions by showing me what to change in the feudal knights part of the battle_model file and then I can apply that to all files (I tried to copy exactly what you did in this example but big surprise, that didn't work and the unit remained a silver surfer)

  8. #8

    Default Re: How to add mercenaries.

    New info: I discovered that when adding a unit to mercenary list, if that unit is a recruitable unit by a certain nation and that nation recruits it as a mercenary it will have all the necessary sprites, in other words if one's aim is to add recruitable units to the merc pool of a certain nation and wants to play that nation then he has not to change the texture file or the EDU file for that unit...for example one can simply add all France's recruitable units to the merc pool without changing anything outside of desc_mercenaries and those units would show normal textures if France recruits them

  9. #9

    Default Re: How to add mercenaries.

    it works;

    FACTION SPECIFIC MERS !!! FINALLY

    Code:
    monitor_event PreFactionTurnStart FactionType milan
            and  I_EventCounter rohan_turn == 0
            add_events
            event counter  rohan_turn
            date 0
            end_add_events
        end_monitor
         monitor_event FactionTurnEnd FactionType milan
            and I_EventCounter  rohan_turn == 1
            set_event_counter rohan_turn 0
        end_monitor     
        monitor_event PreFactionTurnStart FactionType sicily
            and  I_EventCounter gondor_turn == 0
            add_events
            event counter  gondor_turn
            date 0
            end_add_events
        end_monitor
         monitor_event FactionTurnEnd FactionType sicily
            and I_EventCounter  gondor_turn == 1
            set_event_counter gondor_turn 0
        end_monitor

  10. #10

  11. #11

    Default Re: How to add mercenaries.

    I've been advised by a credible source that what i am trying to achieve is a lot easier.

    Faction specific merc recruitment is as easy as;

    Code:
    unit Mercenary Spearmen            exp 9 cost 660 replenish 0.08 - 0.25 max 4 initial 1 factions { FactionName }
    However when i add this and load the game,the merc is recruitable by all factions, as thought the factions condition is ignored.

    I didnt see a error in the log either.

    Has anyone seen this in action?

  12. #12
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: How to add mercenaries.

    That condition existed for alex but was not included in M2TW and/or Kingdoms.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  13. #13

    Default Re: How to add mercenaries.

    Quote Originally Posted by Sqυιd View Post
    That condition existed for alex but was not included in M2TW and/or Kingdoms.
    My credible source was King Kong, apparently it is used in his 2.0 release of TA:TW.

    I have not been able to download and install it but will be doing so tonight.
    I guess i'll be looking at the files first and testing if its functioning before i start up a campaign lol

  14. #14

    Default Re: How to add mercenaries.

    Quote Originally Posted by Archaon View Post
    My credible source was King Kong, apparently it is used in his 2.0 release of TA:TW.
    From what I see KK used "religion {insert religion/culture}" to limit selected mercs to specific factions.

    Can someone please tell me if changes to descr_mercenaries are save-game compatible?

  15. #15

    Default Re: How to add mercenaries.

    Quote Originally Posted by Jean=A=Luc View Post
    From what I see KK used "religion {insert religion/culture}" to limit selected mercs to specific factions.
    U can limit it by this also.
    Quote Originally Posted by Jean=A=Luc View Post
    Can someone please tell me if changes to descr_mercenaries are save-game compatible?
    It's not.

  16. #16
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: How to add mercenaries.

    I remember it was either AL or GED that posted about the faction condition in descr_mercenaries so they're knowledge is comparable with regards to coding.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  17. #17
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: How to add mercenaries.

    I have actually used this type of coding (with normal counters) for 1648 to make faction specific coding easier. Instead of wrangling with the faction name and it's coding, you simply use the event counter in the code:
    declare_counter reichs_fraktion ; belongs to a confedaration or not
    declare_counter katholisch ; catholic faction or not
    ;--- Schweden ---
    declare_counter england_turn
    monitor_event PreFactionTurnStart FactionType england
    set_counter england_turn 1
    set_counter reichs_fraktion 0
    set_counter katholisch 0
    end_monitor
    monitor_event FactionTurnEnd FactionType england
    set_counter england_turn 0
    end_monitor
    Last edited by Gigantus; July 23, 2010 at 10:13 PM.










  18. #18

    Default Re: How to add mercenaries.

    Edited & Script posted in my original post Here.
    Last edited by Ishan; July 25, 2010 at 03:00 AM.

  19. #19

  20. #20
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: How to add mercenaries.

    Most likely not as the file is situated in the world folder. Never tried it myself.










Page 2 of 6 FirstFirst 123456 LastLast

Posting Permissions

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