Results 1 to 7 of 7

Thread: Script???

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    boboav's Avatar Decanus
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    532

    Default Script???

    Hi, after lot of scripts oin medieval 2 I have tried to do a script on Rome

    first of all I have add this at the end of my descr_strat:

    Code:
    script
    campaign_script.txt
    then, I have created my campaign_script.txt, and make this:

    Code:
    script
    
    
    monitor_event FactionTurnStart FactionIsLocal
    and I_LocalFaction romans_julii
    console_command add_money romans_julii 40000
    end_monitor
    
    
    terminate_script
    but nothing do in game
    Modder of "Bellum Crucis" and "De Bello Mundi"

  2. #2

  3. #3
    Bull3pr00f de Bodemloze's Avatar Occasio mihi fertur
    Join Date
    Dec 2008
    Location
    The Netherlands
    Posts
    5,473

    Default Re: Script???

    Campaign script is a bit buggy on Rome and only works on the first turn. You'll have to create a background script.

  4. #4
    boboav's Avatar Decanus
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    532

    Default Re: Script???

    why the other messages of the discussion has been deleted?
    Modder of "Bellum Crucis" and "De Bello Mundi"

  5. #5
    Finch's Avatar is Deadpool
    Join Date
    Feb 2009
    Location
    X-Mansion
    Posts
    1,678
    Tournaments Joined
    1
    Tournaments Won
    0

    Default Re: Script???

    Quote Originally Posted by boboav View Post
    why the other messages of the discussion has been deleted?
    there has been a service outage check this thread for more information: http://www.twcenter.net/forums/showthread.php?t=463801

    back on topic: you can also make a script that when a faction finance goes down to zero it will add money right away, i think it is explained well in one of the tutorials just search for it, Good luck!




  6. #6

    Default Re: Script???

    For reason unknown, sometimes add_money will not work if the amount is over 20000.

    Here is my experience with RTW/BI's add_money issue:

    Press "~" key and enter the RomeShell, and type the following command

    Code:
    console_command add_money romans_julii 10000
    The shell returns "unknown faction type". Now if you enter,

    Code:
    console_command add_money romans_julii,10000
    You will notice that the Julii faction promptly got an increase of 10000 Denarii.

    Now if you add the exact same line to the campaign script

    Code:
    if not I_LocalFaction romans_julii
         console_command add_money romans_julii,10000
    end_if
    And assume that you are not playing Julii (so the if clause will execute), the game promptly CTD.

    And the following, does absolutely nothing, but at the least it won't crash to CTD.

    Code:
    if not I_LocalFaction romans_julii
         console_command add_money romans_julii 10000
    end_if
    Quote Originally Posted by boboav View Post
    Hi, after lot of scripts oin medieval 2 I have tried to do a script on Rome

    first of all I have add this at the end of my descr_strat:

    Code:
    script
    campaign_script.txt
    then, I have created my campaign_script.txt, and make this:

    Code:
    script
     
     
    monitor_event FactionTurnStart FactionIsLocal
    and I_LocalFaction romans_julii
    console_command add_money romans_julii 40000
    end_monitor
     
     
    terminate_script
    but nothing do in game
    Last edited by parthian shot; August 30, 2011 at 07:00 PM.

  7. #7
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: Script???

    Quote Originally Posted by parthian shot View Post
    Now if you add the exact same line to the campaign script

    Code:
    if not I_LocalFaction romans_julii
         console_command add_money romans_julii,10000
    end_if
    And assume that you are not playing Julii (so the if clause will execute), the game promptly CTD.

    And the following, does absolutely nothing, but at the least it won't crash to CTD.

    Because if that's the only thing in your campaign script it executes before there are any factions, you need to add a wait 5 or something to delay the execution of that line of code.

    Code:
    if not I_LocalFaction romans_julii
         console_command add_money romans_julii 10000
    end_if
    This is syntactically incorrect.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

Posting Permissions

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