Page 1 of 3 123 LastLast
Results 1 to 20 of 42

Thread: Script Parsing error

Hybrid View

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

    Default Script Parsing error

    For some reason the campaign_script has a parsing error when reading this part of the script:
    Code:
    ;############Foldburg Isengard Raiders are spawned
    declare_counter isengard_raiders_siege
    declare_counter delayattack001
    monitor_event FactionTurnStart I_CompareCounter isengard_raiders = 1    
        and not I_CharacterExists isengard_raider1
        and I_CharacterExists Saruman
        and I_CharacterExists Theoden
                spawn_army 
                faction slave, sub_faction france
                    character random_name, named character, family, age 32, x 170, y 176, label isengard_raider1, direction N
                    unit Uruk-Hai Raiders        exp 0 armour 1 weapon_lvl 0
                    unit Uruk-Hai Raiders        exp 0 armour 1 weapon_lvl 0
                    unit Uruk-Hai Archers        exp 0 armour 1 weapon_lvl 0
                    unit Uruk-Hai Archers        exp 0 armour 1 weapon_lvl 0
                    unit Berserkers              exp 0 armour 1 weapon_lvl 0
                    unit Berserkers              exp 0 armour 1 weapon_lvl 0
                    unit Uruk-Hai Pikemen        exp 0 armour 1 weapon_lvl 0
                    unit Uruk-Hai Pikemen        exp 0 armour 1 weapon_lvl 0
                    unit Uruk-Hai Pikemen        exp 0 armour 1 weapon_lvl 0
                    unit Uruk-Hai Pikemen        exp 0 armour 1 weapon_lvl 0
                    sieging
            siege_settlement isengard_raider1, Westfold, maintain
        set_counter delayattack001 1
        set_counter isengard_raiders_siege 1
        terminate_monitor     
    end_monitor
    Here is the error log:
    Code:
    13:05:48.796 [game.script] [error] Script parsing error at line 4643, column 74 in mods/Third_Age_3/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Unrecognised unit data string ()
    13:05:48.796 [game.script] [error] Script parsing error at line 4645, column 17 in mods/Third_Age_3/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/Third_Age_3/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    The lines are highlighted.

    Many thanks,
    The Uruk

  2. #2
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Script Parsing error

    Have you tried to comment those two lines out and see whether or not any other parsing errors occur?
    If no other errors occur, rewrite said lines below the outcommented lines. See what happens.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

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

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Script Parsing error

    you must write

    army
    unit blah

    EDIT no I was wrong, this is in descr_strat!
    Last edited by Kiliç Alì; February 12, 2012 at 10:44 AM.

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

  4. #4
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Script Parsing error

    Quote Originally Posted by Kiliç Alì View Post
    you must write

    army
    unit blah
    Uhm nope

    The syntax for spawning an army is perfectly fine.
    Code:
    spawn_army 
    	faction type
    	character	charctername, named character, age 25, x 290, y 220, direction S
    	traits go here
    		unit	unitname	exp 2 armour 1 weapon_lvl 0
    		unit	unitname    exp 1 armour 0 weapon_lvl 0
    end


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

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

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Script Parsing error

    Sorry Aikanar, you right. I was confusing with descr_strat. Will edit previous post.

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

  6. #6
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Script Parsing error

    No problem at all mate


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Script Parsing error

    Is it possible that there are spaces after "Uruk-Hai Raiders" instead of tab(s)? That one gets me all the time.

  8. #8

    Default Re: Script Parsing error

    Does that matter?

    Oops, that could be it, I must stop using spaces...

  9. #9
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Script Parsing error

    It matters, yes.

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

    Default Re: Script Parsing error

    I don't use any tabs in my edb

  11. #11
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Script Parsing error

    Good to know. But we're talking about campaign_script.

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

    Default Re: Script Parsing error

    lol Ah, I see!

    Ok, in CS I use a tab either side of the unit name.

  13. #13

    Default Re: Script Parsing error

    Thanks for all the help! It worked!

    I got another problem though. I have this script where there is a yes/no event start of the campaign to start the script but after I press yes nothing happens. The diplomatic stance doesn't change. Whats wrong?
    Code:
    ;########################Choose to start script 
    declare_counter rfs_started
    monitor_event PreFactionTurnStart I_CharacterExists Saruman
            and I_TurnNumber = 1
        add_events         
               event counter rfs_start_accepted
               event counter rfs_start_declined
           end_add_events         
          historic_event start_rfs true
            set_event_counter rfs_start_declined 0
            terminate_monitor
    end_monitor
    
    ;If Accepted, Start script
    monitor_event EventCounter EventCounterType rfs_start_accepted
      and I_EventCounter rfs_start_accepted = 1
        set_counter rfs_started 1
        set_event_counter rfs_start_accepted 0
            terminate_monitor    
    end_monitor
    
    ;If Declined, Do not start script
    monitor_event EventCounter EventCounterType rfs_start_declined
      and I_EventCounter rfs_start_declined = 1
        set_event_counter rfs_start_declined 0
            terminate_monitor    
    end_monitor
    
    ;###########Saruman is an ally
    
    monitor_event CharacterTurnStart I_CompareCounter rfs_started = 1        
         
             console_command diplomatic_stance france egypt Allied 
             console_command diplomatic_stance france turks Allied
             console_command diplomatic_stance france milan Allied
             console_command give_ancillary Theoden wormtongue
             set_faction_standing france egypt +9.9
             set_faction_standing france turks +9.9
             set_faction_standing france milan +9.9
             ui_flash_stop
             terminate_monitor
    end_monitor

  14. #14
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Script Parsing error

    I'll just edit your quote and comment behind ";" and additions in this color directly into the quote of yours:
    Quote Originally Posted by The Uruk View Post
    Thanks for all the help! It worked!
    Code:
    ;########################Choose to start script 
    declare_counter rfs_started
    monitor_event PreFactionTurnStart I_CharacterExists Saruman
            and I_TurnNumber = 1
        add_events         ; you do not need to add those lines, if you do not want to specify certain conditions. The yes/no events will be created automatically
               event counter rfs_started_accepted
               event counter rfs_started_declined
           end_add_events         
          historic_event start_rfs rfs_started true faction { factionname }; Inconsistency in the naming of your event, thus changed to the declared counter name
            set_event_counter rfs_start_declined 0ed 1
            terminate_monitor
    end_monitor
    
    ;If Accepted, Start script
    monitor_eventconditions I_EventCounter EventCounterType rfs_started_accepted == 1
      and I_EventCounter rfs_start_accepted = 1
        historic_event start_rfs_started_accepted factions { factionname } ;factions you want it to fire for
        set_counter rfs_started 1
        set_event_counter rfs_started_accepted 0 1 ; I assume you use this event_counter outside the c_s, probably as a condition in EDA, EDCT or EDB, thus better us it activated - If you don't want to use this event_counter as a condition outside the c_s you do not need it at all! 
            terminate_monitor    
    end_monitor
    
    ;If Declined, Do not start script
    declare_counter rfs_started_declined
    monitor_eventconditions I_EventCounter rfs_started_declined == 1 EventCounterType rfs_start_declined
      and I_EventCounter rfs_start_declined = 1
        historic_event rfs_started_declined factions { factionname }
        set_counter rfs_started_declined 1
        set_event_counter rfs_started_declined 01 ; again event_counter for condition use outside c_s set activated - and again, if you don't use this event_counter outside the c_s as a condtion, you do not need it at all!
            terminate_monitor    
    end_monitor
    
    ;###########Saruman is an ally
    
    monitor_event CharacterTurnStart I_CompareCounter rfs_started = 1        
         
             console_command diplomatic_stance france egypt Allied 
             console_command diplomatic_stance france turks Allied
             console_command diplomatic_stance france milan Allied
             console_command give_ancillary Theoden wormtongue
             set_faction_standing france egypt +9.9
             set_faction_standing france turks +9.9
             set_faction_standing france milan +9.9
             ui_flash_stop
             terminate_monitor
    end_monitor
    Last edited by Aikanár; February 13, 2012 at 03:31 PM.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  15. #15
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Script Parsing error

    The reason is because the _accepted and _declined event counter names don't match the historic event name. It must be {historic event name}_accepted, so start_rfs_accepted in this case (or rename the historic event to rfs_start as Aikanar suggests).

    Also you won't see anything happening until the next turn. Because all of the action (diplomacy things etc.) are in a CharacterTurnStart and by the time that you are seeing the scroll (and thus clicking accept) all of the xxxTurnStart events have already happened this turn.

    Maybe that is what you wanted. But if you want it to happen as soon as you click Accept then you could just put all of actions directly into the _accepted monitor...

    Code:
    ;If Accepted, Start script
    monitor_event EventCounter EventCounterType rfs_start_accepted
      and I_EventCounter rfs_start_accepted = 1
        
      set_counter rfs_started 1  ;<-- you might not even need this now
        
      console_command diplomatic_stance france egypt Allied 
      console_command diplomatic_stance france turks Allied
      console_command diplomatic_stance france milan Allied
      console_command give_ancillary Theoden wormtongue
      set_faction_standing france egypt +9.9
      set_faction_standing france turks +9.9
      set_faction_standing france milan +9.9
    
    terminate_monitor    
    end_monitor
    The _declined monitor isn't needed because nothing happens when you click No.

    I would rewrite the whole thing like this...

    Code:
    declare_counter rfs_started
    monitor_event PreFactionTurnStart I_CharacterExists Saruman
      and I_TurnNumber = 1
               
      historic_event rfs_start true 
    
    terminate_monitor
    end_monitor
    
    ;If Accepted, Start script
    monitor_event EventCounter EventCounterType rfs_start_accepted
      and I_EventCounter rfs_start_accepted = 1
        
      set_counter rfs_started 1  
        
      console_command diplomatic_stance france egypt Allied 
      console_command diplomatic_stance france turks Allied
      console_command diplomatic_stance france milan Allied
      console_command give_ancillary Theoden wormtongue
      set_faction_standing france egypt +9.9
      set_faction_standing france turks +9.9
      set_faction_standing france milan +9.9
    
    terminate_monitor    
    end_monitor
    rfs_started is being set but not used by this example. If is not needed by any other parts of your script then you could take it out.

    Not sure why ui_flash_stop was there. Nothing in this script is starting it. A leftover from a copy-paste perhaps?

    By the way, there are two ways to write _accepted and _declined monitors...

    1)
    Code:
    monitor_conditions I_EventCounter rfs_started_accepted == 1
    and

    2)
    Code:
    monitor_event EventCounter EventCounterType rfs_started_accepted
      and I_EventCounter rfs_start_accepted = 1
    or alternatively just

    Code:
    monitor_event EventCounter EventCounterType rfs_started_accepted
      and EventCounter = 1
    monitor_conditions can add lag to the game. There are times when they are the only option but _accepted/_declined monitors is not one of them.

  16. #16
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Script Parsing error

    Right about the _conditions. I've actually never came across them really causing lag, but they do use calculating time, thus used excessive or when the game is run on a slower machine, then lag is really something you've to be concerned about.
    Thanks Withwnar, I always tend to forget about lag altogether


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  17. #17
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Script Parsing error

    No worries. I have heard that monitor_conditions can hurt screen scrolling response when a character (or settlement?) is selected. As to how bad it is for end turn times etc. I really don't know but I try to avoid them just in case.

  18. #18
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Script Parsing error

    right, as well never came across that one either, but, one never knows.
    Anyways thx for the reminder

    Ah and concerning the declined event, true, as long as he does not want something to happen in that case he'd need it


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  19. #19

    Default Re: Script Parsing error

    Thanks for all your help!
    I got the yes/no event to work but two other parts of the same script have errors:
    A diplomatic_stance problem
    Script:
    Code:
    ;If Accepted, Start script
    monitor_event EventCounter EventCounterType rfs_start_accepted
      and I_EventCounter rfs_start_accepted = 1
        set_counter rfs_started 1
        set_event_counter rfs_start_accepted 0
        console_command diplomatic_stance france egypt Allied 
        console_command diplomatic_stance france turks Allied
        console_command diplomatic_stance france milan Allied
        console_command give_ancillary Theoden wormtongue
        set_faction_standing france egypt +9.9
        set_faction_standing france turks +9.9
        set_faction_standing france milan +9.9
            terminate_monitor    
    end_monitor
    
    ;If Declined, Do not start script
    monitor_event EventCounter EventCounterType rfs_start_declined
      and I_EventCounter rfs_start_declined = 1
        set_event_counter rfs_start_declined 0
            terminate_monitor    
    end_monitor
    Error in log:
    Code:
    21:28:58.796 [game.script] [error] Script execution error for <console_command>, at line 4571, in mods/Third_Age_3/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    diplomatic_stance france egypt Allied 
    err: diplomatic_stance stance unknown
    And a factiontype error:
    Script
    Code:
    ;###########Saruman's intentions are clear but Rohan cannot strike back
    declare_counter isengard_raiders
    monitor_event CharacterTurnStart I_CompareCounter rfs_started = 1
                    and I_CharacterExists Saruman
                    and I_CharacterExists Theoden
    
                    if I_LocalFaction
                    and FactionType france
                    and DiplomaticStanceFromFaction milan = AtWar
                    console_command diplomatic_stance france turks Neutral 
                    console_command diplomatic_stance france egypt Neutral
                    console_command diplomatic_stance france milan Neutral
                    set_faction_standing france egypt 0
                    set_faction_standing france turks 0
                    set_faction_standing france milan 0
                    set_counter isengard_raiders 1                
                    historic_event isengard_raiders_rohan
                    ui_flash_stop
                    end_if
    
                    if I_TurnNumber = 20
                    and I_LocalFaction
                    and FactionType france
                    and DiplomaticStanceFromFaction milan = Allied
                    console_command diplomatic_stance france egypt Neutral 
                    console_command diplomatic_stance france turks Neutral
                    console_command diplomatic_stance france milan Neutral
                    set_faction_standing france egypt 0
                    set_faction_standing france turks 0
                    set_faction_standing france milan 0
                    historic_event isengard_raiders_rohan
                    set_counter isengard_raiders 1
                    ui_flash_stop
                    end_if
             
             terminate_monitor
    end_monitor
    Error in log
    Code:
    21:29:18.921 [game.script] [error] Script execution error for <if>, at line 4597, in mods/Third_Age_3/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition

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

    Default Re: Script Parsing error

    The problem there is that you have conditions that require exports within your if statements.

    When you make ifs be sure to use only those I_ conditions, and some others. Can check docudemons for conditions with no requirements.

Page 1 of 3 123 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
  •