Results 1 to 20 of 20

Thread: Adding a food cost for a unit?

Hybrid View

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

    Default Adding a food cost for a unit?

    Is there a way to make every unit a faction recruits subtract 1 food from their food supply?

    Just like how certain buildings subtract food, except units.

  2. #2
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: Adding a food cost for a unit?

    DEI team did it, ask them. Likely a db table but I don't know which one I'm afraid.

  3. #3
    Magnar's Avatar Artifex
    Join Date
    Jul 2013
    Location
    The last place you look
    Posts
    4,370

    Default Re: Adding a food cost for a unit?

    Quote Originally Posted by .Mitch. View Post
    DEI team did it, ask them. Likely a db table but I don't know which one I'm afraid.
    do you know if DeI fixed the issue of armies not requiring food when in enemy provinces?

  4. #4

    Default Re: Adding a food cost for a unit?

    Also: this attrition has nothing to do with whether you're on harsh terrain or not. So you can still be traveling on a road in an enemy territory during winter, and you're still losing dudes.

  5. #5
    MathiasOfAthens's Avatar Comes Rei Militaris
    Join Date
    Nov 2006
    Location
    Stockholm, Sverige
    Posts
    22,877

    Default Re: Adding a food cost for a unit?

    That is interesting. So you are thinking of using the food resource as a limit to army stacks? Smart. No wonder my DEI campaigns are interesting.

  6. #6

    Default Re: Adding a food cost for a unit?

    If you need attrition in enemy territory, I created a mod that does just that! It kills off your men in enemy regions during winter and other bad weather, but keeps them alive during good seasons to simulate them living off the land and foraging.

    http://steamcommunity.com/sharedfile.../?id=243519683

  7. #7

    Default Re: Adding a food cost for a unit?

    DeI is adding food consumption for armies. Unless there's some sort of script someone could come up, there's no way to do that through the DB.

    To set food consumption for an army, DeI is simply using the campaign_stances tables (I believe, near 100% certain based on their description in the .95 preview). You add an effect for food consumption. It won't matter if it's a 1 unit army or a 20 unit army, however. The food cost will be the same. Stances are assigned their effects through the effect bundle for that stance. So, the individual effects are set through the effect_bundles_to_effect_junctions.

    do you know if DeI fixed the issue of armies not requiring food when in enemy provinces?
    This should be an easy fix. The effect scope just has to be set so it draws the food from the faction and not the individual province when in the normal stance.


  8. #8

    Default Re: Adding a food cost for a unit?

    Quote Originally Posted by ABH2 View Post
    DeI is adding food consumption for armies. Unless there's some sort of script someone could come up, there's no way to do that through the DB.

    To set food consumption for an army, DeI is simply using the campaign_stances tables (I believe, near 100% certain based on their description in the .95 preview). You add an effect for food consumption. It won't matter if it's a 1 unit army or a 20 unit army, however. The food cost will be the same. Stances are assigned their effects through the effect bundle for that stance. So, the individual effects are set through the effect_bundles_to_effect_junctions.



    This should be an easy fix. The effect scope just has to be set so it draws the food from the faction and not the individual province when in the normal stance.
    Hmm, so if you were in the effects_junctions table and added, say -5 food as an effect for each army stance, then every army will each subtract 5 food from its faction?

  9. #9

    Default Re: Adding a food cost for a unit?

    Hmm, so if you were in the effects_junctions table and added, say -5 food as an effect for each army stance, then every army will each subtract 5 food from its faction?
    Yes. Just be careful with the effect scope you set.


  10. #10

    Default Re: Adding a food cost for a unit?

    Right, made an account specificly for this as I'm trying to do this in one of my mods. Does anyone know how to set the scope correctly for this? So far all I tried either results in nothing happening or the cost being put on whoever owns the province instead of the army. So I'm kind of stuck. Can someone help me?

  11. #11

    Default Re: Adding a food cost for a unit?

    Quote Originally Posted by zilverdael View Post
    Right, made an account specificly for this as I'm trying to do this in one of my mods. Does anyone know how to set the scope correctly for this? So far all I tried either results in nothing happening or the cost being put on whoever owns the province instead of the army. So I'm kind of stuck. Can someone help me?
    haven't tested it but this should work:

    this_province_faction_all_regions


    Edit also if that doesnt work try useing

    rom_payload_food

    effect scope of

    this_faction

    there is more than 1 way to skin a cat
    Last edited by Regoso; August 27, 2014 at 02:44 PM.

  12. #12

    Default Re: Adding a food cost for a unit?

    Quote Originally Posted by Regoso View Post
    haven't tested it but this should work:

    this_province_faction_all_regions


    Edit also if that doesnt work try useing

    rom_payload_food

    effect scope of

    this_faction

    there is more than 1 way to skin a cat
    Well, I tried this_province_faction_all_regions with building_food_consumption, and that just made it worse (went to -400 food or something)

    rom_payload_food + this_faction seems to work better, at least the amount of food doesn't change if I leave my region, but I now miraculously have 21 armies to feed instead of the 5 that I actually have (or well, 4 and a fleet), so somewhere it still goes wrong.

  13. #13

    Default Re: Adding a food cost for a unit?

    Quote Originally Posted by zilverdael View Post
    Well, I tried this_province_faction_all_regions with building_food_consumption, and that just made it worse (went to -400 food or something)

    rom_payload_food + this_faction seems to work better, at least the amount of food doesn't change if I leave my region, but I now miraculously have 21 armies to feed instead of the 5 that I actually have (or well, 4 and a fleet), so somewhere it still goes wrong.
    maybe this_army for the effect scope with the rom_payload_food sorry im making 2 untis atm so i cant fix this atm for yall

  14. #14

    Default Re: Adding a food cost for a unit?

    Well, made a profile specificly for this question as I'm trying to do this for a mod I'm making. However, I can't get the scope to be correct. Either nothing happens (despite the tooltip saying it costs x food) or it just goes to whoever owns the region which is especially fun in seaside regions since ownership there is quite weird (for example, in the save I'm using for testing at the moment I lose triple as much as I should because of navies that are just outside their own harbor.)

    Anyways, which scope do I need for this? I've tried most of the logical ones by now and none of them do what I wanted.

  15. #15

    Default Re: Adding a food cost for a unit?

    Just looked into the Traits talents and toadies mod cuz it has some traits that alter food. They use rom_payload_food + this_faction. Though they do that on a general. Anyways, I suspect that that's the correct one, so I'l go search as to why I got 16 extra armies to feed.

  16. #16

    Default Re: Adding a food cost for a unit?

    I can't edit my previous post, so another update like this: it appears that the extra armies are at least in some way mine, the armies/flees from the other factions don't appear to influence it. However, it also constantly crashes if I try to go to the next turn, so that's just great...

  17. #17

    Default Re: Adding a food cost for a unit?

    thats odd ill take a look at getting it working as soon as im done with this dang spear unit which is impossible to balance

  18. #18

    Default Re: Adding a food cost for a unit?

    Well, screwed around some more. So far it randomly adds costs, with the boii there's nothing in your lands outside of your own forces at the start yet I'm still 2 food down for no clear reason. If I raise a fleet it doesn't immeadiatly update, however if I raise an army it does. Or if I change an army's stance. And it still crashes somewhere during the waiting for other factions (though the exact points differs, so I suppose it depends on what exactly the AI is doing).

  19. #19

    Default Re: Adding a food cost for a unit?

    bump, still stuck, anyone else managed to make some progress?

Posting Permissions

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