Page 9 of 9 FirstFirst 123456789
Results 161 to 177 of 177

Thread: Lesson 1

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Subuatai de Bodemloze's Avatar No rest for the wicked
    Join Date
    Mar 2008
    Location
    50 degrees, 26.2 minutes North, 119 degrees, 12.4 minutes West
    Posts
    2,436

    Default Re: Lesson 1

    yeah I use Notepad++ The code looks fine to me...?

  2. #2

    Default Re: Lesson 1

    Show the line pls

  3. #3
    Subuatai de Bodemloze's Avatar No rest for the wicked
    Join Date
    Mar 2008
    Location
    50 degrees, 26.2 minutes North, 119 degrees, 12.4 minutes West
    Posts
    2,436

    Default Re: Lesson 1

    Spoiler Alert, click show to read: 
    Code:
    ;----- Scripting 101 -----
    ; Campaign script
    ;
    ;monitor_event FactionTurnEnd FactionIsLocal
     ;commands go here
    ;end_monitor
        ;;;;;;;;;;;;;;;;;;;;;;;;
        ; -- England --
        ;;;;;;;;;;;;;;;;;;;;;;;;
    script
    
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and SettlementName London
     and GovernorInResidence
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     console_command add_money england 20000
    end_monitor
    monitor_event FactionTurnEnd FactionType england
      and FactionIsLocal
     and Treasury >15000
     console_command add_money england, -5000
    end_monitor
    monitor_event FactionTurnEnd
     and FactionIsLocal
     and LosingMoney
     console_command add_money england, 20000
    end_monitor
    monitor_event SettlementUpgraded SettlementName London
     and SettlementBuildingFinished = wooden_pallisade
     and SettlementLoyaltyLevel = loyalty_content
     create_unit London, English Knights, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     console_command add_money england 3000
    end_monitor
    monitor_event SettlementUpgraded SettlementName London
     and SettlementBuildingFinished = wooden_wall
     and GovernorInResidence
     and SettlementLoyaltyLevel = loyalty_content
     console_command add_money england 5000
    end_monitor
    monitor_event FactionTurnEnd FactionType england
      and FactionIsLocal
     and Treasury < 1000
     console_command add_money england, 3000
    end_monitor
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and Treasury < 500
     console_command add_money england, 4500 
    end_monitor
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and OnAWarFooting
     console_command add_money england, 15000
     create_unit London, English Knights, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
    end_monitor
    ; keep script unfinished until last monitor termination
    wait_monitors
    end_script

    Thanks for the assist Icedie...

  4. #4

    Default Re: Lesson 1

    Quote Originally Posted by Sübü'ätäi View Post
    Thanks for the assist Icedie...
    there are some " , " issue in the command, console_command add_maney faction, amount.

    fix that and you should run ok. i guess
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  5. #5
    Subuatai de Bodemloze's Avatar No rest for the wicked
    Join Date
    Mar 2008
    Location
    50 degrees, 26.2 minutes North, 119 degrees, 12.4 minutes West
    Posts
    2,436

    Default Re: Lesson 1

    Got these errors again....
    Spoiler Alert, click show to read: 
    Code:
    21:31:12.609 [game.script] [error] Condition parsing error in mods/scripting_101/data/world/maps/campaign/imperial_campaign/campaign_script.txt, at line 25, column 15
    Value not declared
    
    21:31:12.609 [game.script] [error] Script parsing error at line 29, column 2 in mods/scripting_101/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    don't recognise this token: and
    21:31:12.609 [game.script] [error] Script parsing error at line 31, column 2 in mods/scripting_101/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/scripting_101/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Code:
    ;----- Scripting 101 -----
    ; Campaign script
    ;
    ;monitor_event FactionTurnEnd FactionIsLocal
     ;commands go here
    ;end_monitor
        ;;;;;;;;;;;;;;;;;;;;;;;;
        ; -- England --
        ;;;;;;;;;;;;;;;;;;;;;;;;
    script
    
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and SettlementName London
     and GovernorInResidence
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     console_command add_money england, 20000
    end_monitor
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and Treasury >15000
     console_command add_money england, -5000
    end_monitor
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal ;;;LINE 29
     and LosingMoney
     console_command add_money england, 20000 ;;;LINE 31
    end_monitor
    monitor_event SettlementUpgraded SettlementName London
     and SettlementBuildingFinished = wooden_pallisade
     and SettlementLoyaltyLevel = loyalty_content
     create_unit London, English Knights, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     console_command add_money england, 3000
    end_monitor
    monitor_event SettlementUpgraded SettlementName London
     and SettlementBuildingFinished = wooden_wall
     and GovernorInResidence
     and SettlementLoyaltyLevel = loyalty_content
     console_command add_money england, 5000
    end_monitor
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and Treasury < 1000
     console_command add_money england, 3000
    end_monitor
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and Treasury < 500
     console_command add_money england, 4500 
    end_monitor
    monitor_event FactionTurnEnd FactionType england
     and FactionIsLocal
     and OnAWarFooting
     console_command add_money england, 15000
     create_unit London, English Knights, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
     create_unit London, Peasant Archers, num 5, exp 1, arm 1, wep 2
    end_monitor
    ; keep script unfinished until last monitor termination
    wait_monitors
    end_script
    But they seemed to have fired.. London is full of troops and I have mountains o cash... completed? I say for the most part.. Funny how a comma can screw things up so badly.. Lesson 2 tomorrow!

  6. #6
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Lesson 1

    You don't have a space after the > in and Treasury > 15000

  7. #7
    Subuatai de Bodemloze's Avatar No rest for the wicked
    Join Date
    Mar 2008
    Location
    50 degrees, 26.2 minutes North, 119 degrees, 12.4 minutes West
    Posts
    2,436

    Default Re: Lesson 1

    Maybe not but it did fire. I checked it in the console.

  8. #8
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Lesson 1

    21:31:12.609 [game.script] [error] Script parsing error at line 29, column 2 in mods/scripting_101/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    don't recognise this token: and
    Usually when this happens you have a bad condition or a typo just above it, and when it hits the next line in the script it fails.

    Example:
    Code:
    monitor_event FactionTurnEnd FactionIsLocal
         and FactionType
         and Treasury > 10000
             some_commands
    end_monitor
    As you can see I left out the faction name after FactionType, so the next thing it encounters is the word "and" when its looking for a faction name. this will throw one of two errors, it will either tell you invalid faction name or cant recognize the token AND.

    The best advice I can give is to write your scripts one portion at a time, get it working in sections.

    I really have to thank AL for helping out here as I have been buried with other stuff. I am going to try to catch up tonight on everyone.

  9. #9
    Subuatai de Bodemloze's Avatar No rest for the wicked
    Join Date
    Mar 2008
    Location
    50 degrees, 26.2 minutes North, 119 degrees, 12.4 minutes West
    Posts
    2,436

    Default Re: Lesson 1

    thanks for the info and tutorship you both! GED yeah I hear you about being burried...

Page 9 of 9 FirstFirst 123456789

Posting Permissions

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