Results 1 to 9 of 9

Thread: Why won't my script run properly?

  1. #1
    Now sporting a classic avatar! Member fallen851's Avatar
    Join Date
    Oct 2005
    Posts
    799

    Default Why won't my script run properly?

    The first part of my script is the 4 turns a year piece by Mydral (spelling...), and that part of the script works fine, but then I get into the part where I want the AI to get some extra cash, and it doesn't appear to be working (at least not in Romeshell).

    "script

    suspend_during_battle on
    console_command date -272
    console_command season summer
    while I_TurnNumber = 0
    suspend_unscripted_advice true
    end_while
    ....
    declare_counter loop
    set_counter loop 0

    monitor_event FactionTurnStart Treasury < 10000
    and FactionType romans_julii
    and not I_LocalFaction romans_juli

    console_command add_money roman_julii, 10000

    end_monitor

    while I_CompareCounter loop = 0
    end_while

    end_script"


    The triggers and seasons work fine, but why won't the money script work? When I open Romeshell it doesn't show any money being added, is there another way I can check? If I remove the "not" from "and not I_LocalFaction romans_juli", will it give the money to me?

    Please help. Thanks.
    Last edited by fallen851; 02-16-2006 at 06:57.
    "It's true that when it's looked at isolated, Rome II is a good game... but every time I sit down to play it, every battle, through every turn, I see how Rome I was better. Not unanimously, but ultimately." - Dr. Sane

    http://www.youtube.com/watch?v=L6eaBtzqqFA#t=1h15m33s

  2. #2

    Default Re: Why won't my script run properly?

    Yes, removing the not will add the money to your own treasury when you're playing as the Julii.

    As to making it work, the multiple seasons should pretty much always go at the bottom of your background script.

    So try something like this:

    Code:
    script
    
    ;declare counters
    suspend_during_battle on
    declare_counter loop
    set_counter loop 0
    
    ;money script
    monitor_event FactionTurnStart Treasury < 10000
    and FactionType romans_julii
    and not I_LocalFaction romans_juli
    
    console_command add_money roman_julii, 10000
    
    end_monitor
    
    ;Multiple seasons
    console_command date -272
    console_command season summer
    while I_TurnNumber = 0
    suspend_unscripted_advice true
    end_while
    ....
    
    
    while I_CompareCounter loop = 0
    end_while
    
    end_script
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  3. #3
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Why won't my script run properly?

    Be careful with romans_julii
    if the text in the post is directly copied from script.

  4. #4
    Now sporting a classic avatar! Member fallen851's Avatar
    Join Date
    Oct 2005
    Posts
    799

    Default Re: Why won't my script run properly?

    Thank you both. Any reason why the season script should be below?
    "It's true that when it's looked at isolated, Rome II is a good game... but every time I sit down to play it, every battle, through every turn, I see how Rome I was better. Not unanimously, but ultimately." - Dr. Sane

    http://www.youtube.com/watch?v=L6eaBtzqqFA#t=1h15m33s

  5. #5
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Why won't my script run properly?

    Because the season script pauses in between turns, so anything after or in the middle of the season script only happens after that turn is reached.

    Once you declare a monitor, it continually checks the conditions, so you can declare a monitor at the top of the script and it will keep checking throughout the running of the script.

    So a general scripting tip would be to put monitors and starting commands at the top, then put while loops at the bottom in a logical order.

  6. #6
    Now sporting a classic avatar! Member fallen851's Avatar
    Join Date
    Oct 2005
    Posts
    799

    Default Re: Why won't my script run properly?

    Arg, so I put the money script up top, and the seasons below, but now when I click on a settlement to activate the script, the advisor pops up but the "Show me how" button is greyed out, oddly it didn't do that when the seasons were on top.

    I read Monk's fix in another thread, but I can't get it to work properly. Could someone please explain how to get the button working properly?
    Last edited by fallen851; 02-16-2006 at 20:39.
    "It's true that when it's looked at isolated, Rome II is a good game... but every time I sit down to play it, every battle, through every turn, I see how Rome I was better. Not unanimously, but ultimately." - Dr. Sane

    http://www.youtube.com/watch?v=L6eaBtzqqFA#t=1h15m33s

  7. #7

    Default Re: Why won't my script run properly?

    Greyed out button means that there is some fatal error in your script file and RTW wont allow to use it.
    Launch RTW with -show_err command and on RTW exit you will get information what is wrong.
    Go and fix it.

  8. #8
    Now sporting a classic avatar! Member fallen851's Avatar
    Join Date
    Oct 2005
    Posts
    799

    Default Re: Why won't my script run properly?

    "script error in data/scripts\show_me\A_script.txt at line 7041, column 1

    don't recognize this token: end_script"

    What's the deal?

    EDIT: I think I fixed it.
    Last edited by fallen851; 02-16-2006 at 22:42.
    "It's true that when it's looked at isolated, Rome II is a good game... but every time I sit down to play it, every battle, through every turn, I see how Rome I was better. Not unanimously, but ultimately." - Dr. Sane

    http://www.youtube.com/watch?v=L6eaBtzqqFA#t=1h15m33s

  9. #9
    Now sporting a classic avatar! Member fallen851's Avatar
    Join Date
    Oct 2005
    Posts
    799

    Default Re: Why won't my script run properly?

    Ok, it works, I'd like to thank everyone in this thread for helping me through it.

    Thanks.
    "It's true that when it's looked at isolated, Rome II is a good game... but every time I sit down to play it, every battle, through every turn, I see how Rome I was better. Not unanimously, but ultimately." - Dr. Sane

    http://www.youtube.com/watch?v=L6eaBtzqqFA#t=1h15m33s

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO