Page 3 of 9 FirstFirst 123456789 LastLast
Results 41 to 60 of 177

Thread: Lesson 1

  1. #41

    Default Re: Lesson 1

    I have made my test , but it didn´t work what is wrong with it?
    Code:
    ;
    ; Campaign script
    ;
    script
    
    monitor_event FactionTurnEnd FactionType east_anglia
    and FactionIsLocal
    console_command add_money east_anglia, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType northumbria
    and FactionIsLocal
    console_command add_money northumbria, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType wessex
    and FactionIsLocal
    console_command add_money wessex, 20000
    end_monitor
    monitor_event FactionTurnEnd FactionType gwynedd
    and FactionIsLocal
    console_command add_money gwynedd, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType fortriu
    and FactionIsLocal
    console_command add_money fortriu, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType mumhan
    and FactionIsLocal
    console_command add_money mumhan, 15000
    end_monitor
    
    end_script
    I try to play with each one of them and non of them received any bonus.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  2. #42

    Default Re: Lesson 1

    Im not entirely sure but I think you need to add the wait monitors part at the bottom to make the script work. That's the most obvious thing I saw anyway, straight away.

    end_monitor

    wait_monitors

    end_script

    like that
    Last edited by Bucket of Lithium; June 20, 2009 at 05:29 PM.


  3. #43

    Default Re: Lesson 1

    No luck, i have the feeling that the game is not using the script file at all.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  4. #44

    Default Re: Lesson 1

    How is your parsing?

    Is it,

    script
    ---------monitor_event etc.
    --------------conditions/commands
    ---------end_monitor

    ---------wait_monitors

    end script

    That seems to work for me, the lines are tabs by the way.


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

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

    Default Re: Lesson 1

    Tabs are not required, it will read the script without them. But I do HIGHLY suggest you format things the same way just to make it easier to read.

    What are you using for a mod folder? That almost looks like the 1066 Conquests mod. I would remove everything except one monitor and see if that runs. That will let you know if your script is being read or not. Also make sure the faction names are spelled correctly.

  6. #46

    Default Re: Lesson 1

    No is my mod Vacuus Lux Lucis an i don´t know what format that mods uses but i have base mine on bare bone kingdoms , my descr_sm_factions looks like this:
    Spoiler Alert, click show to read: 
    Code:
    faction                        east_anglia
    culture                        southern_european
    religion                    anglo-saxon
    symbol                        models_strat/symbol_england.CAS
    rebel_symbol                models_strat/symbol_rebels.CAS
    primary_colour                red 2, green 2, blue 150
    secondary_colour            red 255, green 210, blue 0
    loading_logo                loading_screen/symbols/symbol128_england.tga
    standard_index                12
    logo_index                    FACTION_LOGO_MOORS
    small_logo_index            SMALL_FACTION_LOGO_MOORS
    triumph_value                5
    custom_battle_availability    yes
    can_sap                        no
    prefers_naval_invasions        yes
    can_have_princess            yes
    has_family_tree                    yes


    and has all other names , its a complete redo of the mod folder factions, edu, edb, map etc and it all work fine except the scripts i have just put up.

    How will i notice if the script was 1500 like the rest has done, how will they see if it work or not?, i am starting to be skeptical about how you will be able to control others from cheating, i could simply have told you that its done.

    Any ways, will i be able to see it in the Financial details tab? or there is no way to tell that it worked only by adding a massive amount of money like AL has said before?


    Edited:

    Does this image help?
    Last edited by Icedie El Guaraní; June 20, 2009 at 06:15 PM.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


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

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

    Default Re: Lesson 1

    You have to watch the amount of money the faction has right when you click end turn, and you cannot use a new script on a saved game.

  8. #48

    Default Re: Lesson 1

    Okay, I got this script in, real simple one—thought I would see if everything fired before expanding upon it. It fires, but Med2 crashes on the second endturn. I’m using the Barebones folder and I modified the .cfg file as suggested, but nothing is showing up. So, I tried aduellist’s script, exactly as posted. Crashes, second turn. Any idea what is going wrong?
    Spoiler Alert, click show to read: 
    Code:
    ;
    ; Campaign script
    ;
    script
           
    monitor_event FactionTurnEnd FactionIsLocal
     console_command add_money sicily, 15000
    end_monitor
              
            ; keep script unfinished until last monitor termination
     wait_monitors
    end_script
    Son of PW

  9. #49
    aduellist's Avatar Push the button Max!
    Join Date
    Mar 2005
    Location
    Shenandoah Valley
    Posts
    1,822

    Default Re: Lesson 1

    @Icedie

    As a quick check, you can scroll back through the console to see if any appropriate "add_money" commands have been used.

    If you set up logging options, you can find them in the appropriate log.

    I'm using the Barebones folder as a base. Here are the logging options I'm using:

    Code:
    [log]
    to = mods/barebones/logs/Barebones.system.log.txt
    level = game.script* trace
    file = game.script* mods/barebones/logs/Barebones.script.log.txt
    In my Barebones.script.log.txt, I can find messages like this:

    Spoiler Alert, click show to read: 

    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 9 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 15 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 21 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 27 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 33 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 39 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 46 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <wait_monitors> at line 52 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    .
    .
    .
    16:14:15.781 [game.script.exec] [trace] exec <console_command> at line 21 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:14:15.781 [game.script.exec] [trace] exec <console_command> at line 33 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Under the patronage of TheFirstONeill
    Proud team member of
    THERA, A New Beginning


    "The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all." H. L. Mencken

    "Liberty is meaningless where the right to utter one’s thoughts and opinions has ceased to exist. That, of all rights, is the dread of tyrants. It is the right which they first of all strike down." Frederick Douglass

  10. #50

    Default Re: Lesson 1

    Quote Originally Posted by aduellist View Post
    @Icedie

    As a quick check, you can scroll back through the console to see if any appropriate "add_money" commands have been used.

    If you set up logging options, you can find them in the appropriate log.

    I'm using the Barebones folder as a base. Here are the logging options I'm using:

    Code:
    [log]
    to = mods/barebones/logs/Barebones.system.log.txt
    level = game.script* trace
    file = game.script* mods/barebones/logs/Barebones.script.log.txt
    In my Barebones.script.log.txt, I can find messages like this:

    Spoiler Alert, click show to read: 

    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 9 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 15 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 21 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 27 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 33 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 39 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <monitor_event> at line 46 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:10:05.375 [game.script.exec] [trace] exec <wait_monitors> at line 52 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    .
    .
    .
    16:14:15.781 [game.script.exec] [trace] exec <console_command> at line 21 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:14:15.781 [game.script.exec] [trace] exec <console_command> at line 33 in mods/barebones/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Yeah, I'm not getting anything useful in the log. It is set up like that.
    Son of PW

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

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

    Default Re: Lesson 1

    Does it crash with an empty campaign script? If so then its not related to the script but there is another problem.

  12. #52

    Default Re: Lesson 1

    This is the error i got from my old log setting
    Code:
    23:26:34.109 [game.script] [error] Script parsing error at line 10, column 1 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    don't recognise this token: wait_monitor
    23:26:34.109 [game.script] [error] Script parsing error at line 12, column 1 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    23:28:33.655 [game.script] [error] Trigger processing error in <0085_Update_Religion> 
    : <own religion> is unavailable from event <FactionTurnStart>
    I know it has to do with the event txt but i can´t locate it.
    Can anyone tell what code i should be looking after?
    Contribuitor IBIICB-WOTN-Modeler-Scripter


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

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

    Default Re: Lesson 1

    Its wait_monitors, not wait_monitor. I missed that the first time, sorry.

  14. #54

    Default Re: Lesson 1

    It worked!! that is great news, thanks for the help!!
    + rep to you guys
    By the way sorry for my ignorance but it has been long ago since the last time i used this symbols < > which one means high ;
    is it < 1000 means higher than 1000 or less than 1000?

    thanks
    Last edited by Icedie El Guaraní; June 20, 2009 at 09:31 PM.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


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

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

    Default Re: Lesson 1

    > greater than
    < less than

  16. #56

    Default Re: Lesson 1

    Hey thanks

    Ok here it is:
    Spoiler Alert, click show to read: 
    Code:
    ;
    ; Campaign script
    ;
    script
    
    monitor_event FactionTurnEnd FactionType east_anglia
    and FactionIsLocal
    console_command add_money east_anglia, 40000
    end_monitor
    monitor_event FactionTurnEnd FactionType east_anglia
    and FactionIsLocal
    and Treasury < 3000
    console_command add_money east_anglia, -40000
    end_monitor
    monitor_event FactionTurnEnd FactionType east_anglia
    and FactionIsLocal
    and loosing_money
    console_command add_money east_anglia, 10000
    end_monitor
    monitor_event FactionTurnEnd FactionType east_anglia
    and FactionIsLocal
    and Treasury > 5000
    console_command add_money east_anglia, 1000
    end_monitor
    monitor_event FactionTurnEnd FactionType east_anglia
    and FactionIsLocal
    and SettlementTaxLevel > tax_high
    console_command add_money east_anglia, 5000
    end_monitor
    wait_monitors
    
    end_script


    And here is my log :
    Spoiler Alert, click show to read: 
    Code:
    02:56:01.530 [game.script.exec] [trace] exec <monitor_event> at line 8 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    02:56:01.530 [game.script.exec] [trace] exec <monitor_event> at line 13 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    02:56:01.530 [game.script.exec] [trace] exec <monitor_event> at line 18 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    02:56:01.530 [game.script.exec] [trace] exec <monitor_event> at line 23 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    02:56:01.530 [game.script.exec] [trace] exec <monitor_event> at line 28 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    02:56:01.530 [game.script.exec] [trace] exec <wait_monitors> at line 32 in mods/VacuusLuxLucis/data/world/maps/campaign/imperial_campaign/campaign_script.txt

    Does that means it all worked?

    i did this before i saw your post, so i set a < instead of > and that didn´t trigger but still i got 4 working and i guess that qualifies me for this test, right?
    Last edited by Icedie El Guaraní; June 20, 2009 at 10:04 PM.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  17. #57
    Citizen
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    2,300

    Default Re: Lesson 1

    Here's my very first try on scripting

    Spoiler Alert, click show to read: 
    Code:
    ;
    ;campaign script
    ;
    script
    
    ;Money auxiliary
    monitor_event FactionTurnEnd FactionType england
        and FactionIsLocal
        and Treasury < 0    
        and LosingMoney
        console_command add_money england, 2500 
    end_monitor
    
    
    ;economic boom
    monitor_event 
    FactionTurnEnd FactionType england
        and FactionIsLocal
        and treasury > 10000
        and and FactionIncome > 2000
        console_command add_money england, 1000
    end_monitor
    
    
    ;Useless...
    monitor_event 
    FactionTurnEnd FactionType england
        and FactionIsLocal
        and faction income = 1000
        console commmand add_money england, 100000
    end_monitor
    
    
    ;Money auxiliary 2
    monitor_event 
    FactionTurnEnd FactionType england
        and FactionIsLocal
        and LosingMoney
        console_command add_money england, 2000
    end_monitor
    
    end_script
    Last edited by Fev; June 21, 2009 at 06:14 AM.

  18. #58
    Dewy's Avatar Something Witty
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    4,697

    Default Re: Lesson 1

    Sorry I'm studding for exams that start tomorrow and just signed on with The Last Kingdom as the expert scripter and have just copied and pasted my work done for that. This is above and beyond this lesson in some of the parts but it close enough. I have only put in 4

    Spoiler Alert, click show to read: 
    ;############################################################################
    ;########################### MONEY DEPT SCRIPT ##############################
    ;############################################################################

    monitor_event FactionTurnStart FactionType england
    and IsFactionAIControlled
    and Treasury < 0
    add_money england 5000

    end_monitor

    monitor_event FactionTurnEnd FactionType england
    and IsFactionAIControlled
    and Treasury < -1000
    add_money england 7000

    end_monitor

    ;##############################################################################
    ;###########################STOP THE CHEATER###################################
    ;##############################################################################

    monitor_event FactionTurnStart FactionType england
    and FactionIsLocal
    and I_TurnNumber <= 10
    and Treasury > 30000
    add_money england, -20000
    end_monitor


    monitor_event FactionTurnStart FactionType england
    and FactionIsLocal
    and I_TurnNumber <= 20
    and Treasury > 50000
    add_money england, -40000
    end_monitor
    Oh no the picture of my dog disappeared!

  19. #59
    Dewy's Avatar Something Witty
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    4,697

    Default Re: Lesson 1

    Quote Originally Posted by Icedie of South View Post
    I have made my test , but it didn´t work what is wrong with it?
    Code:
    ;
    ; Campaign script
    ;
    script
    
    monitor_event FactionTurnEnd FactionType east_anglia
    and FactionIsLocal
    console_command add_money east_anglia, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType northumbria
    and FactionIsLocal
    console_command add_money northumbria, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType wessex
    and FactionIsLocal
    console_command add_money wessex, 20000
    end_monitor
    monitor_event FactionTurnEnd FactionType gwynedd
    and FactionIsLocal
    console_command add_money gwynedd, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType fortriu
    and FactionIsLocal
    console_command add_money fortriu, 15000
    end_monitor
    monitor_event FactionTurnEnd FactionType mumhan
    and FactionIsLocal
    console_command add_money mumhan, 15000
    end_monitor
    
    end_script
    I try to play with each one of them and non of them received any bonus.
    try putting in the names of the vanilla version that you replaced
    Oh no the picture of my dog disappeared!

  20. #60

    Default Re: Lesson 1

    This script here are working.

    Spoiler Alert, click show to read: 
    ;
    ; Campaign script
    ;
    script

    monitor_event FactionTurnEnd FactionType england
    and FactionIsLocal
    and Treasury < 500
    console_command add_money england, 3500
    end_monitor

    monitor_event FactionTurnEnd FactionType england
    and FactionIsLocal
    and Treasury > 8000
    console_command add_money england, -3000
    end_monitor

    monitor_event FactionTurnEnd FactionType france
    and FactionIsLocal
    and Treasury < 1000
    console_command add_money france, 2000
    end_monitor

    monitor_event FactionTurnEnd FactionType france
    and FactionIsLocal
    and Treasury > 10000
    console_command add_money france, -3000
    end_monitor


    wait_monitors
    end_script
    Last edited by WikkeD; June 21, 2009 at 04:59 AM.

Posting Permissions

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