Results 1 to 30 of 116

Thread: An Intermediate Guide to Scripting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member Member paullus's Avatar
    Join Date
    Aug 2005
    Location
    always in places where its HOT
    Posts
    11,904

    Default Re: An Intermediate Guide to Scripting

    Quote Originally Posted by Epistolary Richard
    Depends on what the AI faction has done. What AI event do you want to trigger it?
    Beseiging a city would probably be best.
    "The mere statement of fact, though it may excite our interest, is of no benefit to us, but when the knowledge of the cause is added, then the study of history becomes fruitful." -Polybios


  2. #2

    Default Re: An Intermediate Guide to Scripting

    Besieging a city's tricky, you can put a conditional in for a monitor to fire if an enemy family member is within one tile of a certain location and if the two factions are at war.

    Gets a bit cumbersome with large numbers of factions and cities, but it's possible.

    LorDBulA does something similar with his Roma siege script, have a look at his code:
    http://www.twcenter.net/forums/showthread.php?t=24968

    You can use something like that to increment a counter and then have a separate monitor_event FactionTurnStart FactionIsLocal with an I_CompareCounter condition. Be sure to set the counter back to 0 though, otherwise it will keep triggering.
    Last edited by Epistolary Richard; 03-05-2006 at 10:34.
    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

    Default Re: An Intermediate Guide to Scripting

    This is a quite similar question, but I hope it can be done:

    Is it possible to make an army (or naval army) besiege a city/port at game start through a script? I'm not very familiar with scrpits, so I hope someone could help me with this one.

    - Tittils -


    The Fourth Age: Total War - Map Manager, Editor and Coder

  4. #4
    Member Member paullus's Avatar
    Join Date
    Aug 2005
    Location
    always in places where its HOT
    Posts
    11,904

    Default Re: An Intermediate Guide to Scripting

    ER,

    Sorry I was unclear. I meant to say "besieging a neutral city." Unless I'm missing something (certainly a possibility), I don't think those conditions would work with a city you do not own. Is there anything else I could try?

    Thanks much.
    "The mere statement of fact, though it may excite our interest, is of no benefit to us, but when the knowledge of the cause is added, then the study of history becomes fruitful." -Polybios


  5. #5

    Default Re: An Intermediate Guide to Scripting

    As it was said there is no easy way to check for siege.
    The only way is to detect enemy army near a settlement.
    You can do this for any faction holding city and any faction standing next to the city.
    Proximity alert should be set to 2 titles. If you set it to 1 it wont be triggered if enemy attacks from any of city corners.

  6. #6
    Member Member paullus's Avatar
    Join Date
    Aug 2005
    Location
    always in places where its HOT
    Posts
    11,904

    Default Re: An Intermediate Guide to Scripting

    Oh ok, I guess I misunderstood. Thanks.
    "The mere statement of fact, though it may excite our interest, is of no benefit to us, but when the knowledge of the cause is added, then the study of history becomes fruitful." -Polybios


  7. #7

    Default Re: An Intermediate Guide to Scripting

    I don't understand, I'm using Malrubius' code:

    Code:
    monitor_event CharacterTurnStart FactionType empire_west
          and Trait AgeTraitLevel1 = 1
             ; do some stuff
         
    end_monitor
    To do something to the character when a turn starts, but nothing happens. Here's the full code:

    Code:
    	console_command give_trait "Gaius Fabricius" GoodCommander 2
    	campaign_wait 2
    	console_command add_money 1000
    	campaign_wait 2
    
    	monitor_event CharacterTurnStart FactionType empire_west
    		and Trait GoodCommander = 2
    
    		; do stuff
    
    	end_monitor
    I start the campaign, press F1 and run the script, the Trait is added, I press Next Turn expecting some stuff to happen to the char based on that trait, but nothing happens... Help?

    PS: ER, would you like me to use the other thread referencing this one from now on?
    Last edited by SigniferOne; 03-10-2006 at 05:00.

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