Results 1 to 9 of 9

Thread: Problem with script again

Hybrid View

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

    Default Problem with script again

    i'm sorry. I know i'm very boring with my scripts, but what i can?
    This is my new script. War between Turks and Byzantium. Because turks are to less aggressive, so i needed to do something with it.

    This is my script:
    PHP Code:
    declare_counter turcy_wojna
    declare_counter turcy_pomoc_dana
    declare_counter byzantium_pomoc_dana
    declare_counter turcy_pomoc
    declare_counter byzantium_pomoc

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_TurnNumber 3
        
    and I_NumberOfSettlements byzantium 0
           
    and I_NumberOfSettlements turks 0
        
    and not DiplomaticStanceFromFaction turks AtWar
            generate_random_counter turcy_wojna 1 100
            set_counter turcy_pomoc_dana 0
            set_counter byzantium_pomoc_dana 0
    end_monitor

    monitor_event FactionTurnStart FactionIsLocal
        
    and I_EventCounter turcy_wojna 90
        console_command diplomatic_stance turks byzantium war
        historic_event turcy_wojna true factions 
    turks byzantium , }
    end_monitor

    monitor_event FactionTurnStart FactionType turks
        
    and I_EventCounter turcy_pomoc_dana 0
        generate_random_counter turcy_pomoc 1 3

        
    if I_CompareCounter turcy_pomoc 3
            
    if I_SettlementOwner Iconium turks 
                
    if IsFactionAIControlled turks
                    spawn_army 
    (...)
            
    end
            set_counter turcy_pomoc_dana 1
            end_if
            
    if I_SettlementOwner Caesarea turks 
                
    and I_SettlementOwner Iconium turks 
                
    if not IsFactionAIControlled turks
                    spawn_army 
    (...)
            
    end
            set_counter turks_pomoc_dana 1
            end_if
            
    if I_SettlementOwner Malazgirt turks 
                
    and not I_SettlementOwner Iconium turks 
                
    and not I_SettlementOwner Caesarea turks 
                
    if IsFactionAIControlled turks
                    spawn_army 
    (...)
            
    end
            set_counter turcy_pomoc_dana 1
            end_if
        
    if I_CompareCounter turcy_pomoc 3
        end_if
            end_if
        end_if
    end_monitor 
    And this is my log:
    17:32:56.007 [game.script] [error] Script parsing error at line 433, column 1 in mods/oikoumene/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    don't recognise this token: end_monitor
    17:32:56.007 [game.script] [error] Script parsing error at line 439, column 5 in mods/oikoumene/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/oikoumene/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    This applies to line ending attached part of script.

  2. #2
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Problem with script again

    Count your ifs and end_ifs.

  3. #3

    Default Re: Problem with script again

    Or i need to make this script a little bit simplier... But thank you for your suggestions. I'll do it again it wouldn't be against and may be helpful

  4. #4

    Default Re: Problem with script again

    Yeah, it's definetly an if that isn't ended,

    also;
    generate_random_counter turcy_pomoc 1 3

    so
    if I_CompareEventCounter turcy_pomoc = 3
    you don't have to declare event counters by the way,
    I always put my event_counters in CAPS, and my counters in lower case so I can tell them apart because they are so similar.

  5. #5
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Problem with script again

    I always put my event_counters in CAPS, and my counters in lower case so I can tell them apart because they are so similar.
    great suggestion, thanks

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  6. #6

    Default Re: Problem with script again

    What is CAPS?

    And second question: what is difference between I_CompareCounter and I_EventCounter? When to use first condition and when to use second one?

  7. #7

  8. #8

    Default Re: Problem with script again

    So it's really good idea

  9. #9

    Default Re: Problem with script again

    The I_EventCounter checks the value of an "event_counter" I_CompareCounter checks the value of a normal "counter"

Posting Permissions

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