Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: Spoils of War after Battle

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Spoils of War after Battle

    is any of these ideas possible to do?


    this is the prefered one though i think it can't be done:

    After every victoyous battle,generals gain money,depending on total cost of enemy troops defeated in battle.
    So if the defeated army total cost of it's units is 10000$, the faction that won would recieve a x% of that number in money, if the x = 2.5%, then the faction would recieve 250 denarii.


    this also works and i think it's easier to do:

    After every victoyous battle,generals gain money, depending on the number of enemy troops defeated-killed/present in battle.
    So if the defeated army had 1000 units, the faction that won would recieve a x% of that number in money, if the x = 5%, then the faction would recieve 5 denarii.



    this would resemble horses, weapons and armors captured.
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  2. #2
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Spoils of War after Battle

    The first one isn't possible, there aren't enough conditions to check the specifications of each individual unit, otherwise it would be useful in so many other scripts. The second one is probably possible, you'd need to do it through a script, just have a look at events that fire once a battle has completed and find a condition which suits your tastes.

  3. #3
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Spoils of War after Battle

    i was aware of that

    but i don't know how to create a script to make this work, can anyone try to do it for me?



    the probable triggers you'll need (amongst others) are:

    WonBattle
    NumEnemiesInBattle > X

    add_money [insert here] Y

    is there any way to make Y depend on the value of X ?
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  4. #4
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Spoils of War after Battle

    Just off the top of my head, a series of IF statements would probably be your best bet.

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  5. #5
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Spoils of War after Battle

    Quote Originally Posted by Caesar Clivus View Post
    Just off the top of my head, a series of IF statements would probably be your best bet.
    Seeing as how if statements only work with I_ commands, I don't think they'd work for the condition he specified. And Swagger you're much better off learning how to script from the scripting classes available in the Uni and various tutorials. If someone else writes it for you it might not do quite what you want, it will probably only be a snippet code so not the entire thing, and you'd be hard pressed to modify it later.

  6. #6
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Spoils of War after Battle

    Quote Originally Posted by Augustus Lucifer View Post
    Seeing as how if statements only work with I_ commands...
    Oh yeah. Totally forgot

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  7. #7
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Spoils of War after Battle

    Okay then, here's one possible way:

    Code:
    monitor_event PostBattle NumEnemiesInBattle <= 100
            and PercentageEnemyKilled > 10
            and PercentageEnemyKilled < 21
            and WonBattle
        if I_WonBattle france
          add_money france 200
        end_if
       ;;etc etc for each possible faction
    end_monitor
    If you check the number in the battle and then a percentage, you know roughly how many were killed. You can divide this up into chunks, in the above battle between 2 and 20 units would have been killed(depending on how many exactly there were in the battle) for the monitor to fire. You'd copy the same monitor for each percentile chunk and give a monetary bonus based on how much you think it's worth to have killed 11-20% of an army with under 100 men. Then you'd rinse and repeat with something like:

    Code:
    monitor_event PostBattle NumEnemiesInBattle <= 200
            and NumEnemiesInBattle > 100
            and PercentageEnemyKilled > 10
            and PercentageEnemyKilled < 21
            and WonBattle
        if I_WonBattle france
          add_money france 100
        end_if
       ;;etc etc for each possible faction
    end_monitor
    To check for battles where the enemy has between 100-200 troops and you killed 11-20%, then etc. etc. for 21-30% and so on.

    To add more variation you could also include a check for how many troops the player had. This would not matter if you're representing spoils of war since the same spoils are gathered if 8 million guys kill 100 as 200 guys kill 100. But if you wanted to lessen the money a player(or AI, since this script works for all) would get for defeating a significantly weaker army then something like:

    Code:
    monitor_event PostBattle NumEnemiesInBattle <= 100
            and PercentageEnemyKilled > 10
            and PercentageEnemyKilled < 21
            and NumFriendsInBattle < 500
            and WonBattle
        if I_WonBattle france
          add_money france 100
        end_if
       ;;etc etc for each possible faction
    end_monitor
    
    monitor_event PostBattle NumEnemiesInBattle <= 100
            and PercentageEnemyKilled > 10
            and PercentageEnemyKilled < 21
            and NumFriendsInBattle > 500
            and WonBattle
        if I_WonBattle france
          add_money france 10
        end_if
       ;;etc etc for each possible faction
    end_monitor
    Would be an example of giving the winner less money if they outnumbered them. I just pretty much ad-libbed that from skimming through the DocuDemons, which is why I recommend looking at them and figuring out if there's other more fitting commands or etc. Some things to keep in mind are a lot of the useful conditions have exports which won't work with the required monitors. The NumSoldiersCaptured or whatever requires an exported parameter only present in ransom-related events.
    Last edited by Augustus Lucifer; July 06, 2009 at 10:04 PM.

  8. #8
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Spoils of War after Battle

    without being arrogant, im quite a good modder/scripter, but im not much accostumed to this kind of advanced scripts


    if someone makes me a basic script that would simulate the Spoils of War, i could easly edit it accordingly to my wishes, but not making it from scratch...

    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  9. #9
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Spoils of War after Battle

    wouldn't this require a huge ammount of scripts to simulate all options?
    from an enemy army of X units, to Y units, then to Z killed or K killed
    Last edited by Swagger; July 07, 2009 at 07:00 AM.
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  10. #10
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Spoils of War after Battle

    Quote Originally Posted by Swagger View Post
    wouldn't this require a huge ammount of scripts to simulate all option
    n?
    from an enemy army of X units, to Y units, then to Z killed or K killed
    Of course, but what did you expect? Total War scripting doesn't allow parameters and variables and that sort of thing. You can't tell it to give money equal to the number of enemies in a battle, you can only tell it how much money to give exactly and use conditions to narrow down the circumstances in which it applies.

  11. #11
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Spoils of War after Battle

    ok then, i was already expecting that answer


    thanks anyway, i'll have to test it around
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  12. #12
    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: Spoils of War after Battle

    As with many other things, I have thought about something like this for a long time just never got around to making it work. The key to this is traits, and only trying to tie the money to an army with a general.

    Create a new trait with several levels, maybe 10, and call it Warchest.

    Then set some financials for each level.
    level 1 = 1000
    level 2 = 2000

    etc.


    Then move each generals traits up and down according to circumstances. You cant count units, but you CAN track unit types by percentage. And you can also detect when a general is in enemy lands or is in a settlement or whatever.

    If a general is near home, he wont have a very big chest because his supply lines are short and getting money is easy. When he moves into enemy lands he will need to carry more money with him, but the longer he stays in enemy lands and his warchest will start going down.

    Then check the trait at PostBattle. If trait = 1 then transfer x money, if 2 then transfer y money, etc.

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

    Default Re: Spoils of War after Battle

    Quote Originally Posted by GrnEyedDvl View Post
    As with many other things, I have thought about something like this for a long time just never got around to making it work. The key to this is traits, and only trying to tie the money to an army with a general.

    ...

    Then check the trait at PostBattle. If trait = 1 then transfer x money, if 2 then transfer y money, etc.
    Yes, however this won't work if what you're trying to implement is a simple 'raiding' system where you get money simply for defeating enemies, even nameless stacks, along with sacking cities. Yours is a more 'gentlemanly' script where what you do is capture the opposing general's warchest. I'm trying to implement a rather more brutish script where raiding tribes try to attack you in hopes of looting some money from you when you're occupied elsewhere.
    Last edited by SigniferOne; July 16, 2009 at 08:40 PM.


    "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

  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: Spoils of War after Battle

    Quote Originally Posted by SigniferOne View Post
    Yes, however this won't work if what you're trying to implement is a simple 'raiding' system where you get money simply for defeating enemies, even nameless stacks, along with sacking cities. Yours is a more 'gentlemanly' script where what you do is capture the opposing general's warchest. I'm trying to implement a rather more brutish script where raiding tribes try to attack you in hopes of looting some money from you when you're occupied elsewhere.
    You could still check post battle and have a set figure for stacks with no general. The problem with this idea is that the AI wont "know" it gets money for raiding, so if it attacks it will be for reasons other than money.

  15. #15

    Default Re: Spoils of War after Battle

    Can you check the trait of an enemy general? How do you do this?

  16. #16
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Spoils of War after Battle

    Quote Originally Posted by redxavier View Post
    Can you check the trait of an enemy general? How do you do this?
    Just set up the monitor for the losing faction.

    Code:
    monitor_event PostBattle not WonBattle
        and Trait Warchest == 1
    
    if I_WonBattle france
      add_money france 1000
    end_if
    ;;etc etc
    end_monitor

  17. #17

    Default Re: Spoils of War after Battle

    Quote Originally Posted by Augustus Lucifer View Post
    Just set up the monitor for the losing faction.

    Code:
    monitor_event PostBattle not WonBattle
        and Trait Warchest == 1
     
    if I_WonBattle france
      add_money france 1000
    end_if
    ;;etc etc
    end_monitor
    Interesting. I hadn't thought of the monitor working this way (i.e., awarding money on a defeat event). Swagger's first option, or an approximation, could be possible then.

    First, use the unit attributes (e.g., can_sap) to recognise the percentages of particular types of soldiers in an army and associate these attributes with a particular cost (storing each attribute type in a trait). You can use unit categories but attributes will allow for further specification for infantry and cavalry units, so a legionnary can have a higher 'loot' value than a peasant.

    These costs are then added together and constitute a 'loot value' for the army (as per GrnEyedDvl's excellent suggestion you can then have additional factors influencing this value).

    When this army is then defeated in battle the trait level (i.e., loot value) then determines how much money is won by the faction that defeats it.

    I'm not sure when/where you'd monitor the army make-up though, as you'd need to have it relatively constant.
    Last edited by redxavier; July 08, 2009 at 07:58 AM.

  18. #18
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Spoils of War after Battle

    As with many other things, I have thought about something like this for a long time just never got around to making it work. The key to this is traits, and only trying to tie the money to an army with a general.

    Create a new trait with several levels, maybe 10, and call it Warchest.

    Then set some financials for each level.
    level 1 = 1000
    level 2 = 2000

    etc.


    Then move each generals traits up and down according to circumstances. You cant count units, but you CAN track unit types by percentage. And you can also detect when a general is in enemy lands or is in a settlement or whatever.

    If a general is near home, he wont have a very big chest because his supply lines are short and getting money is easy. When he moves into enemy lands he will need to carry more money with him, but the longer he stays in enemy lands and his warchest will start going down.

    Then check the trait at PostBattle. If trait = 1 then transfer x money, if 2 then transfer y money, etc.
    i'm good with ancillaries but horrible at traits, everytime i try to make my own system, it gets all messed up, and the characters get screwed..
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  19. #19
    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: Spoils of War after Battle

    Basically my idea is that they general has to have money with him for stuff like payroll and other logistics needs. This is not based on the size/quality of the army, but on how long he has been away from home. Start him with a large number and the longer he is gone from a settlement the smaller his chest will get.

  20. #20
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Spoils of War after Battle

    well im tempted to ask you to make the trait system script, but i think that would be asking way to much


    if you're indeed able to do it, i think a 5 level system is ok

    (would go like from: bankrupt, poor, stable, wealthy, well supplied)
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


Page 1 of 2 12 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
  •