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

Thread: Food imports

  1. #1

    Default Food imports

    Is it possible to enable food imports with other requirements? For example, being able to build them if you own a province producing a lot of grain, like Alexandria? This way, you could grow your own cities thanks to Alexandria's grain.

    Correct me if I'm wrong, but in EBII you don't need to conquer historically important places for Rome like Sicily or Egypt, because they don't affect the growth of your other cities (or the size of your army, but that's another story) thanks to their grain.

    Sadly, trading in M2TW isn't very deep, so I think anything giving importance to resources could be a nice addition.

  2. #2

    Default Re: Food imports

    Quote Originally Posted by Shylon View Post
    Is it possible to enable food imports with other requirements? For example, being able to build them if you own a province producing a lot of grain, like Alexandria? This way, you could grow your own cities thanks to Alexandria's grain.

    Correct me if I'm wrong, but in EBII you don't need to conquer historically important places for Rome like Sicily or Egypt, because they don't affect the growth of your other cities (or the size of your army, but that's another story) thanks to their grain.

    Sadly, trading in M2TW isn't very deep, so I think anything giving importance to resources could be a nice addition.
    The only obvious way to do that is with scripting, but the problem with scripting is the AI won't "do the right things". So if your baseline system works something like "food almost disappears at certain levels of city development and you need to own certain provinces to fix that", well the AI will NEVER figure that out. So now you need ANOTHER script to deal with AI stupidity, and on and on it goes.

    The lesson being that the "sweet spot" is a system which works for both AI and Human, but I can't think of any way that happens with this proposal. The team has discussed this concept, but couldn't figure out how to make it work with base level mechanics.
    EBII Council

  3. #3

    Default Re: Food imports

    And if I wanted to do it just for myself like a submod? Some kind of restriction and an obligation to conquer provinces with a lot of grain if I want to grow.

    The only thing I can think of is making an event when you own one of these provinces and add the event_counter to the buildings, but I've never done anything like this, so I need help.

    The script could be:

    Code:
        monitor_event SettlementTurnStart SettlementName sett_178        ; Alexandria
            if I_EventCounter NAMEOFEVENT > 1
                terminate_monitor
            end_if
            if I_SettlementOwner sett_178 = f_rome
                set_event_counter NAMEOFEVENT 1
                terminate_monitor
            end_if
        end_monitor
    And then change building_present_min_level govrome socit with event_counter NAMEOFEVENT 1 in granary buildings.

    Am I missing something?

  4. #4

    Default Re: Food imports

    I did a quick test and it's working.

    There is a mistake in the code I posted here:

    Code:
    if I_EventCounter NAMEOFEVENT > 1
    Should be:

    Code:
    if I_EventCounter NAMEOFEVENT > 0
    I just have to create a script for each province with 3 grain resources (Alexandreia, Messana, Syrakousai, Lilubim...).

    I could even make more restrictions. For example, two of these provinces to unlock granary lvl1, then three for lvl2... Or even include provinces with 2 grain.

    Maybe I could reduce base recruitment pool and increase it with granaries. More grain = bigger army.

    It's a shame the AI can't handle something like this without an infinite script.

  5. #5

    Default Re: Food imports

    I didn't mean to come across as throwing cold water on this idea. If it could be made to work reliably, it would certainly be something to consider. The team didn't spend a huge amount of time analysing the problem, just looked at the issue and some possible solutions and couldn't make them work easily. Keep in mind that anything which would work for the mod as a whole means "all factions" and "the AI too".
    EBII Council

  6. #6
    Tiro
    Join Date
    Jun 2014
    Location
    Logrolño ( La Rioja)
    Posts
    234

    Default Re: Food imports

    Wouldnt it be possible adding a "hidden" resource to provinces with grain and adding that hidden resource to the granary building requeriments? or AI couldnt manage that either?
    Of course you should add text in tne granary info screen telling that X level of building needs ownership of Y province-s, or sumething like that. Erhh dunno if you can use a hidden resource ownership as requeriment for a building in another province... it is just an idea that no clue if it is doable

    Regards:

    melvidh

  7. #7

    Default Re: Food imports

    Kull, I understand. My intention was to do it just for myself.

    melvidh, I though about hidden resources at first, but I wasn't sure if you would only be capable of building granaries in provinces with the hidden resource, like you said.

    In case anyone is interested, I've improved the code.

    I though the event_counter would affect AI factions too, but it seems to work only for the human player.

    This is a simple test. Playing with SPQR you own Roma and Capua, each one giving 1 point, and with 2 points you unlock granary building lvl1. If you conquer Taras you'll have 3 points, unlocking granary building lvl2.

    Code:
        monitor_event FactionTurnStart FactionType f_rome
            if I_EventCounter owned_taras = 1
                terminate_monitor
            end_if
            if I_SettlementOwner sett_044 = f_rome
                set_event_counter owned_taras 1
                inc_event_counter grain_imported 1
                terminate_monitor
            end_if
        end_monitor
    
        monitor_event FactionTurnStart FactionType f_rome
            if I_EventCounter owned_roma = 1
                terminate_monitor
            end_if
            if I_SettlementOwner sett_040 = f_rome
                set_event_counter owned_roma 1
                inc_event_counter grain_imported 1
                terminate_monitor
            end_if
        end_monitor
    
        monitor_event FactionTurnStart FactionType f_rome
            if I_EventCounter owned_capua = 1
                terminate_monitor
            end_if
            if I_SettlementOwner sett_042 = f_rome
                set_event_counter owned_capua 1
                inc_event_counter grain_imported 1
                terminate_monitor
            end_if
        end_monitor
    
        monitor_event FactionTurnStart FactionType f_rome
            if I_EventCounter grain_level = 1
                terminate_monitor
            end_if
            if I_EventCounter grain_imported = 2
                set_event_counter grain_level 1
                terminate_monitor
            end_if
        end_monitor
    
        monitor_event FactionTurnStart FactionType f_rome
            if I_EventCounter grain_level = 2
                terminate_monitor
            end_if
            if I_EventCounter grain_imported = 3
                set_event_counter grain_level 2
                terminate_monitor
            end_if
        end_monitor
    Deleting building_present_min_level govrome socit maybe wasn't a good idea, because then you wouldn't have any government restrictions. So I just added or event_counter grain_level 1 and 2 to each building.

  8. #8

    Default Re: Food imports

    Ignore the last part. Keeping government restrictions cancels the entire script.

  9. #9
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,488

    Default Re: Food imports

    I think you're equally mislead in thinking of what "food import" is as I was - see here. This is actually "Food surplus".

  10. #10

    Default Re: Food imports

    I remember reading that.

    I understand what you mean, but I just wanted to give importance to grain resource and use "food import" buildings as if you were actually importing grain from other provinces, so you need first to conquer Sicily, Egypt... to be able to "import" their grain and then build granaries in places like Roma, Capua...

    It's a way to make Roman campaign harder, because right now it's a perfect introduction to the mod, but also very easy. Creating restrictions like reduce base recruitment and increase unit wages and building costs would make expansion harder, so you'd have to conquer rich provinces (income) and provinces with a lot of grain (food) if you want to grow your empire as the Romans did. With more income you can have more units and buildings, and with more food you can have more recruits available.

    It's just an idea. Maybe a future submod. Right now I'm just doing some simple tests.

  11. #11

    Default Re: Food imports

    Quote Originally Posted by Shylon View Post
    It's just an idea. Maybe a future submod. Right now I'm just doing some simple tests.
    It's a very interesting idea, it would be very cool if it was somehow implemented

  12. #12

    Default Re: Food imports

    Thank you.

    I'll continue to mess around with this, but I can't promise anything because I'm just learning to do things with M2TW code.

    I can't find a way to increase building costs and unit wages only for the roman faction, but I guess a solution could be some trade and farming income penalties. This way provinces with precious metals become a top priority if you want more income. Iberia, I'm looking at you...

    I've thought about some growth penalties so you are forced to conquer grain provinces if you want to increase your population, because there are already several buildings and traits rising it.

    I also think I've found a way to keep government restrictions. It's very simple, I need to add the other roman government buildings with not building_present and not building_present_min_level govslave. But I need to test it.

    I tried reducing base recruitment pool from roman buildings and then increase it once you have a granary, and it seems to be working.


    Not bad at the moment.

  13. #13

    Default Re: Food imports

    govslave doesn't have any levels, so not building_present_min_level isn't going to be valid.

    Also note you can't use building_present on recruitment lines, it's an invalid combination.

  14. #14

    Default Re: Food imports

    My mistake, I meant to say govallied. I don't know why I said govslave.

    And about building_present on recruitment lines being invalid, I suspected it because I couldn't find any combination in the code. What I did was to add the units into the granary the same way it's done in military colonies.

    Thanks for your help.
    Last edited by Shylon; November 29, 2017 at 10:17 AM.

  15. #15
    James the Red's Avatar Campidoctor
    Join Date
    Aug 2008
    Location
    Massachusetts
    Posts
    1,631

    Default Re: Food imports

    I suppose there could be a 'food exports' building that lowers the food imports in the province it's built in but increases the money you get per turn from farming. If I understand correctly, agriculture income isn't effected by the population level like tax and trade is, so a building that sacrifices local population growth in exchange for farming income could work maybe? Use the money to pay for food imports or whatever else.
    Last edited by James the Red; December 01, 2017 at 11:01 AM.

  16. #16

    Default Re: Food imports

    That sounds great!

    I'll see if I can test it this weekend.
    Last edited by Shylon; December 01, 2017 at 12:24 PM.

  17. #17

    Default Re: Food imports

    I'm having problems.

    To make a food exports building in a specific province like Alexandria I need to create a unique hidden resource, but there is a hardcoded limit already reached by the mod, so I can't add more.
    Or I could add a new visible resource for provinces with x3 grain, but again a hardcoded limited is reached.

    I don't think I can use an event_counter only for a province, so I have no idea how to include this building.

  18. #18

    Default Re: Food imports

    You shouldn't need a unique hidden ressource, justt use the unique combination of hidden ressources for the Alexandreia province (178). Looking in the desecr_strat nets you the following:

    Code:
    hr_d, hr_g, hr_h, hr_j, hellen1, egypt, satrapy, phalangitai, ioudaioi, nabatu_empire
    "and hidden_resource egypt and hidden_resource hellen1" should be enough to specify the province as far as I can see as Alexandreia ist the only case in egypt where hellen1 applies.

  19. #19

    Default Re: Food imports

    What do you need a new building or hidden_resource for? Just add the capability to the province building for Alexandreia (province_178).

    Or else as Nimor said, target it with the h_r combination above, egypt+hellen1 is unique.

  20. #20

    Default Re: Food imports

    Thank you both.

    Using the combination of hidden resources could be a solution, but I need to check if it works with the other x3 grain provinces as well, Alexandria was only an example.

    Quintus, the new building would be "food exports", as James suggested. A building for provinces you own with x3 grain to unlock "food imports".

    Your solution seems to be what I wanted, I forgot every province has a unique building.

    Edit: Quintus, I can't give you all the reputation you deserve, sorry.
    Last edited by Shylon; December 17, 2017 at 06:39 PM.

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
  •