Thread: Bugs Reports & Technical Help

  1. #4861
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Bugs Reports & Technical Help

    Quote Originally Posted by kostic View Post
    The tutorials say to activate the console with the character (~) but it does not work for me.
    Check this to find out or even set the console button.










  2. #4862

    Default Re: Bugs Reports & Technical Help

    Quote Originally Posted by Macaras View Post
    It may be some problem with the map heights, I would run the cleaner and see what will happen..
    So, I tried to run the cleaner but nothing changed. Yeah it's a problem with map heights. I can't find a solution for now

  3. #4863

    Default Re: Bugs Reports & Technical Help

    Gigantus, if you are somewhere out there listening , would you know if this script that we have:

    monitor_event PreFactionTurnStart I_CompareCounter ai_ec_id > 0
    and Treasury > 100000


    log --- economy script --- AI treasury above 100000
    if I_CompareCounter ai_ec_id = 2
    destroy_units venice, mercenary_unit
    wait 0.1
    set_counter freeze_venice 0
    add_money venice 2147483647
    add_money venice 2147483647
    add_money venice -2147483647
    add_money venice 100000
    end_if
    if I_CompareCounter ai_ec_id = 3
    destroy_units sicily, mercenary_unit
    wait 0.1
    set_counter freeze_sicily 0
    add_money sicily 2147483647

    Could be a source of ctd ? I made tests checking the AI and sometimes had the game working for 200-300 turns, and this script seems to be the only reason for ctd I have encountered.. Specifically seems that the last line in the log is always "destroy units" for various factions, for example:

    16:58:37.729 [game.script.exec] [trace] exec <add_money> at line 47807 in mods/SSHIP_098/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:58:37.729 [game.script.exec] [trace] exec <add_money> at line 47808 in mods/SSHIP_098/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:58:37.729 [game.script.exec] [trace] exec <if> at line 47811 in mods/SSHIP_098/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:58:37.729 [game.script.exec] [trace] exec <destroy_units> at line 47811 in mods/SSHIP_098/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:58:37.731 [game.script.exec] [trace] exec <wait> at line 47812 in mods/SSHIP_098/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:58:37.731 [game.script.timer.display] [trace] Display timer start 0.10, line number 47812, display_update_total_time 866.01
    16:58:37.738 [system.rpt] [error] Medieval 2: Total War encountered an unspecified error and will now exit.
    Line 47812 was more or less around "destroy units". Maybe there are better monitors than monitor_event PreFactionTurnStart, more reliable for this?
    Last edited by Macaras; February 15, 2022 at 03:47 PM.

  4. #4864

    Default Re: Bugs Reports & Technical Help

    Quote Originally Posted by Palm View Post
    No didn't work sorry, it did not change back the cfg, but the game still started in 1024x768. I'll reinstall de game and mod tomorrow maybe I did something wrong with the installation or something, see if that fixes it. Thanks for the help though!
    Reinstalling didn't fix it, but I did fix it with changing the changing the compatibility mode to windows xp service pack 2 on the kingdom2.exe. First time I had to do this, but glad it works now.

  5. #4865
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Bugs Reports & Technical Help

    @Macaras - the script got as far as a 'wait' line, the crash happened then. Basically your log would be referencing these lines of the script:
    Code:
    monitor_event PreFactionTurnStart I_CompareCounter ai_ec_id > 0
        and Treasury > 100000
    
    log --- economy script --- AI treasury above 100000
        if I_CompareCounter ai_ec_id = 2
            destroy_units venice, mercenary_unit
            wait 0.1
            set_counter freeze_venice 0
            add_money venice 2147483647
            add_money venice 2147483647
            add_money venice -2147483647
            add_money venice 100000
            end_if
        if I_CompareCounter ai_ec_id = 3
            destroy_units sicily, mercenary_unit
            wait 0.1
            set_counter freeze_sicily 0
            add_money sicily 2147483647
    Which makes me wonder if it is the 'freeze' counter that causes the issue or rather it's implication. Side note: why would you disband mercenaries with such a humongous treasury?










  6. #4866

    Default Re: Bugs Reports & Technical Help

    This script was written by somebody else, I see the note in the begining:
    ;=======================================================================================
    ;------- G5 Faction Economy Script
    ; G5 version was improved by MWY

    ;===================== CONTENTS =========================
    ;Part 0 -- Is the AI?
    ;Part 1 -- Declare_counters and set ai_ec_id
    ;Part 2 -- Check if FactionIncome < 1500 for non-slave AI factions ----------
    ;Part 3a - Slaves are rich
    ;Part 3b - Slaves are really poor
    ;Part 4 -- Debt levels common for ranked AI factions and rebels
    ;Part 5a -- Slave_faction, Small Debt
    ;Part 5b -- Slaves are not rich
    ;Part 6 -- Small Debt levels, non-rebel AI factions
    ;Part 7 -- 0 < Treasury < 10000 AI non-rebels
    ;Bonus: Additional Mongol Scripts ;gsthoed's note: Mongol Money Script unchanged
    ;========================================================


    I noticed that there are other parts of the script, for example:

    Code:
    monitor_event PreFactionTurnStart I_CompareCounter ai_ec_id > 0
            and Treasury < -5000
    
    
            log --- economy script --- AI treasury less than -5000
            if I_CompareCounter ai_ec_id = 1
                add_money slave 2147483647
                add_money slave 2147483647
                add_money slave -2147483647
                add_money slave -5000
            end_if
    
    
            if I_CompareCounter ai_ec_id = 2
                destroy_units venice, mercenary_unit
                wait 0.1
                set_counter freeze_venice 0
                add_money venice 2147483647
                add_money venice 2147483647
                add_money venice -2147483647
                add_money venice -5000
                set_event_counter freeze_recr_pool 1
            end_if
            if I_CompareCounter ai_ec_id = 3
                destroy_units sicily, mercenary_unit
                wait 0.1
    ....

    Maybe it was done by some script generator? I completely agree it doesn't make sense to destroy mercenaries having 100k money..
    Regarding the freeze, it is set to 1:

    Code:
    ;Part 2 -- Check if FactionIncome < 3000 for non-slave AI factions ----------
        monitor_event FactionTurnStart I_CompareCounter ai_ec_id > 1
            and FactionIncome < 3000
        log --- economy script --- non-slave income less than 3000
    
    
            if I_CompareCounter ai_ec_id = 2
                set_counter freeze_venice 1
            end_if
    And then it is checked:

    Code:
    log --- economy script --- non-slave AI, treasury above 15000
            if I_CompareCounter ai_ec_id = 2
                and I_CompareCounter freeze_venice = 1
                if not I_FactionBesieged venice
                    set_event_counter freeze_recr_pool 1
                end_if
                set_counter freeze_venice 0
            end_if
    On top of all of that we already have another script in different place


    Code:
    ;------- Mercenaries Disband Due to Debts
    
    log --- Start script: mercenaries disband
            log ------ testing for disbanding
            if I_CompareCounter pl_ec_id = 2
                and I_EventCounter venice_mercenary_warning = 1
                destroy_units venice, mercenary_unit
                historic_event mercenaries_disband
            end_if

    So if I am not mistaken, the script's purpose is to control AI budget- if in debt make it -5000, and if too much lower it to 100k ? And freeze the recruitment.. Is the wait 0.1 necessary for the destroy_units command ? If so (since we have another script that does that) maybe all the destroy lines can be deleted together with wait 0.1 that would shorten the turns?
    Last edited by Macaras; February 15, 2022 at 09:36 PM.

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

    Default Re: Bugs Reports & Technical Help

    yes, Wait is necessary for the engine for destroy_ commands (units, buildings). However, @Belovese claimed that it is so miniscule that it makes absolutely no change. He peppered the script with Waits in various places. iirc, he also analysed the debt script with his eye to make it more efficient. I haven't, but given his programming education and perspective, I'd assume it's the most efficient possible.

  8. #4868
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Bugs Reports & Technical Help

    It makes sense to disband mercenaries like in the -5000 debt script\small income script and\or freeze recruiting then - but disbanding in the (+)100000 script? I am fairly sure you are on the right track when thinking script replicator issue.

    Script wisdom - if in doubt 'wait'. A fair number of times it's what saves a script from imploding.
    Last edited by Gigantus; February 16, 2022 at 07:38 AM.










  9. #4869

    Default Re: Bugs Reports & Technical Help

    I have some observations:
    1. The other script disbanding the mercenaries works only for human player, so there is still a need for the economy script to take care of this.
    2. As much as I don't like ctds in this case they are not so frequent as to make it a big problem, and they are never persistent, after reloading the game continues, so its better to be careful not to make more damage than good.
    4. I looked at tsardoms and eb2 and their economy scripts are much simpler, just adding some money when in debt, our seems huge but better (?), freezing recruitment and disbanding mercs.

    Regarding the turn times, I found a discussion about this script in SS6.4:
    https://www.twcenter.net/forums/show...1#post14353589

    gsthoed, who was also working with script, says:
    G5 Economy script has 628 monitors out of 1259 total monitors in CS for early campaign; removing it obviously reduces turn end times significantly.
    Anyway, this is one of the things that to know for sure one needs to do some tests, we have now faster computers and there are many other circumstances changed. I also think that if Belovese checked this, he knew what he was doing. On the other hand, we had so many ctds in the past for different reasons that this ones would pass unnoticed, he could think that all is correct.
    Maybe if I will have some time in the future I will delete the mercenaries disband lines for the "too rich" part of the script and see what happens..

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

    Default Re: Bugs Reports & Technical Help

    Agree with what you, @Macaras, have written. Especially on the CTDs. I'm playing a regular campaing to check how my new scripts work, and I've got 1 crash fo 60 turns. I think it's almost impeccable. I would just add that the changes in the SSHIP were made after that discussion on SS6.4 took place and the conclusions were implemented (or perhaps). MWY worked a lot on this, and if he has chosen that 100000, I think he did it for a reason.

    It seems it works if I'm the richest factions having only over 15k.
    Last edited by Jurand of Cracow; February 17, 2022 at 02:44 AM.

  11. #4871
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Bugs Reports & Technical Help

    Economy scripts have always suffered from their number of monitors due to their requirement of conditions that are not 'if' compatible - which, as observed, heavily impacts turn times.
    The EBII recruit limit script was done by me (template here) and has roughly 23K lines but only 30 monitors, hence no impact on turn times.










  12. #4872

    Default Re: Bugs Reports & Technical Help

    Got 2 silver surfers on my version (SSHIP 0.97 stand alone) of Persian spearmen and Jinetes for every faction (in custom battles and campaign). Also, when are caliph guards allowed to be recruited in the campaign for the Abbasids? I've fully built every single military building in both huge city and citadel and nothing is popping up.
    Attached Thumbnails Attached Thumbnails Persian spearmen silver surfer 1.jpg   Persian spearmen silver surfer 2.jpg   Jinetes silver surfer 1.jpg   Jinetes silver surfer 2.jpg  

  13. #4873
    kostic's Avatar Domesticus
    Join Date
    Jan 2007
    Location
    Near Lyon in France
    Posts
    2,271

    Default Re: Bugs Reports & Technical Help

    Personally I no longer work on the 097 version. Too many things to do to move forward with the 098 beta version.
    In the latter, there shouldn't be any silver surfers because I fixed them.

  14. #4874

    Default Re: Bugs Reports & Technical Help

    Quote Originally Posted by Saladin0912 View Post
    Got 2 silver surfers on my version (SSHIP 0.97 stand alone) of Persian spearmen and Jinetes for every faction (in custom battles and campaign). Also, when are caliph guards allowed to be recruited in the campaign for the Abbasids? I've fully built every single military building in both huge city and citadel and nothing is popping up.
    I don't remember much from the old version 0.97. But in version 0.98, the Caliph's Guards will be recruited whenever the event of "Professional military reform" appear in turn 67. You can recruit them if you choose Accept the reform.
    To be more specific, Caliph's Guards can be recruited in Castle/Fortress only. But you have to wait about 33 turns as I experience from my campaigns.

  15. #4875

    Default Re: Bugs Reports & Technical Help

    Quote Originally Posted by minhnd6789 View Post
    I don't remember much from the old version 0.97. But in version 0.98, the Caliph's Guards will be recruited whenever the event of "Professional military reform" appear in turn 67. You can recruit them if you choose Accept the reform.
    To be more specific, Caliph's Guards can be recruited in Castle/Fortress only. But you have to wait about 33 turns as I experience from my campaigns.
    I think that caliph guards should be recruited OnLY in Bagdhad setlement, maybe in the Palace of the caliph???. Similar to varangian guards and katapracroi only in Constatinople in the Imperial Palace or Tagmata barracks.
    This would make the game more historical and challenging, as well as knowing that if you lose your historical capital you lose these elite units.
    THE MORE YOU SWEAT NOW,
    THE LESS YOU BLEED IN BATTLE!!!



    Sign the petition to remove hardcoded limits for M2TW

  16. #4876

    Default Re: Bugs Reports & Technical Help

    You had me very curious about the new version, so I downloaded it, but I can't believe how old 0.97 is now. The game (0.97) has run smoothly (more so than SS 6.4 itself) besides those two silver surfers and a random crash on turn 5, but so far, this mod is a much needed improvement for SS 6.4. I'm not sure why horse archer/gunners and even most musketeers have lost their long range capability, but I'm assuming its for balance.

    I'm wondering why the Abbasids cannot recruit "Arab infantry" on both 0.97 and 0.98? Was this intended or a bug because I read the unit roster in another thread that the Abbasids should be able to recruit them.

    So far, I've only found two unit cards without a specific picture for them in version 0.98:
    1) Caucasus Hillmen for all factions
    2) Ottoman infantry (For Fatimiyyun ONLY)

    Also, the game in 0.98 only plays in a window version instead of full screen.

    Lastly, are the silver surfers that I posted earlier permanent or is there a way for me to fix it?

    No silver surfers just like you said (in 0.98)
    Quote Originally Posted by kostic View Post
    Personally I no longer work on the 097 version. Too many things to do to move forward with the 098 beta version.
    In the latter, there shouldn't be any silver surfers because I fixed them.

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

    Default Re: Bugs Reports & Technical Help

    open file "configuration.cfg" an change into:

    borderless_window =false
    windowed =false

  18. #4878

    Default Re: Bugs Reports & Technical Help

    Quote Originally Posted by j.a.luna View Post
    I think that caliph guards should be recruited OnLY in Bagdhad setlement, maybe in the Palace of the caliph???. Similar to varangian guards and katapracroi only in Constatinople in the Imperial Palace or Tagmata barracks.
    This would make the game more historical and challenging, as well as knowing that if you lose your historical capital you lose these elite units.
    Indeed, my friend. I agree. That's their responsibility mentioned on the Unit information.

  19. #4879
    kostic's Avatar Domesticus
    Join Date
    Jan 2007
    Location
    Near Lyon in France
    Posts
    2,271

    Default Re: Bugs Reports & Technical Help

    Quote Originally Posted by Saladin0912 View Post
    So far, I've only found two unit cards without a specific picture for them in version 0.98:
    1) Caucasus Hillmen for all factions
    2) Ottoman infantry (For Fatimiyyun ONLY)

    Also, the game in 0.98 only plays in a window version instead of full screen.

    Lastly, are the silver surfers that I posted earlier permanent or is there a way for me to fix it?

    No silver surfers just like you said (in 0.98)
    In my working version, the images of the unit cards you cite do exist, but that of the Ottoman infantry is not accessible to the Fatimid faction. You find it for the Rum faction, however.



    The 098 beta versions follow one another and are updated with a lag in relation to our work in progress. This explains why there may be differences between your version and the one the developers are working on.


    Basic method to fix a silver surfer unit:


    If you want to repair a silver surfer unit on your 097 version, open the 2 files: export_descr_unit.txt and battle_models.modeldb


    1- Look for the concerned unit in the 1st file (Ctrl+F)
    In the line armour_ug_models you have the name of the entry to find in the .modeldb. Below, the factions which use this unit in the campaign, then in the 3 areas of the battles alone.


    2- Once you have found the entry in the battle_models.modeldb, locate the missing faction (which does not grant body or weapon textures)
    Then add an entry - simply copy the entries from another faction - for the body textures and for the weapon textures, taking care to change the corresponding numbers.

    Example :
    Spoiler Alert, click show to read: 
    Assuming the Moors can recruit this unit but it spawns as a Silver Surfer:
    Before the fix

    11 almughavars
    1 1
    63 unit_models/sandy_units/EN_Peasant_Padded/almughavars_lod0.mesh 12000
    4
    5 spain
    52 unit_models/bgskin/textures/almughavar_spain.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    41 unit_sprites/spain_Almughavars_sprite.spr
    6 aragon
    52 unit_models/bgskin/textures/almughavar_arago.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    41 unit_sprites/spain_Almughavars_sprite.spr
    8 portugal
    52 unit_models/bgskin/textures/almughavar_portu.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    44 unit_sprites/portugal_Almughavars_sprite.spr
    5 slave
    52 unit_models/bgskin/textures/almughavar_slave.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    41 unit_sprites/slave_Almughavars_sprite.spr
    4
    5 spain
    68 unit_models/bgskin/attachmentsets/almughav_spain_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_spain_kostic_norm.texture 0
    6 aragon
    68 unit_models/bgskin/attachmentsets/almughav_arago_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_arago_kostic_norm.texture 0
    8 portugal
    68 unit_models/bgskin/attachmentsets/almughav_portu_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_portu_kostic_norm.texture 0
    5 slave
    68 unit_models/bgskin/attachmentsets/almughav_slave_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_slave_kostic_norm.texture 0
    1
    4 None
    17 MTW2_Fast_Javelin
    19 MTW2_Fast_Swordsman
    2
    20 MTW2_Javelin_primary
    14 fs_test_shield
    2
    18 MTW2_Sword_Primary
    14 fs_test_shield
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    After the fix

    11 almughavars
    1 1
    63 unit_models/sandy_units/EN_Peasant_Padded/almughavars_lod0.mesh 12000
    5
    5 spain
    52 unit_models/bgskin/textures/almughavar_spain.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    41 unit_sprites/spain_Almughavars_sprite.spr
    6 aragon
    52 unit_models/bgskin/textures/almughavar_arago.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    41 unit_sprites/spain_Almughavars_sprite.spr
    8 portugal
    52 unit_models/bgskin/textures/almughavar_portu.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    44 unit_sprites/portugal_Almughavars_sprite.spr
    5 slave
    52 unit_models/bgskin/textures/almughavar_slave.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    41 unit_sprites/slave_Almughavars_sprite.spr
    5 moors
    52 unit_models/bgskin/textures/almughavar_slave.texture
    59 unit_models/bgskin/textures/almughavar_arago_normal.texture
    41 unit_sprites/slave_Almughavars_sprite.spr
    5
    5 spain
    68 unit_models/bgskin/attachmentsets/almughav_spain_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_spain_kostic_norm.texture 0
    6 aragon
    68 unit_models/bgskin/attachmentsets/almughav_arago_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_arago_kostic_norm.texture 0
    8 portugal
    68 unit_models/bgskin/attachmentsets/almughav_portu_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_portu_kostic_norm.texture 0
    5 slave
    68 unit_models/bgskin/attachmentsets/almughav_slave_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_slave_kostic_norm.texture 0
    5 moors
    68 unit_models/bgskin/attachmentsets/almughav_slave_kostic_diff.texture
    68 unit_models/bgskin/attachmentsets/almughav_slave_kostic_norm.texture 0
    1
    4 None
    17 MTW2_Fast_Javelin
    19 MTW2_Fast_Swordsman
    2
    20 MTW2_Javelin_primary
    14 fs_test_shield
    2
    18 MTW2_Sword_Primary
    14 fs_test_shield
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002



    3- Save Changes. It is done.


    Note: always keep a backup of the original file in case of error.
    Last edited by kostic; February 22, 2022 at 09:38 AM.

  20. #4880

    Default Re: Bugs Reports & Technical Help

    @Jurand of Cracow It worked! Thank you!

    @kostic It fixed the silver surfer model texture in game (custom battle and campaign)! Thank you for the help there mate. I still have the unit card as the "peasant with knife" still for the Persian spearmen and Jinetes when recruiting, using in battle, or choosing in customs. I'm not sure where exactly I'm meant to fix that particular issue.

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
  •