Results 1 to 20 of 20

Thread: Experience bonus in EDB

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Experience bonus in EDB

    I managed to give an experience bonus to enemy units in the EDB like so (in this case I was playing venice):

    recruits_exp_bonus 6 requires not factions { venice, }

    But the problem is that naturally, that only works if I'm playing venice. If I play england, I have to change it to say england.

    Is there a way to use a "requires not factionislocal" or something of that sort? And if so, how do I word it?


    Retired moderator of TWC
    | Under the patronage of Atterdag

  2. #2
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Experience bonus in EDB

    I dunno if you can use FactionIsLocal or not, I would guess not but you can always try it, then send a spy to see if it worked. Just replace the word Venice with FactionIsLocal.

    Another way to do it would be to add a TroopMorale bonus to all non player generals at the end of the first turn via script/trigger.

  3. #3
    Kundich's Avatar Ordinarius
    Join Date
    May 2007
    Location
    Knoxville, TN
    Posts
    742

    Default Re: Experience bonus in EDB

    Use the first part of the syntax: recruits_exp_bonus 6

    That's exactly how it was in Rome and it continues to work in M2. Your method is cool, in that you can give various bonuses only to specfic factions. Cool.


    Thanks,
    ADM

  4. #4
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Re: Experience bonus in EDB

    Quote Originally Posted by GrnEyedDvl View Post
    I dunno if you can use FactionIsLocal or not, I would guess not but you can always try it, then send a spy to see if it worked. Just replace the word Venice with FactionIsLocal.
    Tried that and a few other things. Got a script error cause it expects factions, culture types or "all".

    Another way to do it would be to add a TroopMorale bonus to all non player generals at the end of the first turn via script/trigger.
    Thing is the AI almost never leads their armies with generals..


    Retired moderator of TWC
    | Under the patronage of Atterdag

  5. #5
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Experience bonus in EDB

    Hmmm I have an idea here but I havent fully fleshed it out, should work though.

    Make two identical building trees, one with the bonuses and one without, then set opposite event_counters in each as a requirement.

    Then modify this script:
    http://www.twcenter.net/forums/showthread.php?t=108423

    Have it turn off one condition and turn on the other when you click a settlement. When you click off the settlement onto something else have it swap them so the AI can build the other tree.

    If you need help writing it let me know.

  6. #6

    Default Re: Experience bonus in EDB

    Can you use FactionTurnStart and FactionIsLocal in the main campaign script? If so it sounds a lot easier to make an event counter called localfaction and set that to 1 if the player is doing his turn and set it to 0 when the AI is processing his turns.

  7. #7

    Default Re: Experience bonus in EDB

    Great find Garnier, I dont suppose this would work for morale as well would it? Because I have been looking for a way of making the AI have a better morale than the human (like in RTW on VH).

  8. #8

    Default Re: Experience bonus in EDB

    There is recruits_morale_bonus, which gives units more morale.

  9. #9

    Default Re: Experience bonus in EDB

    Awesome and thank you so much guys, I really missed the AI getting the morale boost because its been to easy without it. At last I can start to worry again about the battles I am about to fight +rep

  10. #10
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Re: Experience bonus in EDB

    Quote Originally Posted by dave scarface View Post
    Awesome and thank you so much guys, I really missed the AI getting the morale boost because its been to easy without it. At last I can start to worry again about the battles I am about to fight +rep
    Yeah, I've been using both of those bonuses (morale and exp) for a long time.



    Thanks GrnEyedDvl, I've got it to work like so:

    I don't use two building trees, I just put the bonus in for all walls/castles so every unit the AI recruits gets it:
    recruits_exp_bonus 3 requires event_counter recruits_bonus 1
    recruits_morale_bonus 9 requires event_counter recruits_bonus 1


    And in the campaign script:

    Added this to counters:
    declare_counter recruits_bonus

    And this:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;RECRUITS BONUS SCRIPT BEGIN;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter recruits_bonus 1
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
    set_event_counter recruits_bonus 0
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;RECRUITS BONUS SCRIPT END;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


    Retired moderator of TWC
    | Under the patronage of Atterdag

  11. #11
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Experience bonus in EDB

    That works too, nice job.

    The two trees idea was the first one to come to mind that could be scripted, that way is probably better.

  12. #12
    Civis
    Join Date
    Jan 2007
    Location
    Cape Town, South Africa
    Posts
    107

    Default Re: Experience bonus in EDB

    Is it possible to give captains + troop morale and + hitpoint traits. It doesnt matter if the player's captain gets the trait too because I hardly ever attack with captains leading my armies.

  13. #13
    Friend
    Moderator Emeritus

    Join Date
    Oct 2006
    Location
    Beautiful America
    Posts
    8,626

    Default Re: Experience bonus in EDB

    I do not think so.


    Retired moderator of TWC
    | Under the patronage of Atterdag

  14. #14
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Experience bonus in EDB

    Quote Originally Posted by HANDsolo View Post
    Is it possible to give captains + troop morale and + hitpoint traits. It doesnt matter if the player's captain gets the trait too because I hardly ever attack with captains leading my armies.
    Cant be done.

  15. #15

    Default Re: Experience bonus in EDB

    Hi guys,

    I tried putting this in the campaign_script.txt and tested it in game. And it worked, only everyone can get more experienced units (including the player) which kind of defeats the object. So I tried to make this work only for AI controlled factions but then it dont work at all. Do any of you scripting experts know how to get this to work properly for the AI only?

    declare_counter recruits_bonus

    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter recruits_bonus 1
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
    set_event_counter recruits_bonus 0
    end_monitor

    thanks
    Dave

  16. #16
    Lonck's Avatar Centenarius
    Join Date
    Jun 2006
    Location
    mah couch
    Posts
    851

    Default Re: Experience bonus in EDB

    what if you set it to monitor_event FactionTurnEnd not FactionIsLocal
    dunno if you know this but units get recruited (if not under siege) after you click the hourglass.
    Last edited by Lonck; May 03, 2008 at 10:22 AM.

  17. #17

    Default Re: Experience bonus in EDB

    I already tried this thanks, and it did not work out for me.

  18. #18
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Experience bonus in EDB

    You dont have to declare an event_counter, just a normal counter.

    That seems like it actually should work as long as you have the recruits_bonus line in the EDB properly.
    Last edited by GrnEyedDvl; May 03, 2008 at 06:55 PM.

  19. #19

    Default Re: Experience bonus in EDB

    Hi GrneyedDvl,

    I already have this script working, the problem is I'm trying to get this to work only for the AI, or this script is not worth using in my mod. I test this in hotseat mode and so far I cannot get the AI to upgrade its troops experience unless I enter in Garniers script. But his script is not what I am after.

    Dave

  20. #20
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Experience bonus in EDB

    You have to declare the event_counter, before you can use it.

    And the only way to declare an event_counter is to create an event, in the script, declare event_variables within it. See how they do it in the Teutonic campaign, where they limit Lithuanian tech-tree for as long as the Lithuanians don't accept the Christian conversion.


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

Posting Permissions

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