Page 23 of 33 FirstFirst ... 1314151617181920212223242526272829303132 ... LastLast
Results 441 to 460 of 654

Thread: 12 turns per year with proper aging

  1. #441

    Default Re: 12 turns per year with proper aging

    You're welcome. I'm glad it works for you.

    Greetings

  2. #442
    Reno Melitensis's Avatar Domesticus
    Join Date
    Jul 2006
    Location
    Marsascala, Malta
    Posts
    2,029

    Default Re: 12 turns per year with proper aging

    I am working on Odovacer and a mod I am developing using Odovacer but set in the years prior its events, precisely I have set the start date at 442 AD. But I have noticed that in either mods the script is not working as it should. There seem to be an issue with the turns per year script. The one in Odovacer is not working either, the season alternate from winter to summer to winter, and the characters age at the first turn, winter-summer. I used some of Green Eyed Dragons scripts but with out any success. I checked the IBFD script and it works fine, so I used it to test both Odovacer and my mod, the problem remained there. I also deleted the map.rwn file so that the game generates a new one but again I failed. I changed the date in the descr_strat.txt to start_date 442 winter end_date 500 winter timescale 0.167. I am asking for a bit of help, I don't know if there are any other files that I have to edit, but it seems that in odovacer the script is not being found. I have attached a copy of the start file with GED 6 turns per year script.

    Script
    ; Campaign script
    ; Written by GrnEyedDvl
    ;
    ; Table of Contents
    ; 1. 6 turns per year, characters age in 1st Period
    ;
    ;


    script

    ;show the whole map
    restrict_strat_radar false

    ; 1. 12 Turns per year.
    declare_counter period
    set_counter period 1 ;set to Jan -Feb
    declare_counter winter_severity
    set_counter winter_severity 1

    monitor_event PreFactionTurnStart FactionIsLocal ; set the season for each period
    if I_CompareCounter period == 1 ;Jan, Feb
    console_command season winter
    end_if

    if I_CompareCounter period == 2 ;March April
    console_command season summer
    end_if

    if I_CompareCounter period == 3 ;May June
    console_command season summer
    end_if

    if I_CompareCounter period == 4 ;July Aug
    console_command season summer
    end_if

    if I_CompareCounter period == 5 ;Sept Oct
    and I_CompareCounter winter_severity == 1; normal winter
    console_command season summer
    end_if

    if I_CompareCounter period == 5 ;Sept Oct
    and I_CompareCounter winter_severity == 2; severe winter
    console_command season winter
    historic_event severe_winter
    end_if

    if I_CompareCounter period == 5 ;Sept Oct
    and I_CompareCounter winter_severity == 3; mild winter
    console_command season summer
    end_if

    if I_CompareCounter period == 6 ;Nov Dec
    and I_CompareCounter winter_severity == 1; normal winter
    console_command season winter
    end_if

    if I_CompareCounter period == 6 ;Nov Dec
    and I_CompareCounter winter_severity == 2; severe winter
    console_command season winter
    end_if

    if I_CompareCounter period == 6 ;Nov Dec
    and I_CompareCounter winter_severity == 3; mild winter
    console_command season summer
    historic_event mild_winter
    end_if

    inc_counter period 1 ;advance the period
    if I_CompareCounter period == 7 ;start a new year
    set_counter period 1
    end_if
    end_monitor

    monitor_event FactionTurnEnd FactionType slave
    and I_CompareCounter period > 1
    console_command season summer
    end_monitor

    monitor_event FactionTurnEnd FactionType slave ; randomized winter
    and I_CompareCounter period == 4
    generate_random_counter random_winter 1 10

    if I_EventCounter random_winter >= 1
    and I_EventCounter random_winter <= 8
    set_counter winter_severity 1 ;80 percent chance of severe winter
    end_if

    if I_EventCounter random_winter == 9
    set_counter winter_severity 2 ;10 percent chance of severe winter
    end_if

    if I_EventCounter random_winter == 10
    set_counter winter_severity 3 ;10 percent chance of mild winter
    end_if
    end_monitor

    ; keep script unfinised until last monitor termination
    wait_monitors

    end_script


    Cheers

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: 12 turns per year with proper aging

    Does the radar map restriction on the left disappear?
    Last edited by Gigantus; December 17, 2014 at 05:30 AM.










  4. #444
    Reno Melitensis's Avatar Domesticus
    Join Date
    Jul 2006
    Location
    Marsascala, Malta
    Posts
    2,029

    Default Re: 12 turns per year with proper aging

    Quote Originally Posted by Gigantus View Post
    Does the radar map restriction on the left disappear?
    No, why ?

    Cheers

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: 12 turns per year with proper aging

    That means the script is not working due to some formatting\typing error. restrict_strat_radar false is primarily used to remove the otherwise default restriction of the radar map, the secondary use is to check that the script is fully functional (apart from logical errors).

    The script you posted above is fine, so I can only assume your descr_strat file is missing the script call at the bottom of it:

    script
    campaign_script.txt

    Spoiler for formatted script
    Code:
    ; Campaign script
    ; Written by GrnEyedDvl
    ;
    ; Table of Contents
    ; 1. 6 turns per year, characters age in 1st Period
    ;
    ;
    
    
    script
    
        ;show the whole map
        restrict_strat_radar false
    
        ; 1. 12 Turns per year.
        declare_counter period
        set_counter period 1 ;set to Jan -Feb
        declare_counter winter_severity
        set_counter winter_severity 1
    
        monitor_event PreFactionTurnStart FactionIsLocal ; set the season for each period
            if I_CompareCounter period == 1 ;Jan, Feb
                console_command season winter
            end_if
    
            if I_CompareCounter period == 2 ;March April
                console_command season summer
            end_if
    
            if I_CompareCounter period == 3 ;May June
                console_command season summer
            end_if
    
            if I_CompareCounter period == 4 ;July Aug
                console_command season summer
            end_if
    
            if I_CompareCounter period == 5 ;Sept Oct
                and I_CompareCounter winter_severity == 1; normal winter
                console_command season summer
            end_if
    
            if I_CompareCounter period == 5 ;Sept Oct
                and I_CompareCounter winter_severity == 2; severe winter
                console_command season winter
                historic_event severe_winter
            end_if
    
            if I_CompareCounter period == 5 ;Sept Oct
                and I_CompareCounter winter_severity == 3; mild winter
                console_command season summer
            end_if
    
            if I_CompareCounter period == 6 ;Nov Dec
                and I_CompareCounter winter_severity == 1; normal winter
                console_command season winter
            end_if
    
            if I_CompareCounter period == 6 ;Nov Dec
                and I_CompareCounter winter_severity == 2; severe winter
                console_command season winter
            end_if
    
            if I_CompareCounter period == 6 ;Nov Dec
                and I_CompareCounter winter_severity == 3; mild winter
                console_command season summer
                historic_event mild_winter
            end_if
    
            inc_counter period 1 ;advance the period
            if I_CompareCounter period == 7 ;start a new year
                set_counter period 1
            end_if
        end_monitor
    
        monitor_event FactionTurnEnd FactionType slave
            and I_CompareCounter period > 1
            console_command season summer
        end_monitor
    
        monitor_event FactionTurnEnd FactionType slave ; randomized winter
            and I_CompareCounter period == 4
            generate_random_counter random_winter 1 10
    
            if I_EventCounter random_winter >= 1
                and I_EventCounter random_winter <= 8
                set_counter winter_severity 1 ;80 percent chance of severe winter
            end_if
    
            if I_EventCounter random_winter == 9
                set_counter winter_severity 2 ;10 percent chance of severe winter
            end_if
    
            if I_EventCounter random_winter == 10
                set_counter winter_severity 3 ;10 percent chance of mild winter
            end_if
        end_monitor
    
        ; keep script unfinised until last monitor termination
        wait_monitors
    
    end_script
    Last edited by Gigantus; December 17, 2014 at 07:48 PM.










  6. #446
    Reno Melitensis's Avatar Domesticus
    Join Date
    Jul 2006
    Location
    Marsascala, Malta
    Posts
    2,029

    Default Re: 12 turns per year with proper aging

    Thanks Gigantus, it was the desc_start file missing the bottom entry that was not activating the script. Thanks you, as always of great service.

    Cheers

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: 12 turns per year with proper aging

    Great to hear you got it working.










  8. #448

    Default Re: 12 turns per year with proper aging

    Great scripts, been using the the 12 and 4 turns (optional) with randomized winters with traits for a long while now. I want change it to -40% for severe winters, -20% for normal winters, and -10% for mild. Would it be easier to just redo the trait triggers than try to edit the current ones to account for normal and mild winter thresholds?
    Last edited by alreadyded; January 02, 2015 at 04:05 AM.

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: 12 turns per year with proper aging

    I would give it a shot to redo the triggers (because you need a trait with more levels), looking at the way the triggers are operating now it's probably the sanest option.
    Last edited by Gigantus; January 02, 2015 at 07:15 AM.










  10. #450

    Default Re: 12 turns per year with proper aging

    I have a problem with incorporating the script into my campaign script. I've changed the start from summer to winter and the the timescale to 0.0835. The characters age perfectly well and each year has 12 turns, but the script breaks the triggering of events. I've experimented with different approaches, but couldn't find a solution so far. Can anybody help me, please?

    Here's the beginning of my campaign script where I've inserted the script:


    Code:
    ;
    ; Campaign script
    ;
    
    
    script
          
        ; ---------------------
            ; counters
            
            declare_counter Opened_Faction_Overview_Scroll
            declare_counter Opened_Settlement_Scroll
            declare_counter mongols_sarkel
            declare_counter mongols_yerevan
            declare_counter mongols_baghdad
            declare_counter timurids_sarkel
            declare_counter timurids_yerevan
            declare_counter timurids_baghdad
            
            
            ; ---------------------
            ; start up
    
            freeze_faction_ai aztecs
    
            ;----------------------
            ; monitors
    
            
        ;    1. 12 Turns per year.
    declare_counter month
    set_counter month 1 ;Set to January
    
    monitor_event FactionTurnStart FactionIsLocal ; set the season for each month
        if I_CompareCounter month == 1 ;January
            console_command season winter
        end_if
        
        if I_CompareCounter month == 2 ;February
            console_command season winter
        end_if
        
        if I_CompareCounter month == 3 ;March
            console_command season summer
        end_if
        
        if I_CompareCounter month == 4 ;April
            console_command season summer
        end_if
        
        if I_CompareCounter month == 5 ;May
            console_command season summer
        end_if
        
        if I_CompareCounter month == 6 ;June
            console_command season summer
        end_if
        
        if I_CompareCounter month == 7 ;July
            console_command season summer
        end_if
        
        if I_CompareCounter month == 8 ;August
            console_command season summer
        end_if
        
        if I_CompareCounter month == 9 ;September
            console_command season summer
        end_if
        
        if I_CompareCounter month == 10 ;October
            console_command season winter
        end_if
        
        if I_CompareCounter month == 11 ;November
            console_command season winter
        end_if
        
        if I_CompareCounter month == 12 ;December
            console_command season winter
        end_if
        
        inc_counter month 1 ;advance the month
        if I_CompareCounter month == 13 ;start a new year
            set_counter month 1
        end_if
    end_monitor
    
    monitor_event FactionTurnEnd FactionType slave
        and I_CompareCounter month < 12
        console_command season summer
    end_monitor
    
    
        
        ;-- Mongols invasions --
        monitor_event EventCounter EventCounterType mongols_invasion_warn
            and EventCounter > 0
            ; ADD SCOUTING INVASION
            add_events
                event    counter    mongols_invasion
                date    4 8
           end_add_events
            if I_EventCounter mongols_invasion_warn == 2
                terminate_monitor
            end_if
        end_monitor
    
        monitor_event EventCounter EventCounterType mongols_invasion
            and EventCounter > 0
            if I_EventCounter mongols_invasion == 1
                add_events
            ;;; SCOUTING INVASION
                    event    emergent_faction    mongols
                    date    0
    ;                 region     Tbilisi_Province
                    region     Yerevan_Province
                    region    Bulgar_Province
                    region    Sarkel_Province
                    region     Baghdad_Province
                    movie    event/mongols_invade.bik
                    ;ADD MONGOL INVASION 1
                    event    counter    mongols_invasion
                    date    2
                end_add_events
            end_if
            if I_EventCounter mongols_invasion == 2
     
                ;Sarkel
                if I_CharacterTypeNearTile mongols named_character, 30 258, 134
                    set_counter mongols_sarkel 1
                end_if
                ;Tbilisi / Yerevan
                if I_CharacterTypeNearTile mongols named_character, 20 278, 101
                    set_counter mongols_yerevan 1
                end_if
                ;Baghdad
                if I_CharacterTypeNearTile mongols named_character, 30 291, 70
                    set_counter mongols_baghdad 1
                end_if

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: 12 turns per year with proper aging

    If you have a timescale that does not have simple division, eg 4 or 6 turns per year, 0.25 and 0.5 timescale respectively, then events wrapped in 'add_events' may only fire once (date zero) or not at all (date other then zero). That is a known short coming.

    With some additional scripting and using random counters (eg for date 4 8) the same time delay effect can be achieved.










  12. #452

    Default Re: 12 turns per year with proper aging

    Try placing it at the bottom of your campaign script, it worked for me when I had similar problems.

  13. #453

    Default Re: 12 turns per year with proper aging

    All my generals live until 120y.o how to fix this?

  14. #454

    Default Re: 12 turns per year with proper aging

    Quote Originally Posted by Minn View Post
    All my generals live until 120y.o how to fix this?
    Hello. What mod are you using? Take a look at the "descr_campaign_db_xml" file

    Code:
       <family_tree>
          <max_age uint="90"/>
          <max_age_for_marriage_for_male uint="75"/>
          <max_age_for_marriage_for_female uint="40"/>
          <max_age_before_death uint="105"/>
          <max_age_of_child uint="10"/>
          <old_age uint="60"/>
          <age_of_manhood uint="16"/>
          <daughters_age_of_consent uint="16"/>
          <daughters_retirement_age uint="40"/>
          <age_difference_min int="-10"/>
          <age_difference_max int="30"/>
          <parent_to_child_min_age_diff uint="12"/>
          <min_adoption_age uint="20"/>
          <max_adoption_age uint="30"/>
          <max_age_for_conception uint="50"/>
          <age_of_manhood_close uint="14"/>
          <max_number_of_children uint="4"/>
       </family_tree>

  15. #455

    Default Re: 12 turns per year with proper aging

    Oh here is my
    Code:
    <family_tree>      <max_age uint="300"/>
          <max_age_for_marriage_for_male uint="75"/>
          <max_age_for_marriage_for_female uint="45"/>
          <max_age_before_death uint="150"/>
          <max_age_of_child uint="10"/>
          <old_age uint="60"/>
          <age_of_manhood uint="16"/>
          <daughters_age_of_consent uint="14"/>
          <daughters_retirement_age uint="45"/>
          <age_difference_min int="-10"/>
          <age_difference_max int="30"/>
          <parent_to_child_min_age_diff uint="12"/>
          <min_adoption_age uint="20"/>
          <max_adoption_age uint="30"/>
          <max_age_for_conception uint="50"/>
          <age_of_manhood_close uint="14"/>
          <max_number_of_children uint="4"/>
       </family_tree>

  16. #456

    Default Re: 12 turns per year with proper aging

    300!!!

    Ok. Then adjust the maximum age to your liking. Or you can also copy the numbers I put in the previous post, is the default settings of the game.

  17. #457

    Default Re: 12 turns per year with proper aging

    Thank you very much!

  18. #458

    Default Re: 12 turns per year with proper aging

    You're welcome

  19. #459

    Default Re: 12 turns per year with proper aging

    Hi

    I've got a question.

    I've put the 4 Turns/Base with Traits/Kindoms version im my mod. The mod is based on retrofit. If I put the campaign_script.txt into it, it works. There is a winter, two summers and a winter and this goes on repeatedly.
    I put Export_vnvs into the text library (there's no this kind of file originally so i don't have to delete any bin) the game is running in this case too.
    But when I paste the export_descr_character_traits.txt, the game quits with an error while loading in.
    Could it be the problem that there are new regions?

    My logs: https://www.sendspace.com/file/4y3t5p

  20. #460

    Default Re: 12 turns per year with proper aging

    The problem is solved but the normal military units ae not influenced by the winter's slowing.
    If i mark them individually, they can move normally.

    I do not find the editing, indulgence for the double writing.

Tags for this Thread

Posting Permissions

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